Live data from Hacker News

Can logic programming be liberated from predicates and backtracking? [pdf]

www-ps.informatik.uni-kiel.de

101–102 of 102 posts

Re: Can logic programming be liberated from predicates and backtracking? [pdf]

#101
post #99

Earlier quoted context omitted.

I think there are declarative elements in various high-level languages, e.g. Linq queries in C# so I guess it is an exageration to say "zero-declarative", but in general the level of declarative-ness is tiny compared to Prolog. Did I misunderstand what you mean?

Have you tried Haskell? For example, it is possible to embed backtracking logic programming [1] into Haskell with not a big effort. [1] https://hackage.haskell.org/package/logict

It sure is if you read enough "Functional Pearls" to think all you need for logic programming is some backtracking. Oh, and the cut. Because you can't control backtracking without the cut. Not if you don't understand what the backtracking is for in the first place! Mwahahaha.

Oh sorry. Did I let my schadenfreude out again?

Re: Can logic programming be liberated from predicates and backtracking? [pdf]

#102
post #98

Earlier quoted context omitted.

> Develop your own ad hoc run-time type and mode checking system. "Any sufficiently complicated List or Prolog program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Haskell type inference and checking system." Modelled after Greenspun's Tenth Rule [1]. [1] https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule

I suppose you could hack a bug-ridden implementation of Prolog unification in Prolog but why? Hindley-Milner type inference is unification over types and unification is built-in to Prolog. Functional programmers ignore this because their textbooks never refer to the original description of unification by Robinson. Wait who? Unification was probably invented by Damas, Hindley or Milner right? Or maybe Haskell Curry? H…

Prolog was introduced into general public in 1972, 4 years after Hindley's algorithm that used unification and substitution.

In any case, what was suggested is, frankly, a development of the (tailored up) type system.

My experiece suggests that this development will not be without caveats, especially related to performance.

Post reply on HN