From e7c03b3c3a9da4941f27c708bcf55f411f3daecf Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 15 May 2012 01:24:09 +0200 Subject: missing bullshit --- AufgabeFFP6.hs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/AufgabeFFP6.hs b/AufgabeFFP6.hs index b4bb34b..b786854 100644 --- a/AufgabeFFP6.hs +++ b/AufgabeFFP6.hs @@ -5,10 +5,10 @@ where import Data.Array -type F = Array Int Int +type F = Array Int Int type Op = Int -> Int -> Int -type G = Array Int (Op) -type W = Int +type G = Array Int (Op) +type W = Int -------------------------------------------------------------------------------- @@ -17,7 +17,7 @@ type W = Int myfoldl :: [(a -> b -> a)] -> a -> [b] -> a myfoldl _ f1 [] = f1 -myfoldl (g:gs) f1 (f2:fs) = myfoldl gs (g f1 f2) fs +myfoldl (g:gs) f1 (f2:fs) = myfoldl gs (g f1 f2) fs myfoldl' :: [(a -> a -> a)] -> [a] -> a myfoldl' g (f:fs) = myfoldl g f fs @@ -36,10 +36,9 @@ yield = yield_bt type Node = ([Int], [Int], W, [Op]) goal_yield_bt :: Node -> Bool -goal_yield_bt (f, f', w, g) - | length g == 0 = False -- no operators - | length f' == 0 = eval (listArray (1, length f) f) (listArray (1, length g) g) == w - | otherwise = False +goal_yield_bt (_, _, _, []) = False -- no operators +goal_yield_bt (f, [], w, g) = eval (listArray (1, length f) f) (listArray (1, length g) g) == w +goal_yield_bt (_, _, _, _) = False succ_yield_bt :: Node -> [Node] succ_yield_bt (_, [], _, _) = [] @@ -89,7 +88,7 @@ yield_bt f w = map (\(_, _, _, g) -> listArray (1, length g) g) nodes -------------------------------------------------------------------------------- --- yield_gtf :: Array Int Int -> Int -> [Array Int (Int -> Int -> Int)] +-- yield_gtf :: F -> W -> [G] -------------------------------------------------------------------------------- -- cgit v1.2.3