summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF/Forest.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-10-21 12:47:26 +0000
committerkrasimir <krasimir@chalmers.se>2010-10-21 12:47:26 +0000
commit82edf7bebb62dffb0386f5d78b6871e2523b49e4 (patch)
treea6d5027b22acf196102c46af78ace909163a6e69 /src/runtime/haskell/PGF/Forest.hs
parent8bffe71cd4af103faaa4276df086aa1b7546844e (diff)
support for proof search with high-order functions
Diffstat (limited to 'src/runtime/haskell/PGF/Forest.hs')
-rw-r--r--src/runtime/haskell/PGF/Forest.hs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/runtime/haskell/PGF/Forest.hs b/src/runtime/haskell/PGF/Forest.hs
index 0b481d0a2..5d06f4e97 100644
--- a/src/runtime/haskell/PGF/Forest.hs
+++ b/src/runtime/haskell/PGF/Forest.hs
@@ -203,13 +203,9 @@ foldForest f g b fcat forest =
instance Selector FId where
splitSelector s = (s,s)
- select cat dp = TcM (\abstr s ms -> case Map.lookup cat (cats abstr) of
- Just (_,fns) -> iter abstr s ms fns
- Nothing -> Fail s (UnknownCat cat))
+ select cat scope dp = do
+ gens <- typeGenerators scope cat
+ TcM (\abstr s ms -> iter s ms gens)
where
- iter abstr s ms [] = Zero
- iter abstr s ms ((_,fn):fns) = Plus (select_helper fn abstr s ms) (iter abstr s ms fns)
-
-select_helper fn = unTcM $ do
- ty <- lookupFunType fn
- return (EFun fn,ty)
+ iter s ms [] = Zero
+ iter s ms ((_,e,tty):fns) = Plus (Ok s ms (e,tty)) (iter s ms fns)