Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Beautified solve a bit

  • Loading branch information...
commit 8160be7e50e3c94c7b781ccf231ac12677fe4200 1 parent 153e0dd
@doaitse doaitse authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  src/Language/Prolog/NanoProlog/Lib.hs
View
3  src/Language/Prolog/NanoProlog/Lib.hs
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.