aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-01-06 06:53:21 +0000
committerdos-reis <gdr@axiomatics.org>2009-01-06 06:53:21 +0000
commit258d6427280f1ee0cce0dcdf12c38ad65b5e36cc (patch)
tree7c37449e24bbcfba741729b6d16a71b9c5007ea4 /src/interp/g-util.boot
parentbd3fb898659b91542e7a3109f36b2f8b17e05a5d (diff)
downloadopen-axiom-258d6427280f1ee0cce0dcdf12c38ad65b5e36cc.tar.gz
* interp/sys-utility.boot (getVMType): IndexList are lists.
* interp/g-util.boot (isSubDomain): Tidy. * interp/g-opt.boot (isVMConstantForm): New. (findVMFreeVars): Likewise. * interp/define.boot (insertViewMorphisms): Remove. (emitSubdomainInfo): New. (checkVariableName): Likewise. (checkParameterNames): Likewise. (checkRepresentation): Set $subdomain where appropriate. (compDefines): Check parameter names. (compDefineFunctor1): Propagate subdomain info. (doIt): Don't call insertViewMorphisms. * interp/compiler.boot (setqSingle): Check variable name. (compIterator): Likewise. (commonSuperType): New. (satisfies): Likewise. (coerceSubset): Use them to implemen cross-subdomain coercion. (coerceSuperset): New. (comCoerce1): Use it. (compPer): New. (compRep): Likewise. * interp/c-util.boot (getRepresentation): New. (proclaimCapsuleFunction): Improve for specialized subdomains. * algebra/stream.spad.pamphlet: Don't use `per' as variable name. * algebra/si.spad.pamphlet (size$SingleInteger): Tidy. (coerce$SingleInteger): Likewise. * algebra/reclos.spad.pamphlet (nonNull$RealClosure): Don't use `rep' as parameter name. * algebra/data.spad.pamphlet (Byte): Now a subdomain of NonNegativeInteger. Tidy.
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r--src/interp/g-util.boot23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 7889e49f..8826bd95 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -74,6 +74,14 @@ superType dom ==
[super,.] := getSuperDomainFromDB ctor or return nil
sublisFormal(args,super,$AtVariables)
+++ If the domain designated by the domain form `dom' is a subdomain,
+++ then return its defining predicate. Otherwise, return nil.
+domainVMPredicate dom ==
+ dom = "$" => domainVMPredicate $functorForm
+ dom isnt [ctor,:args] => false
+ [.,pred] := getSuperDomainFromDB ctor or return nil
+ sublisFormal(args,pred,$AtVariables)
+
++ Return the root of the reflexive transitive closure of
++ the super-domain chain for the domain designated by the domain
++ form `d'.
@@ -104,15 +112,16 @@ isSubDomain(d1,d2) ==
[sup,pred] := getSuperDomainFromDB first d1 or return false
-- 3. We may be onto something.
- -- `sup' and `pred' are in most general form. Instantiate.
- first sup = first d2 =>
- -- sanity check. `d2' should be an instance of `sup'.
- sublisFormal(rest d1,sup,$AtVariables) ^= d2 =>
- stackAndThrow('"unexpected instantiation mismatch",nil)
- sublisFormal(rest d1,pred,$AtVariables)
+ -- `sup' and `pred' are in most general form. We cannot just
+ -- test for the functors, as different arguments may instantiate
+ -- to super-domains.
+ args := rest d1
+ sublisFormal(args,sup,$AtVariables) = d2 =>
+ sublisFormal(args,pred,$AtVariables)
-- 4. Otherwise, lookup in the super-domain chain.
- pred' := isSubDomain(sup,d2) => MKPF([pred',pred],"AND")
+ pred' := isSubDomain(sup,d2) =>
+ MKPF([pred',sublisFormal(args,pred,$AtVariables)],"AND")
-- 5. Lot of smoke, no fire.
false