What is more interesting or powerful: Curry, Mercury or Lambda-Prolog?
Asked Answered
B

4

21

I would like to ask you about what formal system could be more interesting to implement from scratch/reverse engineer.

I've looked through some existing and open-source projects of logical/declarative programming systems. I've decided to make up something similar in my free time, or at least to catch the general idea of implementation.

It would be great if some of these systems would provide most of the expressive power and conciseness of modern academic investigations in logic and its relation with computational models.

What would you recommend to study at least at the conceptual level? For example, Lambda-Prolog is interesting particularly because it allows for higher order relations, but AFAIK is based on intuitionist logic and therefore lack the excluded-middle principle; that's generally a disadvantage for me.

I would also welcome any suggestions about modern logical programming systems which are less popular but more expressive/powerful.

Bergess answered 1/6, 2010 at 16:11 Comment(1)
This is a similar question: #17675633Lowry
P
18

Prolog was the first language which changed my point of view at programming. But later I found it to be not so high-level as I'd like to see it.

Curry - I've tried only Munster CC, and found it somewhat inconvenient. Actually, at this point, I decided to stop ignoring Haskell.

Mercury has many things which I wanted to see in Prolog. I have a really good expectation about the possibility to distinguish modes of rules. Programs written in Mercury should inspire compiler to do a lot of optimizations (I guess).

Panoply answered 2/6, 2010 at 9:30 Comment(1)
Prolog is fascinating. But even more so, is how "simple" it really is.High
A
10

Twelf.

It generalizes lambda-prolog significantly, and it's a logical framework and a metalogical framework as well as a logic programming language. If you need a language with a heavy focus on logic as well as computation, it's the best I know of.

Addlepated answered 30/7, 2010 at 9:30 Comment(1)
There haven't been any updates to Twelf since 2013. Do you know if it's still an active project?Waylon
J
4

If I were to try to extend a logic based system, I'd choose Prolog Cafe as it is small, open sourced, standards compliant, and can be easily integrated into java based systems.

Jefferey answered 18/7, 2010 at 22:57 Comment(0)
H
3

For the final project in a programming languages course I took, we had to embed a Prolog evaluator in Scheme using continuations and macros. The end result was that you could freely mix Scheme and Prolog code, and even pass arbitrary predicates written in Scheme to the Prolog engine.

It was a very instructive exercise. The first 12 lines of code (and and or) literally took about 6 hours to write and get correct. It was pretty much the search logic, written very concisely using continuations. The rest followed a bit more easily. Then once I added the unification algorithm, it all just worked.

Hirsutism answered 4/6, 2010 at 19:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.