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

I thought I had it all figured out

Name: LISPPER 2012-12-31 8:27

But then this fucker had to post some Prolog code and I was mesmerized. Fuck. FUCK.

Name: Anonymous 2012-12-31 10:59

>>15
I believe prolog is strict in general, although I'm not sure how this is specified with backtracking and all. I know there are a few parallelizing prolog compilers. But in that example the ; means disjunction, so as soon as the true is satisfied, I think it would not evaluate the infinite_loop. But I'm not sure where this is outlined in a standard. And the prolog operators don't seem to be invertible by default, but you could define invertible ones.


sum(X,Y,Z) :- nonvar(X), nonvar(Y), Z is X + Y;
              nonvar(Z), nonvar(Y), X is Z - Y;
              nonvar(Z), nonvar(X), Y is Z - X.


That's an interesting point about the floating point numbers. It would keep the image/preimage calculation from being totally consistent. I don't know if invertible arithmetic is really supported by prolog at that level.

Name: Anonymous 2012-12-31 10:59

>>15
Prolog is non-applicative, you'll either get into an infinite loop or run out of stack only during solution aggregation OR after typing semicolon during query interaction, but this is only the case if a relating predicate didn't cut first, and is/2 isn't invertible at all, so it applies to operations of all number classes.

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