This PR adjusts the experimental module system to make `private` the default visibility modifier in `module`s, introducing `public` as a new modifier instead. `public section` can be used to revert the default for an entire section, though this is more intended to ease gradual adoption of the new semantics such as in `Init` (and soon `Std`) where they should be replaced by a future decl-by-decl re-review of visibilities.
59 lines
1.7 KiB
Text
59 lines
1.7 KiB
Text
/-
|
|
Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
Authors: Leonardo de Moura
|
|
-/
|
|
module
|
|
|
|
prelude
|
|
public import Init.Tactics
|
|
|
|
public section
|
|
|
|
namespace Lean.Try
|
|
/--
|
|
Configuration for `try?`.
|
|
-/
|
|
structure Config where
|
|
/-- If `main` is `true`, all functions in the current module are considered for function induction, unfolding, etc. -/
|
|
main := true
|
|
/-- If `name` is `true`, all functions in the same namespace are considered for function induction, unfolding, etc. -/
|
|
name := true
|
|
/-- If `targetOnly` is `true`, `try?` collects information using the goal target only. -/
|
|
targetOnly := false
|
|
/-- Maximum number of suggestions. -/
|
|
max := 8
|
|
/-- If `missing` is `true`, allows the construction of partial solutions where some of the subgoals are `sorry`. -/
|
|
missing := false
|
|
/-- If `only` is `true`, generates solutions using `grind only` and `simp only`. -/
|
|
only := true
|
|
/-- If `harder` is `true`, more expensive tactics and operations are tried. -/
|
|
harder := false
|
|
/--
|
|
If `merge` is `true`, it tries to compress suggestions such as
|
|
```
|
|
induction a
|
|
· grind only [= f]
|
|
· grind only [→ g]
|
|
```
|
|
as
|
|
```
|
|
induction a <;> grind only [= f, → g]
|
|
```
|
|
-/
|
|
merge := true
|
|
deriving Inhabited
|
|
|
|
end Lean.Try
|
|
|
|
namespace Lean.Parser.Tactic
|
|
|
|
syntax (name := tryTrace) "try?" optConfig : tactic
|
|
|
|
/-- Helper internal tactic for implementing the tactic `try?`. -/
|
|
syntax (name := attemptAll) "attempt_all " withPosition((ppDedent(ppLine) colGe "| " tacticSeq)+) : tactic
|
|
|
|
/-- Helper internal tactic used to implement `evalSuggest` in `try?` -/
|
|
syntax (name := tryResult) "try_suggestions " tactic* : tactic
|
|
|
|
end Lean.Parser.Tactic
|