Live data from Hacker News

Logic Programming is Underrated

swannodette.github.io

11–20 of 28 posts

Re: Logic Programming is Underrated

#11
post #7

I think both are wrong ;-) Even programming languages like Prolog needs an expression of the problem that is not exactly how we think in logical expressions. You can't directly translate a first order logic expression to Prolog, you need to add extra thinking before doing that. On the other hand generic combinatorics libraries don't work with large sets. Welcome to SMT (satisfiability modulo theories) where there are…

The SMT bit you mentioned shines a light in one of the gripes I have with logic programming: most often the examples people give are for the sort of AI search problem that might look nice when specified but that you can't hope to solve in practice with a generic depth-first-search.

That said, one thing that I always felt was unique about LP was how one of the primitive operations was data structure unification and how some pieces of code can be run in both "directions" if you are careful. However, I still haven't been able to find a neat example of what sort of problem really benefits from this.

Re: Logic Programming is Underrated

#12
post #7

I think both are wrong ;-) Even programming languages like Prolog needs an expression of the problem that is not exactly how we think in logical expressions. You can't directly translate a first order logic expression to Prolog, you need to add extra thinking before doing that. On the other hand generic combinatorics libraries don't work with large sets. Welcome to SMT (satisfiability modulo theories) where there are…

In case anyone is looking for other novel ways to solve Sudoku. I wrote a CP language a while back that does pretty fast solving for the right kind of problem [1]. Folks might also find this Sudoku benchmarking blog post interesting [2], it includes links to solutions in a bunch of languages.

1) http://sabrlang.org/sudoku

2) http://attractivechaos.wordpress.com/2011/06/19/an-incomplet...

Re: Logic Programming is Underrated

#13
post #7

I think both are wrong ;-) Even programming languages like Prolog needs an expression of the problem that is not exactly how we think in logical expressions. You can't directly translate a first order logic expression to Prolog, you need to add extra thinking before doing that. On the other hand generic combinatorics libraries don't work with large sets. Welcome to SMT (satisfiability modulo theories) where there are…

I think this is also missing the point a bit. SMT solvers are great, but as far I can it's not really SMT vs. CP or LP, they have different strengths and weaknesses. As far as the sudoku example while neat is pretty much identical in approach and expressiveness to the core.logic version I linked to.

Re: Logic Programming is Underrated

#14
post #7

I think both are wrong ;-) Even programming languages like Prolog needs an expression of the problem that is not exactly how we think in logical expressions. You can't directly translate a first order logic expression to Prolog, you need to add extra thinking before doing that. On the other hand generic combinatorics libraries don't work with large sets. Welcome to SMT (satisfiability modulo theories) where there are…

I think this is also missing the point a bit. SMT solvers are great, but as far I can it's not really SMT vs. CP or LP, they have different strengths and weaknesses. As far as the sudoku example while neat is pretty much identical in approach and expressiveness to the core.logic version I linked to.

It's true that they are similar on their expressiveness approach and at the end core.logic could have an SMT making them identical. But when we add SMT we are talking about a different beast.

For example, imagine that you want to implement a professional chess software. One romantic approach would be to find the best and nicest algorithm(s) to do that. SMT, idealistically, adds some "ugliness" trying to reach to a conclusion using every heuristic available. It's an algorithm too but it doesn't end on a good expressiveness but in inserting every heuristic available inside the resolution process.

Re: Logic Programming is Underrated

#15
post #11
post #7

I think both are wrong ;-) Even programming languages like Prolog needs an expression of the problem that is not exactly how we think in logical expressions. You can't directly translate a first order logic expression to Prolog, you need to add extra thinking before doing that. On the other hand generic combinatorics libraries don't work with large sets. Welcome to SMT (satisfiability modulo theories) where there are…

The SMT bit you mentioned shines a light in one of the gripes I have with logic programming: most often the examples people give are for the sort of AI search problem that might look nice when specified but that you can't hope to solve in practice with a generic depth-first-search. That said, one thing that I always felt was unique about LP was how one of the primitive operations was data structure unification and ho…

I still haven't been able to find a neat example of what sort of problem really benefits from this.

I think one of the clear benefits is having a tool to aid you in your research. Speaking about chess, is like what Kasparov envisioned for advanced chess http://en.wikipedia.org/wiki/Advanced_Chess

Re: Logic Programming is Underrated

#17
Smart programmers are underrated.

The reason logic programming is not widespread is 2 fold:

1) It is a new paradigm (just like functional, object oriented) are new paradigms. That makes it much harder to learn. It is not like going from Java to C#.

Look at this http://dtai.cs.kuleuven.be/ppcbook there are solutions to problems in Prolog. Solutions are amazingly short, and concise. They are beautiful in how succinct they are. But few programmers could produce them. It is just too hard to make incremental updates and debug logic programming.

2) It is not really that useful in real world as a general purpose language. And it is sure not for the lack of trying. It was supposed to be the 5th generation language in Japan, the future, money and brainpower was thrown at it and ... not much happened. People wanted to server data over the networks, render games, search databases, sort data, multiply matrices and in not too many of those domain logic programming screams as "this is the most obvious paradigm". Because it isn't.

Re: Logic Programming is Underrated

#18
post #17

Smart programmers are underrated. The reason logic programming is not widespread is 2 fold: 1) It is a new paradigm (just like functional, object oriented) are new paradigms. That makes it much harder to learn. It is not like going from Java to C#. Look at this http://dtai.cs.kuleuven.be/ppcbook there are solutions to problems in Prolog. Solutions are amazingly short, and concise. They are beautiful in how succinct t…

I'd hardly call logic programming new. At 40+ years old, it's one of the oldest paradigms in computer science!

Re: Logic Programming is Underrated

#19
post #18
post #17

Smart programmers are underrated. The reason logic programming is not widespread is 2 fold: 1) It is a new paradigm (just like functional, object oriented) are new paradigms. That makes it much harder to learn. It is not like going from Java to C#. Look at this http://dtai.cs.kuleuven.be/ppcbook there are solutions to problems in Prolog. Solutions are amazingly short, and concise. They are beautiful in how succinct t…

I'd hardly call logic programming new. At 40+ years old, it's one of the oldest paradigms in computer science!

It is new for every person learning it. Every paradigm is a new paradigm for the person learning it. When someone learns logic programming usually they already learned structured or object oriented already. Then logic is _new_ for them and _them_ here is almost every programmer out there.

And the fact that is 40+ years old actually supports my point. It is so old yet it hasn't caught on yet. Maybe just maybe it is waiting for its time in the limelight and it hasn't come yet... Or is that Bananarama playing in the background, and my Sony Walkman is running out of batteries... ;-)

Post reply on HN