summaryrefslogtreecommitdiffstats
path: root/test/samples/uscxml/prolog/likes.pl
diff options
context:
space:
mode:
Diffstat (limited to 'test/samples/uscxml/prolog/likes.pl')
-rw-r--r--test/samples/uscxml/prolog/likes.pl38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/samples/uscxml/prolog/likes.pl b/test/samples/uscxml/prolog/likes.pl
new file mode 100644
index 0000000..22395ed
--- /dev/null
+++ b/test/samples/uscxml/prolog/likes.pl
@@ -0,0 +1,38 @@
+%% Demo coming from http://clwww.essex.ac.uk/course/LG519/2-facts/index_18.html
+%%
+%% Please load this file into SWI-Prolog
+%%
+%% Sam's likes and dislikes in food
+%%
+%% Considering the following will give some practice
+%% in thinking about backtracking.
+%% ?- likes(sam,dahl).
+%% ?- likes(sam,chop_suey).
+%% ?- likes(sam,pizza).
+%% ?- likes(sam,chips).
+%% ?- likes(sam,curry).
+
+likes(sam,Food) :-
+ indian(Food),
+ mild(Food).
+likes(sam,Food) :-
+ chinese(Food).
+likes(sam,Food) :-
+ italian(Food).
+likes(sam,chips).
+
+indian(curry).
+indian(dahl).
+indian(tandoori).
+indian(kurma).
+
+mild(dahl).
+mild(tandoori).
+mild(kurma).
+
+chinese(chow_mein).
+chinese(chop_suey).
+chinese(sweet_and_sour).
+
+italian(pizza).
+italian(spaghetti).