Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Always halting subset of prolog

Name: Anonymous 2012-07-20 1:48

What would an infinite loop in pure prolog look like? How hard would it be to construct a subset of prolog in which termination is guaranteed? Total functional declarative and imperative languages exist, but I don't know of any that are logical.

Name: Anonymous 2012-07-20 2:17

One based on first order logic. And by that, I mean Datalog.

Name: Anonymous 2012-07-20 5:28

Just make a rule that's dependent on itself.

cyclic(X) :- cyclic(X).

Then all you have to do is make a query asking if it's true for some value or for which values it is true.

?- cyclic(X).

Name: Anonymous 2012-07-20 7:13

>>2
This also means that Datalog isn't Turing complete.

Name: Anonymous 2012-07-20 7:26

>>4
Which is what >>1 was asking for.

Don't change these.
Name: Email:
Entire Thread Thread List