There's something quite illuminating with this first "horror", where they basically say "it's OK to report wrong answers, because you can check the answers". I don't think I've ever felt like it's OK for my program to provide a list of answers where some are right and some are wrong, but reading this... and generally believing in P != NP.... maybe that's a decent way of looking at some stuff!
Prolog Coding Horror
11–20 of 88 posts
Re: Prolog Coding Horror
#12There's something quite illuminating with this first "horror", where they basically say "it's OK to report wrong answers, because you can check the answers". I don't think I've ever felt like it's OK for my program to provide a list of answers where some are right and some are wrong, but reading this... and generally believing in P != NP.... maybe that's a decent way of looking at some stuff!
If so, the language they thought they were using (and that they should actually use) is datalog, not prolog.
Datalog has declarative semantics: All facts that are derivable from the base database and the rules will be derived by the interpreter, and it will not add extra hallucinated facts. If that's not true, it's a bug in the runtime, not in the language.
Re: Prolog Coding Horror
#13What do people use Prolog for in the real world? I learned about it on a university course and it seems so esoteric compared to other things on the course. Like something invented just for computer scientists to enjoy.
Re: Prolog Coding Horror
#14Earlier quoted context omitted.
Dunno about Prolog, but Datomic uses datalog for its query language, and it’s excellent. Datalog is a subset of Prolog.
What is Datalog used for nowadays?
But you can use it for lots of things. Whenever I'm frustrated with graph based tools being slow (like build systems), I run the graph through a datalog engine for comparison. It's usually much, much faster.
Re: Prolog Coding Horror
#15There's something quite illuminating with this first "horror", where they basically say "it's OK to report wrong answers, because you can check the answers". I don't think I've ever felt like it's OK for my program to provide a list of answers where some are right and some are wrong, but reading this... and generally believing in P != NP.... maybe that's a decent way of looking at some stuff!
Returning 3 was "wrong", but infinitely more correct than retuning 0.
Re: Prolog Coding Horror
#16Re: Prolog Coding Horror
#17What do people use Prolog for in the real world? I learned about it on a university course and it seems so esoteric compared to other things on the course. Like something invented just for computer scientists to enjoy.
Re: Prolog Coding Horror
#18If you want to understand prolog, you must understand the four-port model: https://grack.com/writing/school/enel553/report/prolog.html
Re: Prolog Coding Horror
#19If you want to understand prolog, you must understand the four-port model: https://grack.com/writing/school/enel553/report/prolog.html
And to understand the four-port model is to understand solution-space navigation and pruning.
Re: Prolog Coding Horror
#20There's something quite illuminating with this first "horror", where they basically say "it's OK to report wrong answers, because you can check the answers". I don't think I've ever felt like it's OK for my program to provide a list of answers where some are right and some are wrong, but reading this... and generally believing in P != NP.... maybe that's a decent way of looking at some stuff!