LA home

Also see
Prolog (Programming in Logic) is a programming language based on Predicate Logic. It uses the restricted syntax of Horn Clauses:
Predicates, e.g., floats(), etc.
Operators <=, and, not
Logical variables X, GP, etc.
Constants 7, girl, etc.
Function names f, left(), ...
Facts female(girl).
rules burns(X) <= wooden(X).
queries witch(girl).
Quantification of logical variables is implicit -- universal for facts and rules, existential for queries.
The introduction will get you going and there are more examples. The interpreter shows how Prolog works.

This prototype javascript implementation of Prolog; (21/1/'18) will eventually> spread to other pages.
<= (also :- ) can be read as if, or as is implied by.
planet(P)<=orbits(P,sun)  can be read as ∀ P, P is a planet if P orbits the sun. (That is not to say that the definition cannot be tightened.)
?satellite(S) can be read as does there exist an S such that S is a satellite?
And the answer, here, is yes, if S is earth's moon, or a moon of another planet.
www #ad:

↑ © L. Allison,   (or as otherwise indicated).
Created with "vi (Linux)",  charset=iso-8859-1,   fetched Thursday, 15-Apr-2021 09:16:01 EDT.

Free: Linux, Ubuntu operating-sys, OpenOffice office-suite, The GIMP ~photoshop, Firefox web-browser, FlashBlock flash on/off.