Skip to content

Instantly share code, notes, and snippets.

@washtubs
Created July 20, 2014 07:23
Show Gist options
  • Save washtubs/0118d4892be78514148e to your computer and use it in GitHub Desktop.
Save washtubs/0118d4892be78514148e to your computer and use it in GitHub Desktop.
Prolog if -> else
test(X,Y) :- % if -> else construct in prolog (converts atom 'True' to fact true)
( X = 'True' -> Y = true
; X = 'False' -> Y = false
).
% ?- test('True',Y), Y.
% Y = true.
%
% ?- test('False',Y), Y.
% false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment