Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.47 KB | None | 0 0
  1. do
  2. done <- isEOF
  3. if done
  4. then return (good, lastChecked, fstTerm)
  5. else do inp <- getLine
  6. let e = parseExpr inp
  7. let (isAx, axNum) = isAxiom e
  8. let (canBeMP, impl, leftImpl) = canBeMPonused e (Map.lookup e exprsFromRightParts) good
  9. if term /= e
  10. then if e `Map.member` good
  11. then getCorrectStatements term hyps good exprsFromRightParts (num + 1) e fstTerm
  12. else if isAx
  13. then getCorrectStatements term hyps (Map.insert e (Axiom num axNum) good)
  14. (let (Binary Impl a b) = e in (insertToMap b e num exprsFromRightParts)) (num + 1) e fstTerm
  15. else if e `Map.member` hyps
  16. then if isImpl e
  17. then getCorrectStatements term hyps (Map.insert e (Hyp num (hyps Map.! e)) good)
  18. (let (Binary Impl a b) = e in (insertToMap b e num exprsFromRightParts)) (num + 1) e fstTerm
  19. else getCorrectStatements term hyps (Map.insert e (Hyp num (hyps Map.! e)) good) exprsFromRightParts (num + 1) e fstTerm
  20. else if canBeMP
  21. then if isImpl e
  22. then let (Binary Impl a b) = e in getCorrectStatements term hyps (Map.insert e (Mp num impl leftImpl) good)
  23. (insertToMap b e num exprsFromRightParts) (num + 1) e fstTerm
  24. else getCorrectStatements term hyps (Map.insert e (Mp num impl leftImpl) good) exprsFromRightParts (num + 1) e fstTerm
  25. else return (Map.empty, e, 0)
  26. else if e `Map.member` good
  27. then getCorrectStatements term hyps good exprsFromRightParts (num + 1) e fstTerm
  28. else if isAx
  29. then getCorrectStatements term hyps (Map.insert e (Axiom num axNum) good)
  30. (let (Binary Impl a b) = e in (insertToMap b e num exprsFromRightParts)) (num + 1) e num
  31. else if e `Map.member` hyps
  32. then if isImpl e
  33. then getCorrectStatements term hyps (Map.insert e (Hyp num (hyps Map.! e)) good)
  34. (let (Binary Impl a b) = e in (insertToMap b e num exprsFromRightParts)) (num + 1) e num
  35. else getCorrectStatements term hyps (Map.insert e (Hyp num (hyps Map.! e)) good) exprsFromRightParts (num + 1) e num
  36. else if canBeMP
  37. then if isImpl e
  38. then let (Binary Impl a b) = e in getCorrectStatements term hyps (Map.insert e (Mp num impl leftImpl) good)
  39. (insertToMap b e num exprsFromRightParts) (num + 1) e num
  40. else getCorrectStatements term hyps (Map.insert e (Mp num impl leftImpl) good) exprsFromRightParts (num + 1) e num
  41. else return (Map.empty, e, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement