>>11
Are you sure you want a non deterministic lambda calculus? Do you really want to go there? You might not like what you find.
Name:
Anonymous2012-12-31 10:25
>>12
I have a bad feeling about this, and despite that, I take the red pill. Show me the truth.
Name:
Anonymous2012-12-31 10:28
>>13
Hmm, well unfortunately I haven't quite gotten there myself either. But I'm guessing it would be something of a merge of lambda calculus and one of those relational algebras. Lets pop over the rocks and dig up the grubs!
Name:
Anonymous2012-12-31 10:37
Is Prolog strict (evaluation-wise)? If you write something like blah :- true; infinite_loop., what do you get? Also, almost all floating point operations aren't invertible, how do you deal with that?
Name:
Anonymous2012-12-31 10:51
i've found once quite neat implementation of ``prolog'' in ????????????????????????????, different syntax though. sadly, i've lost that link.
Name:
Anonymous2012-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:
Anonymous2012-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.
Name:
Anonymous2012-12-31 11:05
>>17,18
Would specifying an "order of evaluation" (thus making it strict) ruin the language in some fundamental sense?
Name:
Anonymous2012-12-31 11:32
>>19
If your asking for a comparison with prolog and haskell, you can do some haskelly things in prolog. Rather than a function returning a lazy list, you can define a relation that binds an output parameter to a member of a (possibly infinite) list. But prolog defines procedures that have side effects, so this places a constraint on how evaluation is done. There are also a few built ins that manipulation how things are evaluated.
Name:
Anonymous2012-12-31 11:44
>>19
If you mean by order of evaluation as to whether the leftmost is "used" first, most prologs do that, depending on what the operator is: ,/2 and ;/2 do this to be generally useful, otherwise the cut operator becomes meaningless. Implication ->/2 is roughly defined as (A, !, B; fail) where ! is a slightly tweaked cut operator, if I'm not mistaken.
If Prolog became strict as in applicative like C or Pascal, it wouldn't be the same at all, its very much like REBOL and Lisp macros as the arguments of every "call" are its own DSL. Prolog is in fact a bunch of operators that looks like it has syntax. :-/2 (and :-/1) is also an operator that probably does nothing but gets parsed by consult/1 in many Prolog implementations into instructions for some VM and made ready for querying.
Name:
Anonymous2013-01-05 18:49
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Could someone explain to me what makes Prolog special? What does declarative logic programming have over untyped lambda calculus as a computational model? It seems to me as if the latter maps better to what the machine actually does, but that might just be me.
The only application I ever found was checking transitivity in some stupid relations. For instance, bus goes from 1 to 2, 2 to 3, 2 to 4, 4 to 5, 2 to 5, does it go from 1 to 5?
I know, I'm a fucking retard.
Name:
Anonymous2013-01-05 19:55
Your new job is to add a Prolog DSL to your favorite Lisp or Scheme implementation. You can take some inspiration from the Shen language.
>>25
Most of the people in this thread are LISPPERs, they know surface syntax is an irrelevant detail.
Name:
Anonymous2013-01-05 23:48
>>22
If I'm not mistaken, some japanese folks tried to create a computer architecture specifically for prolog. I'm having trouble finding it now. I don't think they had much success, or if they did, they couldn't match the same progress that was being made on our conventional stack based register machines. Whenever you ask if a language represents what the machine does, you need to specify the target machine first. Assembly would be the most direct. Then the simple stack based imperative languages. The functional ones also fit well into stack based register machines. Continuations don't mix as well, but an efficient implementation is possible. Then there's haskell. Some people might find it odd that you can map an infinite list, but under the hood the implementation isn't doing anything that can't also be in C or the more primitive languages. Then there's prolog. I don't think it would be hard to write a prolog compiler, but I think it would be hard to write an optimizing compiler that generated the same type of code you'd see for other high level languages. You'd need to identify when the program actually requires all of prolog's features, and when it doesn't need them.
Name:
Anonymous2013-01-06 1:36
>>26
Lisp syntax is very simple to parse. Prolog's not so much.
>>3
>Blessed be the Theorem Prover, for He will never give up the pursuit of truth.
I'm stealing that line but can pay you in blow jobs if you don't take kindly to the whole 'robbery' thing.