‘if’ in prolog?

A standard prolog predicate will do this. will evaluate to true if you call it with 5 and fail(return false) if you run it with anything else. For not equal you use \= Technically it is does not unify, but it is similar to not equal. Learn Prolog Now is a good website for learning … Read more

singleton variables in prolog

Singleton variables are useless in Prolog, and are easily introduced by editing typos. The warning is welcome to me, as it allows to easily spot such frequent cause of error. Being a warning, you can run code containing singletons, but any value these eventually will assume will be lost. I don’t think that ISO standard (never heard about ANSI) forbids such variables. You could … Read more

tech