From 82edf7bebb62dffb0386f5d78b6871e2523b49e4 Mon Sep 17 00:00:00 2001 From: krasimir Date: Thu, 21 Oct 2010 12:47:26 +0000 Subject: support for proof search with high-order functions --- src/runtime/haskell/PGF/Forest.hs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/runtime/haskell/PGF/Forest.hs') 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) -- cgit v1.2.3