aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-14 00:29:19 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-14 00:29:19 +0000
commit486ade17c9938d888d341045260af26148e233fc (patch)
treed2404dcd76471df8ec52ec577c1e5dddf712e816 /src
parentc89e28b04cf567a2c0e20d186c9cd89b138957d5 (diff)
downloadopen-axiom-486ade17c9938d888d341045260af26148e233fc.tar.gz
* interp/c-util.boot (getSuccessEnvironment): Follow through
temporaries designating result of assignment. (getInverseEnvironment): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/interp/c-util.boot4
-rw-r--r--src/interp/compiler.boot6
3 files changed, 13 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2cfe0d36..daa58a45 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
2011-02-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/c-util.boot (getSuccessEnvironment): Follow through
+ temporaries designating result of assignment.
+ (getInverseEnvironment): Likewise.
+
+2011-02-13 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/buildom.boot (mkNewUnionFunList): Align arity of
'case' implementation to declared signature.
(mkUnionFunList): Likewise.
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 6d770390..05915075 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -437,6 +437,8 @@ getSuccessEnvironment(a,e) ==
e := getSuccessEnvironment(form,e)
e
a is ["not",a'] => getInverseEnvironment(a',e)
+ -- Follow temporaries in complex conditionals
+ symbol? a and (T := get(a,"value",e)) => getSuccessEnvironment(T.expr,e)
e
getInverseEnvironment(a,e) ==
@@ -453,6 +455,8 @@ getInverseEnvironment(a,e) ==
put(x,"condition",[newpred,:get(x,"condition",e)],e)
e
a is ["not",a'] => getSuccessEnvironment(a',e)
+ -- Follow temporaries in complex conditionals
+ symbol? a and (T := get(a,"value",e)) => getInverseEnvironment(T.expr,e)
e
++ Give some abstract value to the variable `v' of mode `m' in `e'.
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 9f7976cb..940c296d 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -460,7 +460,7 @@ mkUnion(a,b) ==
hasType(x,e) ==
fn get(x,"condition",e) where
fn x ==
- null x => nil
+ x = nil => nil
x is [["case",.,y],:.] => y
fn rest x
@@ -1711,12 +1711,12 @@ coerceHard(T,m) ==
coerceExtraHard: (%Triple,%Mode) -> %Maybe %Triple
coerceExtraHard(T is [x,m',e],m) ==
T':= autoCoerceByModemap(T,m) => T'
- isUnionMode(m',e) is ["Union",:l] and (t:= hasType(x,e)) and
+ (t:= hasType(x,e)) and isUnionMode(m',e) is ["Union",:l] and
member(t,l) and (T':= autoCoerceByModemap(T,t)) and
(T'':= coerce(T',m)) => T''
m' is ['Record,:.] and m = $Expression =>
[['coerceRe2E,x,['ELT,COPY m',0]],m,e]
- belongsTo?(m',["UnionType"],e) and hasUniqueCaseView(x,m,e) =>
+ hasUniqueCaseView(x,m,e) and belongsTo?(m',["UnionType"],e) =>
autoCoerceByModemap(T,m)
-- Domain instantiations are first class objects
m = $Domain =>