Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a "prove" function to Tactic.

  • Loading branch information...
commit 6e550dd75e8dad28dc280c52049210edd76f3011 1 parent eaf863e
@luqui authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 ixi/IXi/Tactic.hs
View
10 ixi/IXi/Tactic.hs
@@ -3,6 +3,7 @@ module IXi.Tactic
, hypothesis, conversion, implRule, xiRule, hxiRule, hhRule, xihRule, theorem
, inspect, (>|<)
, newName
+ , prove
)
where
@@ -78,3 +79,12 @@ newName f = Tactic $ \seq -> unTactic (f (Seq.newName seq)) seq
infixr 1 >|<
(>|<) :: Tactic -> Tactic -> Tactic
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
Please sign in to comment.
Something went wrong with that request. Please try again.