aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/interp/cattable.boot10
-rw-r--r--src/interp/i-funsel.boot6
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