From f29bd3dc0bb29d7e0946c3434fc06c7866fdc82b Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Fri, 26 May 2017 12:27:41 -0600 Subject: [PATCH] add tests, add to README. --- README.md | 9 ++++++++- src/main.rs | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 75028800..5ebf60f8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,14 @@ Extend rusty-wam to include the following, among other features: * Mode declarations. * Extensions for clp(FD). * `if_` and related predicates, following the developments of the - paper "Indexing `dif/2`". + paper "Indexing `dif/2`". +* Strings, blobs, and other data types typical of Prolog that may not yet + know of or have left out. + +## Phase 3 + +Use the WAM code generated by the completed code generator to target LLVM +IR to get JIT-compiled and -executed Prolog programs. ## Tutorial To enter a multi-clause predicate, the brackets ":{" and "}:" are used diff --git a/src/main.rs b/src/main.rs index 70d9d605..962c35d0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -615,7 +615,16 @@ mod tests { submit(&mut wam, "f(P, X) :- call(P, X)."); - assert_eq!(submit(&mut wam, "?- f(p(one), one)."), true); + assert_eq!(submit(&mut wam, "?- f(p(one), one)."), true); + assert_eq!(submit(&mut wam, "?- f(p(two), two)."), true); + assert_eq!(submit(&mut wam, "?- f(p(two), one)."), false); + assert_eq!(submit(&mut wam, "?- f(p(three), one)."), false); + assert_eq!(submit(&mut wam, "?- f(p(one), three)."), false); + assert_eq!(submit(&mut wam, "?- f(p(two), three)."), false); + + submit(&mut wam, "p(f(g(X)), compound, [lists,are,good])."); + + assert_eq!(submit(&mut wam, "?- call(p(f(g(X))), Y, Z)."), true); } } -- 2.54.0