diff options
author | dos-reis <gdr@axiomatics.org> | 2011-04-29 05:27:56 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-04-29 05:27:56 +0000 |
commit | 75b600291e154f55fe8d6d10658980315204ced2 (patch) | |
tree | 814ee8866c73889c21d26cbe719bbe794fb3d3d4 | |
parent | b90ec55ea2329e5ffeda7f6cbd807f596c9cc444 (diff) | |
download | open-axiom-75b600291e154f55fe8d6d10658980315204ced2.tar.gz |
* interp/cattable.boot (hasCat): Add type. Accept only
instantiation forms.
(simpHasPred): Adjust call to hasCat.
* interp/i-funsel.boot (hasCaty): Likewise.
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/interp/cattable.boot | 10 | ||||
-rw-r--r-- | src/interp/i-funsel.boot | 6 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b8c36c5d..4353c654 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-04-29 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/cattable.boot (hasCat): Add type. Accept only + instantiation forms. + (simpHasPred): Adjust call to hasCat. + * interp/i-funsel.boot (hasCaty): Likewise. + 2011-04-27 Gabriel Dos Reis <gdr@cs.tamu.edu> * boot/ast.boot (bfReduceCollect): Delegate to bfDoCollect if diff --git a/src/interp/cattable.boot b/src/interp/cattable.boot index bcffbb70..7d3198e1 100644 --- a/src/interp/cattable.boot +++ b/src/interp/cattable.boot @@ -35,10 +35,12 @@ import simpbool import g_-util namespace BOOT +module cattable where + hasCat: (%Instantiation,%Instantiation) -> %Code -hasCat(domainOrCatName,catName) == - catName is "Type" -- every domain is a Type - or constructorHasCategoryFromDB [domainOrCatName,:catName] +hasCat(dom,cat) == + cat.op is "Type" -- every domain is a Type + or constructorHasCategoryFromDB [dom.op,:cat.op] showCategoryTable con == [[b,:val] for (key :=[a,:b]) in HKEYS _*HASCATEGORY_-HASH_* @@ -123,7 +125,7 @@ simpHasPred(pred,:options) == main where IDENTP npred or null hasIdent npred => npred pred evalHas (pred := ["has",d,cat]) == - x := hasCat(first d,first cat) + x := hasCat(d,cat) y := rest cat => npred := or/[p for [args,:p] in x | y = args] => simp npred false --if not there, it is false diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot index 512b0a77..ffdea965 100644 --- a/src/interp/i-funsel.boot +++ b/src/interp/i-funsel.boot @@ -1480,9 +1480,9 @@ hasCaty(d,cat,SL) == for c in cat.args while SL isnt "failed" repeat SL := hasCaty(d,c,SL) SL - x:= hasCat(opOf d,opOf cat) => - y:= KDR cat => - S := constructSubst d + x := (cons? d and cons? cat and hasCat(d,cat)) => + y := KDR cat => + S := constructSubst d for [z,:cond] in x until S1 isnt 'failed repeat S' := [[p, :mkDomPvar(p, d, z, y)] for [p,:d] in S] if $domPvar then |