@@ -60,33 +60,46 @@ intEq x y = case x == y of
61-- | A tactic script to run intEq on two let-bound or introduced
61-- | A tactic script to run intEq on two let-bound or introduced
62-- arguments of the current (otherwise empty) proof context
62-- arguments of the current (otherwise empty) proof context
63−firstEq : List (TTName, Binder TT) -> Tactic
63+firstEq : List (TTName, Binder TT) -> TT -> Tactic
64−firstEq ((_, (Let _ y))::(_, (Let _ x))::(_, Let _ f)::Nil) = Exact (App (App f x) y)
64+firstEq ((_, (Let _ y))::(_, (Let _ x))::(_, Let _ f)::Nil) _ = Exact (App (App f x) y)
65−firstEq ((y, Lam yt)::(x, Lam xt)::(_, Let _ f)::Nil) = Exact (App (App f (P (Bound) x xt)) (P Bound y yt))
65+firstEq ((y, Lam yt)::(x, Lam xt)::(_, Let _ f)::Nil) _ = Exact (App (App f (P (Bound) x xt)) (P Bound y yt))
66−firstEq xs = Exact (TConst (I 0))
66+firstEq xs _ = Exact (TConst (I 0))
68-- | Skip 3 arguments of the proof context and return the fourth one which
68-- | Skip 3 arguments of the proof context and return the fourth one which
69-- has to be introduced.
69-- has to be introduced.
70-- Used for the tactical dispatch example, which will push dispatch,
70-- Used for the tactical dispatch example, which will push dispatch,
71−-- its current proof context and the result of dispatch applied to it
71+-- its current proof context, the goal, and the result of dispatch applied to it
73−innerTac : List (TTName, Binder TT) -> Tactic
73+innerTac : List (TTName, Binder TT) -> TT -> Tactic
74−innerTac (_::_::_::(x, Lam xt)::_) = Exact (P Bound x xt)
74+innerTac (_::_::_::_::(x, Lam xt)::_) _ = Exact (P Bound x xt)
76-- | Returns the reflected representation of innerTac
76-- | Returns the reflected representation of innerTac
77innerTacTT : TT
77innerTacTT : TT
78innerTacTT = ?innerTacTTPrf
78innerTacTT = ?innerTacTTPrf
80-- | Dispatch to the reflected rep. of innerTac
80-- | Dispatch to the reflected rep. of innerTac
81−dispatch : List (TTName, Binder TT) -> Tactic
81+dispatch : List (TTName, Binder TT) -> TT -> Tactic
82−dispatch xs = ApplyTactic (innerTacTT)
82+dispatch xs _ = ApplyTactic (innerTacTT)
84-- | Call dispatch which will then dispatch to innerTac.
84-- | Call dispatch which will then dispatch to innerTac.
85tacticalDispatch : Int -> Int
85tacticalDispatch : Int -> Int
86tacticalDispatch = ?tacticalDispatchPrf
86tacticalDispatch = ?tacticalDispatchPrf
88+-- | A tactic to get the representation of its goal
89+studyGoalTac : List (TTName, Binder TT) -> TT -> Tactic
90+studyGoalTac _ goal = Reflect goal
92+-- | Returns the representation of its goal, TT
93+-- (so this is reflect on the type TT)
95+studyGoal = ?studyGoalPrf
88---------- Proofs ----------
97---------- Proofs ----------
99+ReflectionExamples.studyGoalPrf = proof {
100+ applyTactic studyGoalTac;
90ReflectionExamples.envTuplePrf = proof {
103ReflectionExamples.envTuplePrf = proof {
91 let x = tupleType;
104 let x = tupleType;