This program to demonstrate the use of operators in Prolog.
The program starts automatically when the file is consulted and presents a prompt >. The user inputs a sentence in propositional logic and the program outputs its truth value and then re-presents the prompt. The program terminates when the user types stop..
?- [logic].
% logic compiled 0.00 sec, 220 bytes Yes > p. true > q. true > r. false > p and q. true > p and r. false > p or r. true > r or p. true > p implies q. true > p implies r. false > r implies p. true > r implies r. true > p implies ~r. true > stop. goodbye yes |