Last active
May 15, 2022 18:03
-
-
Save joneshf/6715206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- module(booleans, [and/2, or/2]). | |
:- op(1000, xfy, and). | |
:- op(1000, xfy, or). | |
and(P, Q) :- P , Q. | |
or(P, Q) :- P ; Q. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ prolog swipl | |
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.2.6) | |
Copyright (c) 1990-2012 University of Amsterdam, VU Amsterdam | |
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, | |
and you are welcome to redistribute it under certain conditions. | |
Please visit http://www.swi-prolog.org for details. | |
For help, use ?- help(Topic). or ?- apropos(Word). | |
?- [booleans]. | |
% booleans compiled into booleans 0.00 sec, 3 clauses | |
true. | |
?- true and false. | |
ERROR: Syntax error: Operator expected | |
ERROR: true | |
ERROR: ** here ** | |
ERROR: and false . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment