Skip to content

Commit

Permalink
Added a "prove" function to Tactic.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqui committed Jun 11, 2009
1 parent eaf863e commit 6e550dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ixi/IXi/Tactic.hs
Expand Up @@ -3,6 +3,7 @@ module IXi.Tactic
, hypothesis, conversion, implRule, xiRule, hxiRule, hhRule, xihRule, theorem , hypothesis, conversion, implRule, xiRule, hxiRule, hhRule, xihRule, theorem
, inspect, (>|<) , inspect, (>|<)
, newName , newName
, prove
) )
where where


Expand Down Expand Up @@ -78,3 +79,12 @@ newName f = Tactic $ \seq -> unTactic (f (Seq.newName seq)) seq
infixr 1 >|< infixr 1 >|<
(>|<) :: Tactic -> Tactic -> Tactic (>|<) :: Tactic -> Tactic -> Tactic
t >|< u = Tactic $ liftA2 mplus (unTactic t) (unTactic u) t >|< u = Tactic $ liftA2 mplus (unTactic t) (unTactic u)

runTactic :: Tactic -> Seq.Sequent -> Seq.Err P.Proof
runTactic (Tactic t) = t

prove :: Term -> Tactic -> P.Theorem
prove stmt tac =
case P.prove stmt =<< runTactic tac ([] Seq.:|- stmt) of
Left e -> error $ "Invalid proof: " ++ e
Right thm -> thm

0 comments on commit 6e550dd

Please sign in to comment.