diff options
author | dos-reis <gdr@axiomatics.org> | 2008-10-16 08:57:52 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-10-16 08:57:52 +0000 |
commit | 9636715a5e06c8c174fd44cbf2847c4a8d2a87c7 (patch) | |
tree | bcee41d002aa0f681aa8e1ff612bc368eefd83c0 /src/interp | |
parent | e193c16d6eec5d174a24987a8590247c4c4227d1 (diff) | |
download | open-axiom-9636715a5e06c8c174fd44cbf2847c4a8d2a87c7.tar.gz |
* interp/i-spec1.boot (categoryImplies): New.
(evalCategory): Use it.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/i-spec1.boot | 19 |
1 files changed, 18 insertions, 1 deletions
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) |