summaryrefslogtreecommitdiffstats
path: root/test/samples
diff options
context:
space:
mode:
Diffstat (limited to 'test/samples')
-rw-r--r--test/samples/uscxml/prolog/likes.pl38
-rw-r--r--test/samples/uscxml/test-prolog.scxml11
2 files changed, 46 insertions, 3 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).
diff --git a/test/samples/uscxml/test-prolog.scxml b/test/samples/uscxml/test-prolog.scxml
index 75a1c64..85d45bc 100644
--- a/test/samples/uscxml/test-prolog.scxml
+++ b/test/samples/uscxml/test-prolog.scxml
@@ -1,14 +1,19 @@
<scxml datamodel="prolog" initial="start" binding="late">
<datamodel>
- <data id="facts">
+ <!-- data id="facts">
cat(tom).
animal(X):- cat(X).
- </data>
+ </data -->
+ <data id="likes" src="prolog/likes.pl" />
</datamodel>
- <script>
+ <!-- script>
cat(tom).
cat(X).
animal(X).
+ </script -->
+ <script>
+ likes(sam,curry).
+ likes(sam,chips).
</script>
<state id="start">
</state>