CFG/DCG Demo 1 - CSC 366 Home Page - CSC 366 A14 Page - Code 1

...@...:~/Desktop/dcg$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.6.1)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- consult('dcg.pro').
true.

?- recognizer.
|: use five six four seven and zero to make zero.
Ok
|: use whatever to make whatever.
Ok
|: use 8 and 4 and 3 and two and 2 to make zero.
Not a sentence ...
|: can you make four from the first five positive numbers.
Not a sentence ...
|: can you make four with the first five positive numbers?
Ok
|: can you make five with six and five and four and three and one?
Ok
|: ^C
^C

WARNING: By typing Control-C twice, you have forced an asynchronous
WARNING: interrupt.  Your only SAFE operations are: c(ontinue), p(id),
WARNING: s(stack) and e(xit).  Notably a(abort) often works, but
WARNING: leaves the system in an UNSTABLE state

Action (h for help) ? abort
% Execution Aborted
?-