aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/g-opt.boot7
2 files changed, 8 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0178b6d9..18878936 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2011-02-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot (optNot): Push %not inside conditionals.
+ (optCond): Remove ineffectual transformation.
+
+2011-02-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/parse.boot (parseLessEqual): Remove.
2011-02-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index c12e6689..b119ce5f 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -308,14 +308,11 @@ optCond (x is ['%when,:l]) ==
l is [[p1,['%when,[p2,c2]]]] => optCond ['%when,[['%and,p1,p2],c2]]
l is [[p1,:c1],[p2,:c2],[p3,:c3]] and p3 = '%otherwise =>
EqualBarGensym(c1,c3) =>
- optCond ['%when,[['%or,p1,['%not,p2]],:c1],['%otherwise,:c2]]
+ optCond ['%when,[['%or,p1,optNot ['%not,p2]],:c1],['%otherwise,:c2]]
EqualBarGensym(c1,c2) =>
optCond ['%when,[['%or,p1,p2],:c1],['%otherwise,:c3]]
x
for y in tails l repeat
- c := first y
- if c is [['%not,['%not,p]],:.] then
- c.first := p
while y is [[a1,c1],[a2,c2],:y'] and EqualBarGensym(c1,c2) repeat
a := ['%or,a1,a2]
first(y).first := a
@@ -692,6 +689,8 @@ optNot(x is ['%not,a]) ==
a = '%true => '%false
a = '%false => '%true
a is ['%not,b] => b
+ a is ['%when,:.] =>
+ optCond [a.op, :[[p,optNot ['%not,c]] for [p,c] in a.args]]
x
optAnd(x is ['%and,a,b]) ==