on master help sign in
Merge pull request #2598 from david-christiansen/wip/tactical

Put Elab in Prelude and deprecate old-style tactics

commit8e7216e28c476458cfa62e43452720dfdd1d3a65 authorDavid Christiansen <david@davidchristiansen.dk> dateWed 23 Sep 2015, 14:51 (11 years ago) parentd03c71c8a1bc7d
45 files changed+211−81
CHANGELOG+11−4 docs/reference/elaborator-reflection.rst+9−7 docs/reference/tactics.rst+10−6 libs/base/Debug/Error.idr+1−1 libs/base/base.ipkg+1−1 libs/contrib/Data/Heap.idr+10−19 libs/prelude/Language/Reflection/Elab.idr+17 libs/prelude/Prelude.idr+1 libs/prelude/prelude.ipkg+1−1 src/Idris/AbsSyntaxTree.hs+3−1 src/Idris/CmdOptions.hs+2 src/Idris/Core/ProofState.hs+6−6 src/Idris/DeepSeq.hs+3−1 src/Idris/Elab/Term.hs+7 src/Idris/ParseData.hs+12−2 src/Idris/ParseExpr.hs+10 src/Idris/ParseHelpers.hs+2−1 src/Idris/Prover.hs+24−20 test/basic002/expected+4 test/basic002/run+1−1 test/docs003/expected+1 test/effects003/expected+2 test/effects003/hangman.idr+4 test/effects003/run+1−1 test/proof001/expected+4 test/proof001/run+1−1 test/proof002/expected+6 test/proof003/expected+12 test/proof003/run+1−1 test/proof008/expected+2 test/proof008/run+1−1 test/proof009/expected+1 test/quasiquote004/expected+6 test/reg017/expected+4 test/reg017/run+1−1 test/reg028/expected+2 test/reg044/expected+2 test/sourceLocation001/expected+8 test/sourceLocation001/run+1−1 test/totality002/expected+2 test/totality003/run+2−2 test/tutorial002/expected+6 test/tutorial002/run+1−1 test/tutorial004/expected+4 test/tutorial004/run+1−1
CHANGELOG+11−4
@@ -9,6 +9,9 @@ Language updates
99 for defining new names. `{n} still quotes n to an existing name in scope.
1010* A new primitive operator prim__strSubstr for more efficient extraction of
1111 substrings. External code generators should implement this.
12+* The previous syntax for tactic proofs and the previous interactive prover
13+ are now deprecated in favour of reflected elaboration. They will be removed
14+ at some point in the future.
1215* Changed scoping rules for unbound implicits: any name which would be a
1316 valid unbound implicit is now *always* an unbound implicit. This is much
1417 more resilient to changes in inputs, but does require that function names
@@ -18,13 +21,15 @@ Library updates
1821---------------
1922
2023* The 'Neg' class now represents numeric types which can be negative. As
21−such, the (-) operator and 'abs' have been moved there from 'Num'.
24+ such, the (-) operator and 'abs' have been moved there from 'Num'.
2225* A special version of (-) on 'Nat' requires that the second argument is
23−smaller than or equal to the first. 'minus' retains the old behaviour,
24−returning Z if there is an underflow.
26+ smaller than or equal to the first. 'minus' retains the old behaviour,
27+ returning Z if there is an underflow.
2528* The (+), (-), and (*) operations on Fin have been removed.
2629* New Logging Effects have been added to facilitate logging of effectful
2730 programmes.
31+* Elaborator reflection is now a part of the prelude. It is no longer
32+ necessary to import Language.Reflection.Elab.
2833
2934Tool updates
3035------------
@@ -33,8 +38,10 @@ Tool updates
3338
3439Miscellaneous updates
3540---------------------
41+* Disable the deprecation warnings for %elim and old-style tactic scripts
42+ with the --no-elim-deprecation-warnings and --no-tactic-deprecation-warnings
43+ flags.
3644
37−[None so far]
3845
3946New in 0.9.19:
4047--------------
docs/reference/elaborator-reflection.rst+9−7
@@ -11,11 +11,6 @@ For details, see Edwin Brady's 2013 paper in the Journal of Functional Programmi
1111Elaborator reflection makes the elaboration type as well as a selection of its tactics available to Idris code.
1212This means that metaprograms written in Idris can have complete control over the elaboration process, generating arbitrary code, and they have access to all of the facilities available in the elaborator, such as higher-order unification, type checking, and emitting auxiliary definitions.
1313
14−WARNING
15−=======
16−
17−Elaborator reflection is a new, **experimental** feature. It **will change**. You've been warned.
18−
1914The Elaborator State
2015====================
2116
@@ -81,8 +76,15 @@ Interactively Building Elab Scripts
8176
8277To build an ``Elab`` script interactively, use the ``:elab`` command at the REPL.
8378It takes the name of a hole as an argument.
84−The interface is largely the same as in Idris's interactive prover, except all meta-commands start with colon.
85−For example, use ``:qed`` instead of ``qed``, ``:abandon`` instead of ``abandon``, and ``:undo`` instead of ``undo``.
79+To list all available holes, use the command ``:m``.
80+
81+In interactive elaboration shell, the following commands are available:
82+- ``:q`` - Quits the elaboration shell (gives up on proving current lemma).
83+- ``:abandon`` - Same as :q
84+- ``:state`` - Displays the current state of the term being constructed.
85+- ``:term`` - Displays the current proof term complete with its yet-to-be-filled holes.
86+- ``:undo`` - Undoes the last tactic.
87+- ``:qed`` - Once the elaboration shell tells you "No more goals," you get to type this in celebration! (Completes the construction and exits the shell)
8688
8789
8890Failure
docs/reference/tactics.rst+10−6
@@ -1,7 +1,11 @@
11***************************
2−Tactics and Theorem Proving
2+DEPRECATED: Tactics and Theorem Proving
33***************************
44
5+.. warning::
6+ The interactive theorem-proving interface documented here has been
7+ deprecated in favor of :ref:`elaborator-reflection`.
8+
59Idris supports interactive theorem proving, and the analyse of context
610through holes. To list all unproven holes, use the command ``:m``.
711This will display their qualified names and the expected types. To
@@ -15,12 +19,12 @@ Basic commands
1519==============
1620
1721- ``:q`` - Quits the prover (gives up on proving current lemma).
18−- ``abandon`` - Same as :q
19−- ``state`` - Displays the current state of the proof.
20−- ``term`` - Displays the current proof term complete with its
22+- ``:abandon`` - Same as :q
23+- ``:state`` - Displays the current state of the proof.
24+- ``:term`` - Displays the current proof term complete with its
2125 yet-to-be-filled holes (is only really useful for debugging).
22−- ``undo`` - Undoes the last tactic.
23−- ``qed`` - Once the interactive theorem prover tells you "No more
26+- ``:undo`` - Undoes the last tactic.
27+- ``:qed`` - Once the interactive theorem prover tells you "No more
2428 goals," you get to type this in celebration! (Completes the proof and
2529 exits the prover)
2630
libs/base/Debug/Error.idr+1−1
@@ -8,7 +8,7 @@ import System
88||| @ loc The source location to display for the error
99||| @ message The error to print
1010partial
11−error : {default tactics {sourceLocation} loc : SourceLocation} ->
11+error : {default (%runElab sourceLocation) loc : SourceLocation} ->
1212 (message : String) ->
1313 a
1414error {loc = FileLoc filename (line, col) _} message =
libs/base/base.ipkg+1−1
@@ -1,6 +1,6 @@
11package base
22
3−opts = "--nobasepkgs --total -i ../prelude"
3+opts = "--nobasepkgs --total --no-elim-deprecation-warnings -i ../prelude"
44modules = System,
55
66 Debug.Error, Debug.Trace,
libs/contrib/Data/Heap.idr+10−19
@@ -133,21 +133,21 @@ instance Ord a => Monoid (MaxiphobicHeap a) where
133133-- Properties
134134--------------------------------------------------------------------------------
135135
136−total absurdBoolDischarge : False = True -> Void
137−absurdBoolDischarge p = replace {P = disjointTy} p ()
138− where
139− total disjointTy : Bool -> Type
140− disjointTy False = ()
141− disjointTy True = Void
136+total
137+absurdBoolDischarge : False = True -> Void
138+absurdBoolDischarge Refl impossible
142139
143−total isEmptySizeZero : (h : MaxiphobicHeap a) -> (isEmpty h = True) -> size h = Z
140+total
141+isEmptySizeZero : (h : MaxiphobicHeap a) -> (isEmpty h = True) -> size h = Z
144142isEmptySizeZero Empty p = Refl
145−isEmptySizeZero (Node s l e r) p = ?isEmptySizeZeroNodeAbsurd
143+isEmptySizeZero (Node s l e r) Refl impossible
146144
147−total emptyHeapValid : Ord a => isValidHeap (empty {a}) = True
145+total
146+emptyHeapValid : Ord a => isValidHeap (empty {a}) = True
148147emptyHeapValid = Refl
149148
150−total singletonHeapValid : Ord a => (e : a) -> isValidHeap $ singleton e = True
149+total
150+singletonHeapValid : Ord a => (e : a) -> isValidHeap $ singleton e = True
151151singletonHeapValid e = Refl
152152
153153{-
@@ -161,16 +161,7 @@ mergePreservesValidHeaps (Node ls ll le lr) (Node rs rl re rr) lp rp =
161161 ?mergePreservesValidHeapsBody
162162-}
163163
164−--------------------------------------------------------------------------------
165−-- Proofs
166−--------------------------------------------------------------------------------
167164
168−isEmptySizeZeroNodeAbsurd = proof {
169− intros;
170− refine void;
171− refine absurdBoolDischarge;
172− exact p;
173−}
174165
175166--------------------------------------------------------------------------------
176167-- Debug
libs/prelude/Language/Reflection/Elab.idr+17
@@ -139,6 +139,7 @@ data Elab : Type -> Type where
139139 prim__Compute : Elab ()
140140 prim__Normalise : (List (TTName, Binder TT)) -> TT -> Elab TT
141141 prim__Whnf : TT -> Elab TT
142+ prim__Converts : (List (TTName, Binder TT)) -> TT -> TT -> Elab ()
142143
143144 prim__DeclareType : TyDecl -> Elab ()
144145 prim__DefineFunction : FunDefn -> Elab ()
@@ -373,6 +374,22 @@ namespace Tactics
373374 whnf : (term : TT) -> Elab TT
374375 whnf term = prim__Whnf term
375376
377+ ||| Check that two terms are convertable in the current context and
378+ ||| in some environment.
379+ |||
380+ ||| @ env a lexical environment to compare the terms in (see `getEnv`)
381+ ||| @ term1 the first term to convert
382+ ||| @ term2 the second term to convert
383+ convertsInEnv : (env : List (TTName, Binder TT)) -> (term1, term2 : TT) -> Elab ()
384+ convertsInEnv env term1 term2 = prim__Converts env term1 term2
385+
386+ ||| Check that two terms are convertable in the current context and environment
387+ |||
388+ ||| @ term1 the first term to convert
389+ ||| @ term2 the second term to convert
390+ converts : (term1, term2 : TT) -> Elab ()
391+ converts term1 term2 = convertsInEnv !getEnv term1 term2
392+
376393 ||| Find the source context for the elaboration script
377394 getSourceLocation : Elab SourceLocation
378395 getSourceLocation = prim__SourceLocation
libs/prelude/Prelude.idr+1
@@ -30,6 +30,7 @@ import public Prelude.File
3030import public Prelude.Doubles
3131import public Decidable.Equality
3232import public Language.Reflection
33+import public Language.Reflection.Elab
3334import public Language.Reflection.Errors
3435
3536%access public
libs/prelude/prelude.ipkg+1−1
@@ -1,6 +1,6 @@
11package prelude
22
3−opts = "--nobuiltins --total"
3+opts = "--nobuiltins --total --no-elim-deprecation-warnings"
44modules = Builtins, Prelude, IO,
55
66 Prelude.Algebra, Prelude.Basics, Prelude.Bool, Prelude.Cast,
src/Idris/AbsSyntaxTree.hs+3−1
@@ -506,10 +506,12 @@ data Opt = Filename String
506506 | Client String
507507 | ShowOrigErr
508508 | AutoWidth -- ^ Automatically adjust terminal width
509− | AutoSolve -- ^ Automatically issue "solve" tactic in interactive prover
509+ | AutoSolve -- ^ Automatically issue "solve" tactic in old-style interactive prover
510510 | UseConsoleWidth ConsoleWidth
511511 | DumpHighlights
512512 | DesugarNats
513+ | NoElimDeprecationWarnings -- ^ Don't show deprecation warnings for %elim
514+ | NoOldTacticDeprecationWarnings -- ^ Don't show deprecation warnings for old-style tactics
513515 deriving (Show, Eq)
514516
515517data ElabShellCmd = EQED | EAbandon | EUndo | EProofState | EProofTerm
src/Idris/CmdOptions.hs+2
@@ -148,6 +148,8 @@ parseFlags = many $
148148
149149 <|> (UseConsoleWidth <$> option (str >>= parseConsoleWidth) (long "consolewidth" <> metavar "WIDTH" <> help "Select console width: auto, infinite, nat"))
150150 <|> flag' DumpHighlights (long "highlight" <> help "Emit source code highlighting")
151+ <|> flag' NoElimDeprecationWarnings (long "no-elim-deprecation-warnings" <> help "Disable deprecation warnings for %elim")
152+ <|> flag' NoOldTacticDeprecationWarnings (long "no-tactic-deprecation-warnings" <> help "Disable deprecation warnings for the old tactic sublanguage")
151153
152154 where
153155 getExt s = case maybeRead s of
src/Idris/Core/ProofState.hs+6−6
@@ -621,19 +621,19 @@ introTy ty n ctxt env _ = fail "Can't introduce here."
621621
622622intro :: Maybe Name -> RunTactic
623623intro mn ctxt env (Bind x (Hole t) (P _ x' _)) | x == x' =
624− do let n = case mn of
625− Just name -> name
626− Nothing -> x
627− let t' = case t of
624+ do let t' = case t of
628625 x@(Bind y (Pi _ s _) _) -> x
629626 _ -> hnf ctxt env t
630627 case t' of
631628 Bind y (Pi _ s _) t ->
629+ let n = case mn of
630+ Just name -> name
631+ Nothing -> y
632632 -- It's important that this be subst and not updsubst,
633633 -- because we want to substitute even in portions of
634634 -- terms that we know do not contain holes.
635− let t' = subst y (P Bound n s) t in
636− return $ Bind n (Lam s) (Bind x (Hole t') (P Bound x t'))
635+ t' = subst y (P Bound n s) t
636+ in return $ Bind n (Lam s) (Bind x (Hole t') (P Bound x t'))
637637 _ -> lift $ tfail $ CantIntroduce t'
638638intro n ctxt env _ = fail "Can't introduce here."
639639
src/Idris/DeepSeq.hs+3−1
@@ -162,7 +162,9 @@ instance NFData Opt where
162162 rnf (AutoWidth) = ()
163163 rnf (AutoSolve) = ()
164164 rnf (UseConsoleWidth cw) = rnf cw `seq` ()
165− rnf (DumpHighlights) = ()
165+ rnf DumpHighlights = ()
166+ rnf NoElimDeprecationWarnings = ()
167+ rnf NoOldTacticDeprecationWarnings = ()
166168
167169
168170instance NFData TIData where
src/Idris/Elab/Term.hs+7
@@ -1961,6 +1961,13 @@ runElabAction ist fc env tm ns = do tm' <- eval tm
19611961 = do tm' <- reifyTT tm
19621962 ctxt <- get_context
19631963 fmap fst . checkClosed . reflect $ whnf ctxt tm'
1964+ | n == tacN "prim__Converts", [env, tm1, tm2] <- args
1965+ = do env' <- reifyEnv env
1966+ tm1' <- reifyTT tm1
1967+ tm2' <- reifyTT tm2
1968+ ctxt <- get_context
1969+ lift $ converts ctxt env' tm1' tm2'
1970+ returnUnit
19641971 | n == tacN "prim__DeclareType", [decl] <- args
19651972 = do (RDeclare n args res) <- reifyTyDecl decl
19661973 ctxt <- get_context
src/Idris/ParseData.hs+12−2
@@ -157,11 +157,21 @@ DefaultEliminator ::= 'noelim'?
157157 -}
158158dataOpts :: DataOpts -> IdrisParser DataOpts
159159dataOpts opts
160− = do reserved "%elim"; dataOpts (DefaultEliminator : DefaultCaseFun : opts)
161− <|> do reserved "%case"; dataOpts (DefaultCaseFun : opts)
160+ = do fc <- reservedFC "%elim"
161+ warnElim fc
162+ dataOpts (DefaultEliminator : DefaultCaseFun : opts)
163+ <|> do fc <- reservedFC "%case"
164+ warnElim fc
165+ dataOpts (DefaultCaseFun : opts)
162166 <|> do reserved "%error_reverse"; dataOpts (DataErrRev : opts)
163167 <|> return opts
164168 <?> "data options"
169+ where warnElim fc =
170+ do ist <- get
171+ let cmdline = opt_cmdline (idris_options ist)
172+ unless (NoElimDeprecationWarnings `elem` cmdline) $
173+ put ist { parserWarnings =
174+ (fc, Msg "Eliminator generation is deprecated. Use an eliminator generator in a library instead.") : parserWarnings ist }
165175
166176{- | Parses a data type declaration
167177Data ::= DocComment? Accessibility? DataI DefaultEliminator FnName TypeSig ExplicitTypeDataRest?
src/Idris/ParseExpr.hs+10
@@ -331,6 +331,14 @@ caseOption syn = do lhs <- expr (syn { inPattern = True })
331331 return (lhs, r)
332332 <?> "case option"
333333
334+warnTacticDeprecation :: FC -> IdrisParser ()
335+warnTacticDeprecation fc =
336+ do ist <- get
337+ let cmdline = opt_cmdline (idris_options ist)
338+ unless (NoOldTacticDeprecationWarnings `elem` cmdline) $
339+ put ist { parserWarnings =
340+ (fc, Msg "This style of tactic proof is deprecated. See %runElab for the replacement.") : parserWarnings ist }
341+
334342{- | Parses a proof block
335343@
336344ProofExpr ::=
@@ -342,6 +350,7 @@ proofExpr :: SyntaxInfo -> IdrisParser PTerm
342350proofExpr syn = do kw <- reservedFC "proof"
343351 ts <- indentedBlock1 (tactic syn)
344352 highlightP kw AnnKeyword
353+ warnTacticDeprecation kw
345354 return $ PProof ts
346355 <?> "proof block"
347356
@@ -356,6 +365,7 @@ tacticsExpr :: SyntaxInfo -> IdrisParser PTerm
356365tacticsExpr syn = do kw <- reservedFC "tactics"
357366 ts <- indentedBlock1 (tactic syn)
358367 highlightP kw AnnKeyword
368+ warnTacticDeprecation kw
359369 return $ PTactics ts
360370 <?> "tactics block"
361371
src/Idris/ParseHelpers.hs+2−1
@@ -100,7 +100,8 @@ reportParserWarnings = do ist <- getIState
100100 mapM_ (uncurry iWarn)
101101 (map (\ (fc, err) -> (fc, pprintErr ist err)) .
102102 reverse .
103− nub $
103+ nubBy (\(fc, err) (fc', err') ->
104+ FC' fc == FC' fc' && err == err') $
104105 parserWarnings ist)
105106 clearParserWarnings
106107
src/Idris/Prover.hs+24−20
@@ -1,3 +1,4 @@
1+
12{-# LANGUAGE PatternGuards #-}
23module Idris.Prover (prover, showProof, showRunElab) where
34
@@ -5,7 +6,7 @@ module Idris.Prover (prover, showProof, showRunElab) where
56-- This exludes (<$>) as fmap, because wl-pprint uses it for newline
67import Prelude (Eq(..), Show(..),
78 Bool(..), Either(..), Maybe(..), String,
8− (.), ($), (++), (||),
9+ (.), ($), (++), (||), (&&),
910 concatMap, id, elem, error, fst, flip, foldl, foldr, init,
1011 length, lines, map, not, null, repeat, reverse, tail, zip)
1112
@@ -89,7 +90,10 @@ prove mode opt ctxt lit n ty
8990 (tm, prf) <-
9091 if mode
9192 then elabloop n True ("-" ++ show n) [] (ES (ps, initEState) "" Nothing) [] Nothing []
92− else ploop n True ("-" ++ show n) [] (ES (ps, initEState) "" Nothing) Nothing
93+ else do iputStrLn $ "Warning: this interactive prover is deprecated and will be removed " ++
94+ "in a future release. Please see :elab for a similar feature that "++
95+ "will replace it."
96+ ploop n True ("-" ++ show n) [] (ES (ps, initEState) "" Nothing) Nothing
9397 logLvl 1 $ "Adding " ++ show tm
9498 i <- getIState
9599 let shower = if mode
@@ -145,16 +149,16 @@ elabStep st e =
145149 return (res, ctxt)
146150 ((_,_,_,_,e,_,_):_) -> lift $ Error e
147151
148−dumpState :: IState -> [(Name, Type, Term)] -> ProofState -> Idris ()
149−dumpState ist menv ps | [] <- holes ps =
152+dumpState :: IState -> Bool -> [(Name, Type, Term)] -> ProofState -> Idris ()
153+dumpState ist inElab menv ps | [] <- holes ps =
150154 do let nm = thname ps
151155 rendered <- iRender $ prettyName True False [] nm <> colon <+> text "No more goals."
152156 iputGoal rendered
153−dumpState ist menv ps | (h : hs) <- holes ps = do
157+dumpState ist inElab menv ps | (h : hs) <- holes ps = do
154158 let OK ty = goalAtFocus ps
155159 let OK env = envAtFocus ps
156160 let state = prettyOtherGoals hs <> line <>
157− prettyAssumptions ty env <> line <>
161+ prettyAssumptions inElab ty env <> line <>
158162 prettyMetaValues (reverse menv) <>
159163 prettyGoal (zip (assumptionNames env) (repeat False)) ty
160164 rendered <- iRender state
@@ -172,18 +176,18 @@ dumpState ist menv ps | (h : hs) <- holes ps = do
172176 assumptionNames :: Env -> [Name]
173177 assumptionNames = map fst
174178
175− prettyPs :: Binder Type -> [(Name, Bool)] -> Env -> Doc OutputAnnotation
176− prettyPs g bnd [] = empty
177− prettyPs g bnd ((n@(MN _ r), _) : bs)
178− | r == txt "rewrite_rule" = prettyPs g ((n, False):bnd) bs
179− prettyPs g bnd ((n@(MN _ _), _) : bs)
180− | not (n `elem` freeEnvNames bs || n `elem` goalNames g) = prettyPs g bnd bs
181− prettyPs g bnd ((n, Let t v) : bs) =
179+ prettyPs :: Bool -> Binder Type -> [(Name, Bool)] -> Env -> Doc OutputAnnotation
180+ prettyPs all g bnd [] = empty
181+ prettyPs all g bnd ((n@(MN _ r), _) : bs)
182+ | not all && r == txt "rewrite_rule" = prettyPs all g ((n, False):bnd) bs
183+ prettyPs all g bnd ((n@(MN _ _), _) : bs)
184+ | not (all || n `elem` freeEnvNames bs || n `elem` goalNames g) = prettyPs all g bnd bs
185+ prettyPs all g bnd ((n, Let t v) : bs) =
182186 line <> bindingOf n False <+> text "=" <+> tPretty bnd v <+> colon <+>
183− align (tPretty bnd t) <> prettyPs g ((n, False):bnd) bs
184− prettyPs g bnd ((n, b) : bs) =
187+ align (tPretty bnd t) <> prettyPs all g ((n, False):bnd) bs
188+ prettyPs all g bnd ((n, b) : bs) =
185189 line <> bindingOf n False <+> colon <+>
186− align (tPretty bnd (binderTy b)) <> prettyPs g ((n, False):bnd) bs
190+ align (tPretty bnd (binderTy b)) <> prettyPs all g ((n, False):bnd) bs
187191
188192 prettyMetaValues [] = empty
189193 prettyMetaValues mvs =
@@ -210,12 +214,12 @@ dumpState ist menv ps | (h : hs) <- holes ps = do
210214 text "---------- Goal: ----------" <$$>
211215 bindingOf h False <+> colon <+> align (prettyG bnd ty)
212216
213− prettyAssumptions g env =
217+ prettyAssumptions inElab g env =
214218 if length env == 0 then
215219 empty
216220 else
217221 text "---------- Assumptions: ----------" <>
218− nest nestingSize (prettyPs g [] $ reverse env)
222+ nest nestingSize (prettyPs inElab g [] $ reverse env)
219223
220224 prettyOtherGoals hs =
221225 if length hs == 0 then
@@ -273,7 +277,7 @@ undoElab prf env st (h:hs) = do (prf', env', st') <- undoStep prf env st h
273277elabloop :: Name -> Bool -> String -> [String] -> ElabState EState -> [ElabShellHistory] -> Maybe History -> [(Name, Type, Term)] -> Idris (Term, [String])
274278elabloop fn d prompt prf e prev h env
275279 = do ist <- getIState
276− when d $ dumpState ist env (proof e)
280+ when d $ dumpState ist True env (proof e)
277281 (x, h') <-
278282 case idris_outputmode ist of
279283 RawOutput _ ->
@@ -390,7 +394,7 @@ ploop :: Name -> Bool -> String -> [String] -> ElabState EState -> Maybe History
390394ploop fn d prompt prf e h
391395 = do i <- getIState
392396 let autoSolve = opt_autoSolve (idris_options i)
393− when d $ dumpState i [] (proof e)
397+ when d $ dumpState i False [] (proof e)
394398 (x, h') <-
395399 case idris_outputmode i of
396400 RawOutput _ ->
test/basic002/expected+4
@@ -1 +1,5 @@
1+test006.idr:25:23-28:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+test006.idr:32:23-28:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
15[False, True, False, True, False, True]
test/basic002/run+1−1
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
2−idris $@ test006.idr -o test006
2+idris $@ --nocolour --consolewidth 80 test006.idr -o test006
33./test006
44rm -f test006 test006.ibc
test/docs003/expected+1
@@ -15,6 +15,7 @@ Instances:
1515 Functor Stream
1616 Functor Provider
1717 Functor Binder
18+ Functor Elab
1819 Functor PrimIO
1920 Functor Maybe
2021 Functor (Either e)
test/effects003/expected+2
@@ -1,3 +1,5 @@
1+hangman.idr:204:8-13:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
13------------
24
356 guesses left
test/effects003/hangman.idr+4
@@ -223,3 +223,7 @@ were caught by the type checker:
223223
224224main : IO ()
225225main = run runGame
226+
227+-- Local Variables:
228+-- idris-load-packages: ("effects")
229+-- End:
test/effects003/run+1−1
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
2−idris $@ hangman.idr -p effects -o hangman
2+idris $@ hangman.idr --consolewidth 80 --nocolour -p effects -o hangman
33./hangman < input
44rm -f hangman *.ibc
test/proof001/expected+4
@@ -0,0 +1,4 @@
1+test029.idr:29:25-30:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+test029.idr:36:25-30:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
test/proof001/run+1−1
@@ -1,3 +1,3 @@
11#!/usr/bin/env bash
2−idris $@ test029.idr --check test029
2+idris $@ test029.idr --consolewidth 80 --nocolour --check test029
33rm -f *.ibc
test/proof002/expected+6
@@ -1,3 +1,9 @@
1+Reflect.idr:173:21-26:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+Reflect.idr:182:21-26:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
5+Reflect.idr:190:15-20:
6+This style of tactic proof is deprecated. See %runElab for the replacement.
17test030a.idr:12:26-14:1:
28When checking right hand side of testReflect1:
39When checking an application of function Reflect.getJust:
test/proof003/expected+12
@@ -1,3 +1,15 @@
1+Parity.idr:15:18-23:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+Parity.idr:22:18-23:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
5+test015.idr:88:15-20:
6+This style of tactic proof is deprecated. See %runElab for the replacement.
7+test015.idr:97:16-21:
8+This style of tactic proof is deprecated. See %runElab for the replacement.
9+test015.idr:108:20-25:
10+This style of tactic proof is deprecated. See %runElab for the replacement.
11+test015.idr:136:20-25:
12+This style of tactic proof is deprecated. See %runElab for the replacement.
11300101010
21401011001
315010000011
test/proof003/run+1−1
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
2−idris $@ test015.idr -o test015
2+idris $@ test015.idr --nocolour --consolewidth 80 -o test015
33./test015
44rm -f test015 Parity.ibc test015.ibc
test/proof008/expected+2
@@ -0,0 +1,2 @@
1+ClaimAndUnfocus.idr:8:27-32:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
test/proof008/run+1−1
@@ -1,3 +1,3 @@
11#!/usr/bin/env bash
2−idris --check $@ ClaimAndUnfocus.idr
2+idris --nocolour --consolewidth 80 --check $@ ClaimAndUnfocus.idr
33rm -f *.ibc
test/proof009/expected+1
@@ -1,3 +1,4 @@
1+Warning: this interactive prover is deprecated and will be removed in a future release. Please see :elab for a similar feature that will replace it.
12
23
34---------- Goal: ----------
test/quasiquote004/expected+6
@@ -1,3 +1,9 @@
1+Quasiquote004.idr:39:26-31:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+Quasiquote004.idr:42:28-33:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
5+Quasiquote004.idr:50:27-32:
6+This style of tactic proof is deprecated. See %runElab for the replacement.
17Quasiquote004.idr:50:25:
28When checking right hand side of Quasiquote004.getMeNat':
39Not a Nat goal
test/reg017/expected+4
@@ -1 +1,5 @@
1+reg017.idr:5:17-24:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+reg017.idr:8:17-24:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
154
test/reg017/run+1−1
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
2−idris $@ reg017.idr -o reg017
2+idris $@ --nocolour --consolewidth 80 reg017.idr -o reg017
33./reg017
44rm -f reg017 *.ibc
test/reg028/expected+2
@@ -1,4 +1,6 @@
11reg028.idr:5:1:
22tbad.bad is possibly not total due to: with block in tbad.bad
3+reg028a.idr:17:14-19:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
35reg028a.idr:11:1:
46tbad.qsort' is possibly not total due to: with block in tbad.qsort'
test/reg044/expected+2
@@ -1,3 +1,5 @@
1+reg044.idr:4:6-11:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
13reg044.idr:4:4:When checking right hand side of Main.pf:
24Type mismatch between
35 b = b (Type of Refl)
test/sourceLocation001/expected+8
@@ -1,3 +1,11 @@
1+SourceLoc.idr:11:19-26:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+SourceLoc.idr:20:19-24:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
5+SourceLoc.idr:40:20-27:
6+This style of tactic proof is deprecated. See %runElab for the replacement.
7+SourceLoc.idr:98:18-23:
8+This style of tactic proof is deprecated. See %runElab for the replacement.
19Testing using definition
210FileLoc "SourceLoc.idr" (16, 11) (16, 17)
311Testing using inline tactics
test/sourceLocation001/run+1−1
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
2−idris $@ SourceLoc.idr -o sourceLocation001
2+idris $@ --nocolour --consolewidth 80 SourceLoc.idr -o sourceLocation001
33./sourceLocation001
44rm -f sourceLocation001 *.ibc
test/totality002/expected+2
@@ -1,3 +1,5 @@
1+test017.idr:94:26-31:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
13test017a.idr:7:1:
24scg.vtrans is possibly not total due to recursive path scg.vtrans --> scg.vtrans
35test017b.idr:4:1:
test/totality003/run+2−2
@@ -1,4 +1,4 @@
11#!/usr/bin/env bash
2−idris --consolewidth 80 $@ totality003.idr --check
3−idris --consolewidth 80 $@ totality003a.idr --check
2+idris --nocolour --consolewidth 80 $@ totality003.idr --check
3+idris --nocolour --consolewidth 80 $@ totality003a.idr --check
44rm -f *.ibc
test/tutorial002/expected+6
@@ -0,0 +1,6 @@
1+tutorial002.idr:41:25-30:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+tutorial002.idr:48:18-23:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
5+tutorial002.idr:54:18-23:
6+This style of tactic proof is deprecated. See %runElab for the replacement.
test/tutorial002/run+1−1
@@ -1,3 +1,3 @@
11#!/usr/bin/env bash
2−idris $@ tutorial002.idr --check
2+idris $@ --nocolour --consolewidth 80 tutorial002.idr --check
33rm -f *.ibc
test/tutorial004/expected+4
@@ -0,0 +1,4 @@
1+tutorial004.idr:46:14-19:
2+This style of tactic proof is deprecated. See %runElab for the replacement.
3+tutorial004.idr:53:14-19:
4+This style of tactic proof is deprecated. See %runElab for the replacement.
test/tutorial004/run+1−1
@@ -1,3 +1,3 @@
11#!/usr/bin/env bash
2−idris $@ tutorial004.idr --check
2+idris $@ tutorial004.idr --check --nocolour --consolewidth 80
33rm -f *.ibc