| Shawn O. Pearce | 5e00711 | 2011-06-21 14:14:34 -0700 | [diff] [blame] | 1 | prolog-shell |
| 2 | ============ |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | prolog-shell - Simple interactive Prolog interpreter |
| 7 | |
| 8 | SYNOPSIS |
| 9 | -------- |
| 10 | [verse] |
| 11 | 'java' -jar gerrit.war 'prolog-shell' [-s FILE.pl ...] |
| 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | Provides a simple interactive Prolog interpreter for development |
| 16 | and testing. |
| 17 | |
| 18 | OPTIONS |
| 19 | ------- |
| 20 | -s:: |
| 21 | Dynamically load the Prolog source code at startup, |
| 22 | as though the user had entered `['FILE.pl'].` into |
| 23 | the interepter once it was running. This option may |
| 24 | be supplied more than once to load multiple files. |
| 25 | |
| 26 | EXAMPLES |
| 27 | -------- |
| 28 | Define a simple predicate and test it: |
| 29 | |
| 30 | ==== |
| 31 | $ cat >simple.pl |
| 32 | food(apple). |
| 33 | food(orange). |
| 34 | ^D |
| 35 | |
| 36 | $ java -jar gerrit.war prolog-shell -s simple.pl |
| 37 | Gerrit Code Review 2.2.1-84-ge9c3992 - Interactive Prolog Shell |
| 38 | based on Prolog Cafe 1.2.5 (mantis) |
| 39 | Copyright(C) 1997-2009 M.Banbara and N.Tamura |
| 40 | (type Ctrl-D or "halt." to exit, "['path/to/file.pl']." to load a file) |
| 41 | |
| 42 | {consulting /usr/local/google/users/sop/gerrit2/gerrit/simple.pl ...} |
| 43 | {/usr/local/google/users/sop/gerrit2/gerrit/simple.pl consulted 99 msec} |
| 44 | |
| 45 | | ?- food(Type). |
| 46 | |
| 47 | Type = apple ? ; |
| 48 | |
| 49 | Type = orange ? ; |
| 50 | |
| 51 | no |
| 52 | | ?- |
| 53 | ==== |
| 54 | |
| 55 | GERRIT |
| 56 | ------ |
| 57 | Part of link:index.html[Gerrit Code Review] |