Hacker News new | ask | show | jobs
by hjek 2559 days ago
I haven't used Prolog at that scale myself, but I'll just add completely unsubstantiated hearsay from the ##Prolog IRC on FreeNode: Someone reported no problems using SWI Prolog for running queries on "59 million facts".

It might also be worth checking Triska's video about n-queens[0] where the last 2/3 is all about optimising the search and using different labelling strategies.

Don't know if it's relevant for your problem, but memoization is also a thing in Prolog[1] like in other languages.

Maybe not the answer you're looking for. Is your system relatively simple to describe? Then we can give it a try...

[0]: https://invidio.us/watch?v=l_tbL9RjFdo

[1]: https://swish.swi-prolog.org/example/tabling.swinb

1 comments

59M sounds pretty sweet!

I'll check out Triska's videos when I pick up my Prolog book on writing a text adventure again. It's pretty much the only Prolog book that helps walk me through it without the theory. I do like theory, but I need a high level overview first before I can make sense of anything.

The basics of the system are very easy to describe, but realistic system implementations are waaay more complex and have hundreds of pages of solver code and SQL packages. A very simple example on a tiny system would be the below:

https://www.juliaopt.org/notebooks/Dvorkin%20-%20Power%20sys...