From 9bcecec381de2b6303fbb0710a5412d9727412e3 Mon Sep 17 00:00:00 2001 From: Tim Vieira Date: Sun, 30 Jun 2013 14:09:32 -0400 Subject: [PATCH] Changed output format for solution --- examples/expected/dijkstra.py.out | 50 ++++----- examples/expected/equalities.py.out | 14 +-- examples/expected/fib-limit.py.out | 20 ++-- examples/expected/geom.py.out | 2 +- examples/expected/lists.py.out | 4 +- examples/expected/matrixops.py.out | 64 ++++++------ examples/expected/papa2.py.out | 110 ++++++++++---------- examples/expected/simple.py.out | 6 +- src/Dyna/Backend/Python/chart.py | 23 ++-- src/Dyna/Backend/Python/load/matrix.py | 28 ++--- src/Dyna/Backend/Python/load/sexpr.py | 4 +- src/Dyna/Backend/Python/load/tsv.py | 14 +-- src/Dyna/Backend/Python/repl.py | 14 +-- test/repl/aggregator-conflict.expect | 4 +- test/repl/late-aggregator-assignment.expect | 6 +- test/repl/retract-rule.expect | 12 +-- 16 files changed, 182 insertions(+), 193 deletions(-) diff --git a/examples/expected/dijkstra.py.out b/examples/expected/dijkstra.py.out index 0331585..3199aca 100644 --- a/examples/expected/dijkstra.py.out +++ b/examples/expected/dijkstra.py.out @@ -1,35 +1,35 @@ Solution ======== -end := "MyHouse" -goal := 2410 -start := "FriendHouse" +end => "MyHouse". +goal => 2410. +start => "FriendHouse". edge/2 ====== -edge("BOS","JFK") := 187 -edge("BOS","MIA") := 1258 -edge("DFW","LAX") := 1235 -edge("DFW","ORD") := 802 -edge("FriendHouse","BOS") := 10 -edge("JFK","DFW") := 1391 -edge("JFK","MIA") := 1090 -edge("JFK","SFO") := 2582 -edge("LAX","ORD") := 1749 -edge("MIA","DFW") := 1121 -edge("MIA","LAX") := 2342 -edge("ORD","DFW") := 802 -edge("ORD","MyHouse") := 20 +edge("BOS","JFK") => 187. +edge("BOS","MIA") => 1258. +edge("DFW","LAX") => 1235. +edge("DFW","ORD") => 802. +edge("FriendHouse","BOS") => 10. +edge("JFK","DFW") => 1391. +edge("JFK","MIA") => 1090. +edge("JFK","SFO") => 2582. +edge("LAX","ORD") => 1749. +edge("MIA","DFW") => 1121. +edge("MIA","LAX") => 2342. +edge("ORD","DFW") => 802. +edge("ORD","MyHouse") => 20. path/1 ====== -path("BOS") := 10 -path("DFW") := 1588 -path("FriendHouse") := 0 -path("JFK") := 197 -path("LAX") := 2823 -path("MIA") := 1268 -path("MyHouse") := 2410 -path("ORD") := 2390 -path("SFO") := 2779 +path("BOS") => 10. +path("DFW") => 1588. +path("FriendHouse") => 0. +path("JFK") => 197. +path("LAX") => 2823. +path("MIA") => 1268. +path("MyHouse") => 2410. +path("ORD") => 2390. +path("SFO") => 2779. diff --git a/examples/expected/equalities.py.out b/examples/expected/equalities.py.out index f4e53c2..a9e2991 100644 --- a/examples/expected/equalities.py.out +++ b/examples/expected/equalities.py.out @@ -1,11 +1,11 @@ Solution ======== -a := 0 -b := 0 -by_evl_cross := true -by_evl_refl := true -by_is_0a := true -by_syn_cross := false -by_syn_refl := true +a => 0. +b => 0. +by_evl_cross => true. +by_evl_refl => true. +by_is_0a => true. +by_syn_cross => false. +by_syn_refl => true. diff --git a/examples/expected/fib-limit.py.out b/examples/expected/fib-limit.py.out index db580ec..dddc39e 100644 --- a/examples/expected/fib-limit.py.out +++ b/examples/expected/fib-limit.py.out @@ -1,17 +1,17 @@ Solution ======== -lim := 10 +lim => 10. f/1 === -f(1) := 1 -f(2) := 1 -f(3) := 2 -f(4) := 3 -f(5) := 5 -f(6) := 8 -f(7) := 13 -f(8) := 21 -f(9) := 34 +f(1) => 1. +f(2) => 1. +f(3) => 2. +f(4) => 3. +f(5) => 5. +f(6) => 8. +f(7) => 13. +f(8) => 21. +f(9) => 34. diff --git a/examples/expected/geom.py.out b/examples/expected/geom.py.out index b15e120..d8c8ed2 100644 --- a/examples/expected/geom.py.out +++ b/examples/expected/geom.py.out @@ -1,5 +1,5 @@ Solution ======== -a := 2.0 +a => 2.0. diff --git a/examples/expected/lists.py.out b/examples/expected/lists.py.out index 65239f2..5c567af 100644 --- a/examples/expected/lists.py.out +++ b/examples/expected/lists.py.out @@ -1,9 +1,9 @@ Solution ======== -a := [1, 2] +a => [1, 2]. f/1 === -f([1, 2]) := true +f([1, 2]) => true. diff --git a/examples/expected/matrixops.py.out b/examples/expected/matrixops.py.out index cc48229..5060a88 100644 --- a/examples/expected/matrixops.py.out +++ b/examples/expected/matrixops.py.out @@ -4,51 +4,51 @@ Solution cols/1 ====== -cols(a) := 2 -cols(b) := 3 -cols(c) := 3 +cols(a) => 2. +cols(b) => 3. +cols(c) => 3. m/3 === -m(a,1,1) := 1 -m(a,1,2) := 0 -m(a,2,1) := 0 -m(a,2,2) := 1 -m(b,1,1) := 3 -m(b,1,2) := 0 -m(b,1,3) := 1 -m(b,2,1) := 0 -m(b,2,2) := 2 -m(b,2,3) := 0 -m(c,1,1) := 3 -m(c,1,2) := 0 -m(c,1,3) := 1 -m(c,2,1) := 0 -m(c,2,2) := 2 -m(c,2,3) := 0 +m(a,1,1) => 1. +m(a,1,2) => 0. +m(a,2,1) => 0. +m(a,2,2) => 1. +m(b,1,1) => 3. +m(b,1,2) => 0. +m(b,1,3) => 1. +m(b,2,1) => 0. +m(b,2,2) => 2. +m(b,2,3) => 0. +m(c,1,1) => 3. +m(c,1,2) => 0. +m(c,1,3) => 1. +m(c,2,1) => 0. +m(c,2,2) => 2. +m(c,2,3) => 0. product/2 ========= -product(a,b) := c +product(a,b) => c. rows/1 ====== -rows(a) := 2 -rows(b) := 2 -rows(c) := 2 +rows(a) => 2. +rows(b) => 2. +rows(c) => 2. shape/3 ======= -shape(a,2,2) := true -shape(b,2,3) := true -shape(c,2,3) := true +shape(a,2,2) => true. +shape(b,2,3) => true. +shape(c,2,3) => true. times/4 ======= -times(a,b,1,1) := 3 -times(a,b,1,2) := 0 -times(a,b,1,3) := 1 -times(a,b,2,1) := 0 -times(a,b,2,2) := 2 -times(a,b,2,3) := 0 +times(a,b,1,1) => 3. +times(a,b,1,2) => 0. +times(a,b,1,3) => 1. +times(a,b,2,1) => 0. +times(a,b,2,2) => 2. +times(a,b,2,3) => 0. diff --git a/examples/expected/papa2.py.out b/examples/expected/papa2.py.out index aac98f0..6a6f3ce 100644 --- a/examples/expected/papa2.py.out +++ b/examples/expected/papa2.py.out @@ -1,74 +1,74 @@ Solution ======== -best := pair(1,t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".")) -bestParse := t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".") -bestScore := 1 -length := 8 +best => pair(1,t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".")). +bestParse => t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),"."). +bestScore => 1. +length => 8. goal/1 ====== -goal(t("S",t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))),".")) := 1 -goal(t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".")) := 1 +goal(t("S",t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))),".")) => 1. +goal(t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".")) => 1. phrase/4 ======== -phrase(".",7,8,".") := 1 -phrase("Det",2,3,t("Det","the")) := 1 -phrase("Det",5,6,t("Det","a")) := 1 -phrase("N",3,4,t("N","caviar")) := 1 -phrase("N",6,7,t("N","spoon")) := 1 -phrase("NP",0,1,t("NP","Papa")) := 1 -phrase("NP",2,4,t("NP",t("Det","the"),t("N","caviar"))) := 1 -phrase("NP",2,7,t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))) := 1 -phrase("NP",5,7,t("NP",t("Det","a"),t("N","spoon"))) := 1 -phrase("P",4,5,t("P","with")) := 1 -phrase("PP",4,7,t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))) := 1 -phrase("Papa",0,1,"Papa") := 1 -phrase("S",0,4,t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))))) := 1 -phrase("S",0,7,t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))))) := 1 -phrase("S",0,7,t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))) := 1 -phrase("S",0,8,t("S",t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))),".")) := 1 -phrase("S",0,8,t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".")) := 1 -phrase("V",1,2,t("V","ate")) := 1 -phrase("VP",1,4,t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar")))) := 1 -phrase("VP",1,7,t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))) := 1 -phrase("VP",1,7,t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))) := 1 -phrase("a",5,6,"a") := 1 -phrase("ate",1,2,"ate") := 1 -phrase("caviar",3,4,"caviar") := 1 -phrase("spoon",6,7,"spoon") := 1 -phrase("the",2,3,"the") := 1 -phrase("with",4,5,"with") := 1 +phrase(".",7,8,".") => 1. +phrase("Det",2,3,t("Det","the")) => 1. +phrase("Det",5,6,t("Det","a")) => 1. +phrase("N",3,4,t("N","caviar")) => 1. +phrase("N",6,7,t("N","spoon")) => 1. +phrase("NP",0,1,t("NP","Papa")) => 1. +phrase("NP",2,4,t("NP",t("Det","the"),t("N","caviar"))) => 1. +phrase("NP",2,7,t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))) => 1. +phrase("NP",5,7,t("NP",t("Det","a"),t("N","spoon"))) => 1. +phrase("P",4,5,t("P","with")) => 1. +phrase("PP",4,7,t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))) => 1. +phrase("Papa",0,1,"Papa") => 1. +phrase("S",0,4,t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))))) => 1. +phrase("S",0,7,t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))))) => 1. +phrase("S",0,7,t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))) => 1. +phrase("S",0,8,t("S",t("S",t("NP","Papa"),t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))),".")) => 1. +phrase("S",0,8,t("S",t("S",t("NP","Papa"),t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))),".")) => 1. +phrase("V",1,2,t("V","ate")) => 1. +phrase("VP",1,4,t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar")))) => 1. +phrase("VP",1,7,t("VP",t("V","ate"),t("NP",t("NP",t("Det","the"),t("N","caviar")),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon")))))) => 1. +phrase("VP",1,7,t("VP",t("VP",t("V","ate"),t("NP",t("Det","the"),t("N","caviar"))),t("PP",t("P","with"),t("NP",t("Det","a"),t("N","spoon"))))) => 1. +phrase("a",5,6,"a") => 1. +phrase("ate",1,2,"ate") => 1. +phrase("caviar",3,4,"caviar") => 1. +phrase("spoon",6,7,"spoon") => 1. +phrase("the",2,3,"the") => 1. +phrase("with",4,5,"with") => 1. rewrite/2 ========= -rewrite("Det","a") := 1 -rewrite("Det","the") := 1 -rewrite("N","caviar") := 1 -rewrite("N","spoon") := 1 -rewrite("NP","Papa") := 1 -rewrite("P","with") := 1 -rewrite("V","ate") := 1 +rewrite("Det","a") => 1. +rewrite("Det","the") => 1. +rewrite("N","caviar") => 1. +rewrite("N","spoon") => 1. +rewrite("NP","Papa") => 1. +rewrite("P","with") => 1. +rewrite("V","ate") => 1. rewrite/3 ========= -rewrite("NP","Det","N") := 1 -rewrite("NP","NP","PP") := 1 -rewrite("PP","P","NP") := 1 -rewrite("S","NP","VP") := 1 -rewrite("S","S",".") := 1 -rewrite("VP","V","NP") := 1 -rewrite("VP","VP","PP") := 1 +rewrite("NP","Det","N") => 1. +rewrite("NP","NP","PP") => 1. +rewrite("PP","P","NP") => 1. +rewrite("S","NP","VP") => 1. +rewrite("S","S",".") => 1. +rewrite("VP","V","NP") => 1. +rewrite("VP","VP","PP") => 1. word/2 ====== -word(".",7) := true -word("Papa",0) := true -word("a",5) := true -word("ate",1) := true -word("caviar",3) := true -word("spoon",6) := true -word("the",2) := true -word("with",4) := true +word(".",7) => true. +word("Papa",0) => true. +word("a",5) => true. +word("ate",1) => true. +word("caviar",3) => true. +word("spoon",6) => true. +word("the",2) => true. +word("with",4) => true. diff --git a/examples/expected/simple.py.out b/examples/expected/simple.py.out index e43e651..f1139b5 100644 --- a/examples/expected/simple.py.out +++ b/examples/expected/simple.py.out @@ -1,7 +1,7 @@ Solution ======== -a := true -b := true -c := true +a => true. +b => true. +c => true. diff --git a/src/Dyna/Backend/Python/chart.py b/src/Dyna/Backend/Python/chart.py index 7d3a9a8..5d09deb 100644 --- a/src/Dyna/Backend/Python/chart.py +++ b/src/Dyna/Backend/Python/chart.py @@ -22,25 +22,14 @@ class Chart(object): return '' if self.arity == 0: [term] = rows - return '%s := %s' % (term, _repr(term.value)) + return '%s => %s.' % (term, _repr(term.value)) p = [(_repr(term), _repr(term.value)) for term in sorted(rows)] - lines = [self.name, '='*len(self.name)] # heading - - for term, value in p: - lines.append('%-30s := %s' % (term, value)) - -# terms, values = zip(*p) -# widths = map(len, terms) -# fmt = '%%-%ds => %%s.' % max(widths) -# if max(widths) > 50: -# for term, value in zip(terms, values): -# lines.append(term) -# lines.append(' => %s.' % value) -# else: -# for term, value in zip(terms, values): -# lines.append(fmt % (term, value)) - + terms, values = zip(*p) + widths = map(len, terms) + fmt = '%%-%ds => %%s.' % min(max(widths), 40) + for term, value in zip(terms, values): + lines.append(fmt % (term, value)) lines.append('') return '\n'.join(lines) diff --git a/src/Dyna/Backend/Python/load/matrix.py b/src/Dyna/Backend/Python/load/matrix.py index a3e3171..cdc20d5 100644 --- a/src/Dyna/Backend/Python/load/matrix.py +++ b/src/Dyna/Backend/Python/load/matrix.py @@ -18,13 +18,13 @@ class matrix(object): ======== m/2 === - m(0,0) := 1.0 - m(0,1) := 2.0 - m(0,2) := 3.0 - m(1,0) := 4.0 - m(1,1) := 5.0 - m(3,0) := 6.0 - m(3,1) := 7.0 + m(0,0) => 1.0. + m(0,1) => 2.0. + m(0,2) => 3.0. + m(1,0) => 4.0. + m(1,1) => 5.0. + m(3,0) => 6.0. + m(3,1) => 7.0. As you can see, by default values are interpreted as floats, to specify a @@ -38,13 +38,13 @@ class matrix(object): ======== m/2 === - m(0,0) := "1" - m(0,1) := "2" - m(0,2) := "3" - m(1,0) := "4" - m(1,1) := "5" - m(3,0) := "6" - m(3,1) := "7" + m(0,0) => "1". + m(0,1) => "2". + m(0,2) => "3". + m(1,0) => "4". + m(1,1) => "5". + m(3,0) => "6". + m(3,1) => "7". """ diff --git a/src/Dyna/Backend/Python/load/sexpr.py b/src/Dyna/Backend/Python/load/sexpr.py index 7983791..3b7b437 100644 --- a/src/Dyna/Backend/Python/load/sexpr.py +++ b/src/Dyna/Backend/Python/load/sexpr.py @@ -15,8 +15,8 @@ class sexpr(object): ======== trees/1 ======= - trees(0) := node("a", node("b", "c"), node("d", "e")) - trees(1) := node("a", "b", "c") + trees(0) => node("a", node("b", "c"), node("d", "e")) + trees(1) => node("a", "b", "c") """ diff --git a/src/Dyna/Backend/Python/load/tsv.py b/src/Dyna/Backend/Python/load/tsv.py index 7d0a51e..d5886a4 100644 --- a/src/Dyna/Backend/Python/load/tsv.py +++ b/src/Dyna/Backend/Python/load/tsv.py @@ -13,13 +13,13 @@ class tsv(object): :- sol row/4 ===== - row(0,"0","S","NP VP") := true - row(1,"1.58","ROOT","S .") := true - row(2,"1.58","ROOT","S !") := true - row(3,"1.58","ROOT","VP !") := true - row(4,"3.81","VP","V") := true - row(5,"3.81","VP","V NP") := true - row(6,"1.49","VP","V VP") := true + row(0,"0","S","NP VP") => true. + row(1,"1.58","ROOT","S .") => true. + row(2,"1.58","ROOT","S !") => true. + row(3,"1.58","ROOT","VP !") => true. + row(4,"3.81","VP","V") => true. + row(5,"3.81","VP","V NP") => true. + row(6,"1.49","VP","V VP") => true. ... """ diff --git a/src/Dyna/Backend/Python/repl.py b/src/Dyna/Backend/Python/repl.py index 0083b62..0d1debb 100644 --- a/src/Dyna/Backend/Python/repl.py +++ b/src/Dyna/Backend/Python/repl.py @@ -10,7 +10,7 @@ to help. """ import os, cmd, readline -from utils import dynac, ip, lexer, subst, drepr, _repr +from utils import dynac, ip, lexer, subst, drepr, _repr, get_module from errors import DynaCompilerError, DynaInitializerException from config import dotdynadir from errors import show_traceback @@ -73,7 +73,7 @@ class REPL(cmd.Cmd, object): Solution ======== - b := 1. + b => 1. """ self.interp.retract_rule(int(idx)) @@ -241,7 +241,7 @@ class REPL(cmd.Cmd, object): return print '=============' for x, v in sorted(changed.items()): - print '%s := %s' % (x, _repr(v)) + print '%s => %s.' % (x, _repr(v)) def _changed_subscriptions(self, changed): @@ -316,7 +316,7 @@ class REPL(cmd.Cmd, object): [cmd, sub] = mod if cmd in ('load', 'post'): try: - exec 'from %s.%s import %s as m' % (cmd, sub, sub) + m = get_module(cmd, sub) print m.__doc__ except (ImportError, KeyError, AttributeError): print 'No help available for "%s %s"' % (cmd, sub) @@ -346,12 +346,12 @@ class REPL(cmd.Cmd, object): ======== data/3 ====== - data(2,"cow","boy") := true + data(2,"cow","boy") => true. data/4 ====== - data(0,"a","b","3.0") := true - data(1,"c","d","4.0") := true + data(0,"a","b","3.0") => true. + data(1,"c","d","4.0") => true. """ try: diff --git a/test/repl/aggregator-conflict.expect b/test/repl/aggregator-conflict.expect index a571301..f1a7b33 100644 --- a/test/repl/aggregator-conflict.expect +++ b/test/repl/aggregator-conflict.expect @@ -1,8 +1,8 @@ :- :- ============= -a := 1 +a => 1. :- DynaCompilerError: FATAL: Encountered error in input program: - Conflicting aggregators; rule /home/timv/.dyna/tmp/966093dc38b755a6f17b02774b5c656931163a3a.dyna:5:1-/home/timv/.dyna/tmp/966093dc38b755a6f17b02774b5c656931163a3a.dyna:5:3 + Conflicting aggregators; rule /home/timv/.dyna/tmp/6676/966093dc38b755a6f17b02774b5c656931163a3a.dyna:5:1-/home/timv/.dyna/tmp/6676/966093dc38b755a6f17b02774b5c656931163a3a.dyna:5:3 uses '|=' for a/0 but I had been lead to expect '+='. > new rule(s) were not added to program. diff --git a/test/repl/late-aggregator-assignment.expect b/test/repl/late-aggregator-assignment.expect index a5e4486..8d2c40e 100644 --- a/test/repl/late-aggregator-assignment.expect +++ b/test/repl/late-aggregator-assignment.expect @@ -4,7 +4,7 @@ Rules 0: a += b * c. :- ============= -b := 2 +b => 2. :- Rules ===== @@ -12,8 +12,8 @@ Rules 1: b := 2. :- ============= -a := 6 -c := 3 +a => 6. +c => 3. :- Rules ===== diff --git a/test/repl/retract-rule.expect b/test/repl/retract-rule.expect index 001c5f4..6bda047 100644 --- a/test/repl/retract-rule.expect +++ b/test/repl/retract-rule.expect @@ -1,9 +1,9 @@ :- :- ============= -a := 1 +a => 1. :- ============= -b := 1 +b => 1. :- ============= -a := 2 +a => 2. :- Rules ===== @@ -14,12 +14,12 @@ Rules :- Solution ======== -a := 2 -b := 1 +a => 2. +b => 1. :- :- :- Solution ======== -a := 1 +a => 1. :- exit -- 2.50.1