6 ms·
Ok, thanks for answering. I guess what I'm really looking for are some practical use cases that can serve as an example, otherwise it will never cross my mind
by simongray 8y ago
Ok, thanks for answering. I guess what I'm really looking for are some practical use cases that can serve as an example, otherwise it will never cross my mind to use logic programming when I need to decide on technologies.
- Blackthorn 8y agoBasically -- anything that you'd use SQL for. SQL is probably the most widely-used logic programming language.
- typon 8y agoSQL does way less things than a full-blown logic programming system
- Blackthorn 8y agoWith common table expressions and windowing, SQL is Turing complete.
- typon 8y agoSo is LaTeX...but people aren't implementing logic programs in it.
- Blackthorn 8y agoThe argument is that minikanren does more than SQL. I strongly disagree.
- haolez 8y agoCare to elaborate? Genuinely curious.
- yorwba 8y agoLanguages of all kinds of paradigms are Turing complete. But we still use different languages for different purposes, because some programs are more convenient to write in a certain paradigm that maps well to their problem domain. In Prolog for example, you can easily define concatenation of cons-lists as concatenate(nil, Ys, Ys). concatenate(cons(X, Xs), Ys, cons(X, Zs)) :- concatenate(Xs, Ys, Zs). and then generate all 4 possible solutions for the query concatenate(X, Y, cons(1, cons(2, cons(3, nil)))). Of course Prolog has built-in lists that'd allow simply writing append(X, Y, [1, 2, 3]), but the ease of defining certain simple algorithms and then running them backwards is what makes logic programming so useful in my opinion. If SQL can express an equivalent program equally succinctly, I'd very much like to see how.