From 78463cedab54108b39bd16610d32527c54723b3d Mon Sep 17 00:00:00 2001 From: Tim Vieira Date: Mon, 1 Jul 2013 00:38:27 -0400 Subject: [PATCH] changed repl prompt commented out failed attempt at providing 'for X in [1,2,3]' hid developer tools from repl. trace: - fixed cycle detection - terser information printed for each edge. item => value | += val1 | | instantiated rule with subexpressions and variable values shown | inline. | | RECURSE on items in rule. | | += val2 - changed color coding. - documentation, `> help trace` No more barfing on empty input to trace, query, vquery. --- examples/fib-bc.dyna | 9 +++++++++ examples/peano.dyna | 2 ++ 2 files changed, 11 insertions(+) create mode 100644 examples/fib-bc.dyna create mode 100644 examples/peano.dyna diff --git a/examples/fib-bc.dyna b/examples/fib-bc.dyna new file mode 100644 index 0000000..a4d7738 --- /dev/null +++ b/examples/fib-bc.dyna @@ -0,0 +1,9 @@ +:- backchain f/1. + +f(X) := f(X-1) + f(X-2) for X > 1. +f(1) := 1. +f(0) := 1. + +a := f(3). +b := f(4). +c := f(5). diff --git a/examples/peano.dyna b/examples/peano.dyna new file mode 100644 index 0000000..6e0650d --- /dev/null +++ b/examples/peano.dyna @@ -0,0 +1,2 @@ +value(&z) := 0. +value(&s(X)) := 1+value(X) for value(X) < 10. -- 2.50.1