| | 5 | |
| | 6 | For more information about the formal definition of the language and its semantics you should consult [http://arxiv.org/abs/1106.3457 this paper]. |
| | 7 | |
| | 8 | |
| | 9 | == Getting Started with the Interpreter == |
| | 10 | |
| | 11 | To checkout the source from the darcs repository you should execute |
| | 12 | {{{ |
| | 13 | darcs get http://code.haskell.org/hopes hopes |
| | 14 | }}} |
| | 15 | |
| | 16 | To compile the source you must install the cabal package and execute |
| | 17 | {{{ |
| | 18 | make |
| | 19 | }}} |
| | 20 | |
| | 21 | |
| | 22 | == Examples == |
| | 23 | |
| | 24 | In order to gain some intuition behind logic programming in HOPES some simple examples are given. |
| | 25 | |
| | 26 | The ordered predicate is the simple second-order predicate that holds if the |
| | 27 | relation R is an ordering of the list. |
| | 28 | {{{ |
| | 29 | ordered(R, []). |
| | 30 | ordered(R, [X]). |
| | 31 | ordered(R, [X, Y| Z]):- R(X,Y), ordered(R, [Y|Z]). |
| | 32 | }}} |
| | 33 | |
| | 34 | The popular map predicate: |
| | 35 | {{{ |
| | 36 | map(R, [], []). |
| | 37 | map(R, [X|Xs], [Y|Ys]) :- R(X, Y), map(R, Xs, Ys). |
| | 38 | }}} |
| | 39 | |
| | 40 | == Related Systems == |
| | 41 | |
| | 42 | * [http://teyjus.cs.umn.edu/ Teygus] is an implementation of [http://www.lix.polytechnique.fr/~dale/lProlog/ lambdaProlog]. |
| | 43 | * [http://xsb.sourceforge.net/index.html XSB] includes an implementation of [http://www.cs.stonybrook.edu/~kifer/TechReports/hilog.pdf HiLog]. |