From b9561ec8dbae6a890b61cbad1662e1f0389dabb3 Mon Sep 17 00:00:00 2001 From: Markus Triska Date: Tue, 17 Mar 2020 17:42:57 +0100 Subject: [PATCH] update toplevel interaction --- README.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f94157a7..823e3936 100644 --- a/README.md +++ b/README.md @@ -156,11 +156,10 @@ Wildcards work as well: member(X, [X|_]). member(X, [_|Xs]) :- member(X, Xs). ?- member(X, [a, b, c]). -true . -X = a ; -X = b ; -X = c ; -false. + X = a +; X = b +; X = c +; false. ``` and so do conjunctive queries: ``` @@ -170,10 +169,9 @@ f(X) :- g(X). g(x). g(y). g(z). h(call(f, X)). ?- h(X), X. -true . -X = call(f, x) ; -X = call(f, y) ; -X = call(f, z). + X = call(f,x) +; X = call(f,y) +; X = call(f,z). ``` Note that the values of variables belonging to successful queries are @@ -191,8 +189,8 @@ Scryer supports dynamic operators. Using the built-in arithmetic operators with the usual precedences, ``` -?- write_canonical(-5 + 3 - (2 * 4) // 8). --(+(-(5), 3), //(*(2, 4), 8)) +?- write_canonical(-5 + 3 - (2 * 4) // 8), nl. + -(+(-5,3),//(*(2,4),8)) true. ``` @@ -256,7 +254,7 @@ The modules that ship with Scryer Prolog are also called * [`si`](src/prolog/lib/si.pl) The predicates `atom_si/1`, `integer_si/1`, `atomic_si/1` and `list_si/1` implement sound type checks. They raise - instantiation errors of no decision can be made. + instantiation errors if no decision can be made. They are declarative replacements for logically flawed lower-level type tests. For instance, instead of `integer(X)`, write `integer_si(X)` to ensure soundness of your programs. -- 2.54.0