diff options
author | dos-reis <gdr@axiomatics.org> | 2011-07-10 12:23:59 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-07-10 12:23:59 +0000 |
commit | e69eb5b6621cadee088a0d621cb61b16676acd91 (patch) | |
tree | 991ffd675e1ba7c9d3565a2d332314eeaf1f590d | |
parent | ceb8df6c892807d0b03b868bbf0e5b78b802ee48 (diff) | |
download | open-axiom-e69eb5b6621cadee088a0d621cb61b16676acd91.tar.gz |
* interp/c-util.boot (categoryExports): New.
* interp/category.boot (mkCategory): Use it.
(DropImplementations): Tidy.
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/interp/c-util.boot | 4 | ||||
-rw-r--r-- | src/interp/category.boot | 37 |
3 files changed, 25 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2311918b..8246499b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-07-10 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/c-util.boot (categoryExports): New. + * interp/category.boot (mkCategory): Use it. + (DropImplementations): Tidy. + 2011-07-07 Gabriel Dos Reis <gdr@cs.tamu.edu> * gui/debate.cc (start_interpreter): Do not forget core command diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index b1ac64ed..dd597a88 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -77,6 +77,10 @@ macro instantiationArgs d == macro categoryExports d == categoryRef(d,1) +++ Return the attribute alist of a category object. +macro categoryAttributes d == + categoryRef(d,2) + ++ Return the predicate values associated with the domain object. ++ This is an integer interpreted as bit vector macro domainPredicates d == diff --git a/src/interp/category.boot b/src/interp/category.boot index 53079f37..11abb5c3 100644 --- a/src/interp/category.boot +++ b/src/interp/category.boot @@ -137,25 +137,27 @@ mkCategory(domainOrPackage,sigList,attList,domList,PrincipalAncestor) == v := newShell count canonicalForm(v) := nil categoryExports(v) := sigList - v.2 := attList - v.3 := $Category + categoryAttributes(v) := attList + categoryRef(v,3) := $Category if PrincipalAncestor ~= nil then for x in 6..#PrincipalAncestor-1 repeat - v.x := PrincipalAncestor.x - v.4 := [first PrincipalAncestor.4,second PrincipalAncestor.4,OldLocals] - else v.4 := [nil,nil,OldLocals] --associated categories and domains - v.5 := domList - for [nsig,:sequence] in NSigList repeat - v.sequence := nsig + categoryRef(v,x) := PrincipalAncestor.x + categoryRef(v,4) := + [first PrincipalAncestor.4,second PrincipalAncestor.4,OldLocals] + else + categoryRef(v,4) := [nil,nil,OldLocals] --associated categories and domains + categoryRef(v,5) := domList + for [nsig,:n] in NSigList repeat + categoryRef(v,n) := nsig v --% Subsumption code (for operators) -DropImplementations (a is [sig,pred,:implem]) == - if implem is [[q,:.]] and (q="ELT" or q="CONST") - then if (q="ELT") then [sig,pred] - else [[:sig,:'(constant)],pred] - else a +DropImplementations a == + a is [sig,pred,[q,:.]] and q in '(ELT CONST) => + q = "ELT" => [sig,pred] + [[:sig,'constant],pred] + a SigListUnion(extra,original) == --augments original %with everything in extra that is not in original @@ -567,12 +569,3 @@ Join(:l) == null $e or $InteractiveMode => $CategoryFrame $e JoinInner(l, e) - ---ProduceDomainAlist(u,e) == --- -- Gives a complete Alist for all the functions in the Domain --- not (sig:= get(u,"modemap",e)) => nil --- sig:= CADAAR sig --- --an incantation --- [c,.,.]:= compMakeCategoryObject(sig,e) --- -- We assume that the environment need not be kept --- c.1 |