diff options
author | dos-reis <gdr@axiomatics.org> | 2009-05-29 04:10:14 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-05-29 04:10:14 +0000 |
commit | bcf4deb1f4de85c07a6c91d2fb59a77545e317b0 (patch) | |
tree | cd63415212f1f6ae8722f1f3a09845db408961d8 /src/interp | |
parent | 9a866efde4ed887d024c01a49b3cdde777d8deb3 (diff) | |
download | open-axiom-bcf4deb1f4de85c07a6c91d2fb59a77545e317b0.tar.gz |
* interp/compiler.boot (getSuccessEnvironment): Tidy.
(getInverseEnvironment): Likewise.
(compLogicalNot): Don't normalize to if-statement.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/compiler.boot | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index cf86b490..1aa087cb 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1249,21 +1249,28 @@ getSuccessEnvironment(a,e) == e a is ["case",x,m] and IDENTP x => put(x,"condition",[a,:get(x,"condition",e)],e) + a is ["and",:args] => + for form in args repeat + e := getSuccessEnvironment(form,e) + e + a is ["not",a'] => getInverseEnvironment(a',e) e -getInverseEnvironment(a,E) == +getInverseEnvironment(a,e) == a is ["case",x,m] and IDENTP x => --the next two lines are necessary to get 3-branched Unions to work -- old-style unions, that is - (get(x,"condition",E) is [["OR",:oldpred]]) and member(a,oldpred) => - put(x,"condition",LIST MKPF(delete(a,oldpred),"OR"),E) - getUnionMode(x,E) is ["Union",:l] - l':= delete(m,l) - for u in l' repeat - if u is ['_:,=m,:.] then l':= delete(u,l') - newpred:= MKPF([["case",x,m'] for m' in l'],"OR") - put(x,"condition",[newpred,:get(x,"condition",E)],E) - E + (get(x,"condition",e) is [["OR",:oldpred]]) and member(a,oldpred) => + put(x,"condition",LIST MKPF(delete(a,oldpred),"OR"),e) + getUnionMode(x,e) is ["Union",:l] => + l':= delete(m,l) + for u in l' repeat + if u is ['_:,=m,:.] then l':= delete(u,l') + newpred:= MKPF([["case",x,m'] for m' in l'],"OR") + put(x,"condition",[newpred,:get(x,"condition",e)],e) + e + a is ["not",a'] => getSuccessEnvironment(a',e) + e getUnionMode(x,e) == m:= @@ -1428,11 +1435,11 @@ compLogicalNot(x,m,e) == -- ??? selected through general modemaps, and their semantics -- ??? are quite hardwired with their syntax. -- ??? Eventually, we should not need to do this. - $normalizeTree => compIf(["IF",y,"false","true"],m,e) - yT := comp(y,$EmptyMode,e) or return nil - yT.mode = $Boolean => - e := getInverseEnvironment(y,yT.env) - convert([["NOT",yT.expr],$Boolean,e],m) + yTarget := + $normalizeTree and resolve(m,$Boolean) = $Boolean => $Boolean + $EmptyMode + yT := comp(y,yTarget,e) or return nil + yTarget = $Boolean => (rplac(first yT, ["NOT",yT.expr]); yT) compResolveCall("not",[yT],m,yT.env) |