aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/i-spec1.boot19
2 files changed, 23 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ea652e11..ad42b989 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-16 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/i-spec1.boot (categoryImplies): New.
+ (evalCategory): Use it.
+
2008-10-15 Waldek Hebisch <hebisch@math.uni.wroc.pl>
Fix AW/101
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index cec4db2b..ee6d9787 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -1201,9 +1201,26 @@ isDomainValuedVariable form ==
objValUnwrap(val)
nil
+
+++ returns true if category form `c1' implies category form `c2'.
+++ Both are assumed to be definite categories, i.e. they contain
+++ no variables.
+categoryImplies(c1,c2) ==
+ c2 = $Type => true
+ c1 is ["Join",:cats] =>
+ or/[categoryImplies(c,c2) for c in cats] => true
+ c1 = c2
+ -- ??? Should also check conditional definition and
+ -- ??? possibly attributes
+
+++ returns true if domain `d' satisfies category `c'.
evalCategory(d,c) ==
-- tests whether domain d has category c
- isPartialMode d or ofCategory(d,c)
+ isPartialMode d => true -- maybe too generous
+ -- If this is a local variable then, its declared type
+ -- must imply category `c' satisfaction.
+ IDENTP d and (m := getmode(d,$env)) => categoryImplies(m,c)
+ ofCategory(d,c)
isOkInterpMode m ==
isPartialMode(m) => isLegitimateMode(m,nil,nil)