Alternatives to the WAM

Prior to the WAM, there was the ZIP by Clocksin. Its design is still very interesting. SWI-Prolog uses it. And also B-Prolog has slowly migrated from a WAM design towards the ZIP. Of course, on that way many new innovations were developed. Another alternative is the VAM. A comparison as of 1993 is: http://www.complang.tuwien.ac.at/ulrich/papers/PDF/binwam-nov93.pdf In … Read more

different/2 – does a pure, determinate definition exist?

First try! The following code is based on the meta-predicates tfilter/3 and tpartition/4, the monotone if-then-else control construct if_/3, the reified unary logical connective not_t/3, and the reified term equality predicate (=)/3: different([],[_|_]). different([X|Xs0],Ys0) :- tpartition(=(X),Ys0,Es,Ys1), if_(Es=[], true, (tfilter(not_t(=(X)),Xs0,Xs1),different(Xs1,Ys1))). Sample query: ?- different([A,B],[X,Y]). A=Y , dif(B,Y), X=Y ; A=X , B=X , dif(X,Y) ; A=X … Read more

How to create a fact in SWI-Prolog?

I’m assuming you are using swi interactively and trying to enter the fact gives you an error like so: 1 ?- like(x, y). ERROR: toplevel: Undefined procedure: like/2 (DWIM could not correct goal) Since the fact does not exist in the database. If this is the case, try asserting the fact first: 2 ?- assert(like(x,y)). … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)