aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-01-13 02:03:31 +0000
committerdos-reis <gdr@axiomatics.org>2012-01-13 02:03:31 +0000
commit7d98b7fa7d816f132fb09bf439333f4145c603f8 (patch)
tree8575dd6cb449b3ed52b68d7aa763216bfdce0c79 /src
parent4ebf86fc014d407548be8af728191fe02401bf1a (diff)
downloadopen-axiom-7d98b7fa7d816f132fb09bf439333f4145c603f8.tar.gz
* interp/category.boot: Rename AncestorP to ancestor?.
Rename DescendantP to descendant?. * interp/define.boot: Likewise. * interp/functor.boot: Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/interp/category.boot28
-rw-r--r--src/interp/define.boot2
-rw-r--r--src/interp/functor.boot6
4 files changed, 25 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 01e6ee3f..a9fc5f80 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2012-01-12 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/category.boot: Rename AncestorP to ancestor?.
+ Rename DescendantP to descendant?.
+ * interp/define.boot: Likewise.
+ * interp/functor.boot: Likewise.
+
+2012-01-12 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* boot/parser.boot (bpFunction): New.
(bpConstTok): Include it.
* boot/ast.boot (bfFunction): New.
diff --git a/src/interp/category.boot b/src/interp/category.boot
index b00e5bea..16b7720d 100644
--- a/src/interp/category.boot
+++ b/src/interp/category.boot
@@ -199,8 +199,8 @@ mkOr(a,b,e) ==
(b is ["OR",:b'] => union(a',b'); mkOr2(b,a',e) )
b is ["OR",:b'] => mkOr2(a,b',e)
(a is ["has",avar,acat]) and (b is ["has",=avar,bcat]) =>
- DescendantP(acat,bcat,e) => [b]
- DescendantP(bcat,acat,e) => [a]
+ descendant?(acat,bcat,e) => [b]
+ descendant?(bcat,acat,e) => [a]
[a,b]
a is ['AND,:a'] and listMember?(b,a') => [b]
b is ['AND,:b'] and listMember?(a,b') => [a]
@@ -217,9 +217,9 @@ mkOr2(a,b,e) ==
a is ["has",avar,acat] =>
aRedundant:=false
for c in b | c is ["has",=avar,ccat] repeat
- DescendantP(acat,ccat,e) =>
+ descendant?(acat,ccat,e) =>
return (aRedundant:=true)
- if DescendantP(ccat,acat,e) then b := remove(b,c)
+ if descendant?(ccat,acat,e) then b := remove(b,c)
aRedundant => b
[a,:b]
[a,:b]
@@ -234,8 +234,8 @@ mkAnd(a,b,e) ==
(b is ["AND",:b'] => union(a',b'); mkAnd2(b,a',e) )
b is ["AND",:b'] => mkAnd2(a,b',e)
(a is ["has",avar,acat]) and (b is ["has",=avar,bcat]) =>
- DescendantP(acat,bcat,e) => [a]
- DescendantP(bcat,acat,e) => [b]
+ descendant?(acat,bcat,e) => [a]
+ descendant?(bcat,acat,e) => [b]
[a,b]
[a,b]
#l = 1 => first l
@@ -248,9 +248,9 @@ mkAnd2(a,b,e) ==
a is ["has",avar,acat] =>
aRedundant:=false
for c in b | c is ["has",=avar,ccat] repeat
- DescendantP(ccat,acat,e) =>
+ descendant?(ccat,acat,e) =>
return (aRedundant:=true)
- if DescendantP(acat,ccat,e) then b := remove(b,c)
+ if descendant?(acat,ccat,e) then b := remove(b,c)
aRedundant => b
[a,:b]
[a,:b]
@@ -325,8 +325,8 @@ CatEval(x,e) ==
e := $CategoryFrame
compMakeCategoryObject(x,e).expr
-AncestorP: (%Form,%List %Instantiation,%Env) -> %Form
-AncestorP(xname,leaves,env) ==
+ancestor?: (%Form,%List %Instantiation,%Env) -> %Form
+ancestor?(xname,leaves,env) ==
-- checks for being a principal ancestor of one of the leaves
listMember?(xname,leaves) => xname
for y in leaves repeat
@@ -345,8 +345,8 @@ CondAncestorP(xname,leaves,condition,env) ==
++ Returns true if the form `a' designates a category that is any
++ kind of descendant of the category designated by the form `b'.
-DescendantP: (%Form,%Form,%Env) -> %Boolean
-DescendantP(a,b,e) ==
+descendant?: (%Form,%Form,%Env) -> %Boolean
+descendant?(a,b,e) ==
a=b => true
a is ["ATTRIBUTE",:.] => false
a is ["SIGNATURE",:.] => false
@@ -354,7 +354,7 @@ DescendantP(a,b,e) ==
b is ["ATTRIBUTE",b'] =>
(l := assoc(b',categoryAttributes a)) => TruthP second l
listMember?(b,categoryPrincipals a) => true
- AncestorP(b,[first u for u in categoryAncestors a],e) => true
+ ancestor?(b,[first u for u in categoryAncestors a],e) => true
false
--% The implementation of Join
@@ -406,7 +406,7 @@ JoinInner(l,$e) ==
-- this skips buggy code which discards needed categories
for [b,condition] in FindFundAncs(l',$e) | bname := b.0 repeat
CondAncestorP(bname,FundamentalAncestors,condition,$e) => nil
- f := AncestorP(bname,[first u for u in FundamentalAncestors],$e) =>
+ f := ancestor?(bname,[first u for u in FundamentalAncestors],$e) =>
[.,.,index] := assoc(f,FundamentalAncestors)
FundamentalAncestors := [[bname,condition,index],:FundamentalAncestors]
PrinAncb := categoryPrincipals CatEval(bname,$e)
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 5ef8e842..66d8c458 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -210,7 +210,7 @@ knownInfo(pred,env) ==
-- previous line checks fundamental anscestors, we should check their
-- principal anscestors but this requires instantiating categories
- or/[AncestorP(cat,[first u],env)
+ or/[ancestor?(cat,[first u],env)
for u in categoryAncestors vv | knownInfo(second u,env)] => true
false
pred is ["SIGNATURE",name,op,sig,:.] =>
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index 91564e08..ae7073a2 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -631,7 +631,7 @@ InvestigateConditions(catvecListMaker,env) ==
old=true => old
for [newS2,:morecond] in newS repeat
old:=
- not AncestorP(sec,[newS2],env) => old
+ not ancestor?(sec,[newS2],env) => old
cond2 := mkAnd(cond,morecond,env)
null old => cond2
mkOr(cond2,old,env)
@@ -678,7 +678,7 @@ ICformat(u,env) ==
--check that v causes descendants to go
for v in l | not (v=u) and v is ['HasCategory, =name,['QUOTE,
cond2]] repeat
- if DescendantP(cond,cond2,env) then l:= remove(l,u)
+ if descendant?(cond,cond2,env) then l:= remove(l,u)
--v subsumes u
for u in l | u is ['AND,:l'] or u is ['and,:l'] repeat
for u' in l' | u' is ['HasCategory,name,cond] and cond is ['QUOTE,
@@ -686,7 +686,7 @@ ICformat(u,env) ==
--check that v causes descendants to go
for v in l | v is ['HasCategory, =name,['QUOTE,
cond2]] repeat
- if DescendantP(cond,cond2,env) then l:= remove(l,u)
+ if descendant?(cond,cond2,env) then l:= remove(l,u)
--v subsumes u
l
# l=1 => first l