Skip to content

Commit

Permalink
Beautified solve a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
doaitse committed May 24, 2011
1 parent 153e0dd commit 8160be7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Language/Prolog/NanoProlog/Lib.hs
Expand Up @@ -94,9 +94,8 @@ solve :: [Rule] -> Maybe Env -> [TaggedTerm] -> Result
solve _ Nothing _ = ApplyRules []
solve _ (Just e) [] = Done e
solve rules e ((tg,t):ts) = ApplyRules
[ (tg, rule, solve rules nextenv (zip (map (\ n -> tg ++ "." ++ show n) [1..]) cs ++ ts))
[ (tg, rule, solve rules (unify (t, c) e) ( (map (( tg ++). ('.' :). show) [1..]) `zip` cs ++ ts))
| rule@(c :<-: cs) <- tag tg rules
, nextenv@(Just _) <- [unify (t, c) e]
]

-- ** Printing the solutions | `enumerateBreadthFirst` performs a
Expand Down

0 comments on commit 8160be7

Please sign in to comment.