diff options
Diffstat (limited to 'src/interp/nruncomp.boot')
-rw-r--r-- | src/interp/nruncomp.boot | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index 0271c9a4..728f3e99 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -58,7 +58,7 @@ $NRTaddForm := nil ++ $NRTderivedTargetIfTrue := false -NRTaddDeltaCode db == +addDeltaCode db == --NOTES: This function is called from buildFunctor to initially -- fill slots in dbTemplate. The dbTemplate so created is stored in the -- NRLIB. On load, makeDomainTemplate is called on this dbTemplate to @@ -215,7 +215,7 @@ genDeltaEntry(op,mm,e) == ident? dc and symbolMember?(dc,$functorLocalParameters)) then -- This modemap's domain of computation did not contributte an -- an operation before; give it a slot before the modemap itself. - entry := [["%domain",NRTaddInner(db,dc)]] + entry := [["%domain",addInner(db,dc)]] dbUsedEntities(db) := [entry,:dbUsedEntities db] dbEntityCount(db) := dbEntityCount db + 1 entry.rest := compOrCroak(odc,$EmptyMode,e).expr @@ -246,12 +246,12 @@ getLocalIndex(db,item) == item is "$$" => 2 k := assocIndex(db,item) => k item isnt [.,:.] and not symbolMember?(item,$formalArgList) => --give slots to atoms - entry := [["%domain",NRTaddInner(db,item)],:item] + entry := [["%domain",addInner(db,item)],:item] dbUsedEntities(db) := [entry,:dbUsedEntities db] index := $NRTbase + dbEntityCount db -- slot number to return dbEntityCount(db) := dbEntityCount db + 1 index - entry := [["%domain",NRTaddInner(db,item)]] + entry := [["%domain",addInner(db,item)]] dbUsedEntities(db) := [entry,:dbUsedEntities db] saveIndex := $NRTbase + dbEntityCount db dbEntityCount(db) := dbEntityCount db + 1 @@ -265,30 +265,30 @@ getLocalIndex(db,item) == compOrCroak(item,$EmptyMode,$e).expr saveIndex -++ NRTaddInner should call following function instead of getLocalIndex +++ addInner should call following function instead of getLocalIndex ++ This would prevent putting spurious items in dbUsedEntities -NRTinnerGetLocalIndex(db,x) == +innerGetLocalIndex(db,x) == x isnt [.,:.] => x op := x.op ident? op and (constructor? op or builtinConstructor? op) => getLocalIndex(db,x) op is "[||]" => getLocalIndex(db,x) - NRTaddInner(db,x) + addInner(db,x) -NRTaddInner(db,x) == +addInner(db,x) == --called by genDeltaEntry and others that affect dbUsedEntities do x isnt [.,:.] => nil - x is [":",y,z] => [x.op,y,NRTinnerGetLocalIndex(db,z)] - x is ['SubDomain,y,:.] => NRTinnerGetLocalIndex(db,y) + x is [":",y,z] => [x.op,y,innerGetLocalIndex(db,z)] + x is ['SubDomain,y,:.] => innerGetLocalIndex(db,y) builtinConstructor? x.op or x.op is "[||]" => for y in x.args repeat - NRTinnerGetLocalIndex(db,y) + innerGetLocalIndex(db,y) niladicConstructor? x.op => nil cosig := getDualSignature x.op => for y in x.args for t in cosig.source | y isnt '$ and t repeat - NRTinnerGetLocalIndex(db,y) + innerGetLocalIndex(db,y) keyedSystemError("S2NR0003",[x]) x @@ -330,7 +330,7 @@ consDomainForm(db,x,dc) == ++ Called by buildFunctor fill dbTemplate slots with names ++ of compiled functions -NRTdescendCodeTran(db,u,condList) == +descendCodeTran(db,u,condList) == null u => nil u is ['%list] => nil u is ['%store,['%tref,.,i],a] => @@ -343,8 +343,8 @@ NRTdescendCodeTran(db,u,condList) == fn nil --code for this will be generated by the instantiator u is ['%when,:c] => - for [pred,:y] in c|y repeat NRTdescendCodeTran(db,first y,[pred,:condList]) - u is ['PROGN,:c] => for x in c repeat NRTdescendCodeTran(db,x,condList) + for [pred,:y] in c|y repeat descendCodeTran(db,first y,[pred,:condList]) + u is ['PROGN,:c] => for x in c repeat descendCodeTran(db,x,condList) nil ++ Remove useless statements from the elaboration `form' of @@ -480,14 +480,14 @@ buildFunctor(db,sig,code,$locals,$e) == -- Do this now to create predicate vector; then DescendCode can refer -- to predicate vector if it can [$uncondAlist,:$condAlist] := --bound in compDefineFunctor1 - NRTsetVector4Part1(db,viewNames,catvecListMaker,condCats,$e) + setVector4Part1(db,viewNames,catvecListMaker,condCats,$e) [$NRTslot1PredicateList,predBitVectorCode1,:predBitVectorCode2] := makePredicateBitVector(db,[:ASSOCRIGHT $condAlist,:$NRTslot1PredicateList],$e) storeOperationCode := DescendCode(db,code,true,nil,$e) - NRTaddDeltaCode db + addDeltaCode db storeOperationCode := NRTputInLocalReferences(db,storeOperationCode) - NRTdescendCodeTran(db,storeOperationCode,nil) --side effects storeOperationCode + descendCodeTran(db,storeOperationCode,nil) --side effects storeOperationCode codePart2:= argStuffCode := [['%store,['%tref,'$,i],v] for i in $NRTbase.. for v in $FormalMapVariableList @@ -513,7 +513,7 @@ buildFunctor(db,sig,code,$locals,$e) == slot3Code := ['%store,['%tref,"$",3],"pv$"] slamCode := isCategoryPackageName name => nil - [NRTaddToSlam($definition,"$")] + [addToSlam($definition,"$")] --CODE: part 3 $ConstantAssignments := @@ -527,13 +527,13 @@ buildFunctor(db,sig,code,$locals,$e) == SAY ['"time taken in buildFunctor: ",TEMPUS_-FUGIT()-oldtime] ans -NRTsetVector4Part1(db,siglist,formlist,condlist,e) == +setVector4Part1(db,siglist,formlist,condlist,e) == $uncondList: local := nil $condList: local := nil $count: local := 0 for sig in reverse siglist for form in reverse formlist for cond in reverse condlist repeat - NRTsetVector4a(db,sig,form,cond,e) + setVector4a(db,sig,form,cond,e) reducedUncondlist := removeDuplicates $uncondList reducedConlist := [[x,:y] for [x,z] in $condList| y := SETDIFFERENCE(z,reducedUncondlist)] @@ -551,7 +551,7 @@ reverseCondlist cl == u.rest := [x,:rest u] alist -NRTsetVector4a(db,sig,form,cond,e) == +setVector4a(db,sig,form,cond,e) == sig is '$ => domainList := [domForm for d in categoryPrincipals dbDomainShell db] where @@ -566,7 +566,7 @@ NRTsetVector4a(db,sig,form,cond,e) == $uncondList := [form,:append(categoryPrincipals evalform,$uncondList)] $condList := [[cond,[form,:categoryPrincipals evalform]],:$condList] -NRTmakeSlot1Info db == +makeSlot1Info db == -- 4 cases: -- a:T == b add c --- slot1 directory has #s for entries defined in c -- a:T == b --- slot1 has all slot #s = nil (see compFunctorBody) @@ -592,19 +592,19 @@ slot1Filter opList == u := [entry for entry in l | integer? second entry] => [op,:u] nil -NRToptimizeHas u == +optimizeHas u == --u is a list ((pred cond)...) -- see optFunctorBody --produces an alist: (((HasCategory a b) . gensym)...) u is [a,:b] => a='HasCategory => LASSOC(u,$hasCategoryAlist) or $hasCategoryAlist := [[u,:(y:=gensym())],:$hasCategoryAlist] y - a="has" => NRToptimizeHas ['HasCategory,first b,MKQ second b] + a="has" => optimizeHas ['HasCategory,first b,MKQ second b] a is 'QUOTE => u - [NRToptimizeHas a,:NRToptimizeHas b] + [optimizeHas a,:optimizeHas b] u -NRTaddToSlam([name,:argnames],shell) == +addToSlam([name,:argnames],shell) == dbInstanceCache constructorDB name = nil => return nil null argnames => addToConstructorCache(name,nil,shell) args := ['%list,:ASSOCRIGHT $devaluateList] |