|
1 | 1 | # Tactics |
2 | 2 |
|
3 | | -Mathlib version: `409137130c4c0e7033eea0a7e369aa8607fd0973` |
| 3 | +Mathlib version: `3ece930d0a4a55679efa52b1a825ac93b2469a06` |
4 | 4 |
|
5 | 5 | ## \#adaptation_note |
6 | 6 | Defined in: `«tactic#adaptation_note_»` |
@@ -4159,6 +4159,59 @@ Defined in: `Batteries.Tactic.«tacticPick_goal-_»` |
4159 | 4159 |
|
4160 | 4160 | See also `Tactic.rotate_goals`, which moves goals from the front to the back and vice-versa. |
4161 | 4161 |
|
| 4162 | +## plausible |
| 4163 | +Defined in: `plausibleSyntax` |
| 4164 | + |
| 4165 | +`plausible` considers a proof goal and tries to generate examples |
| 4166 | +that would contradict the statement. |
| 4167 | + |
| 4168 | +Let's consider the following proof goal. |
| 4169 | + |
| 4170 | +```lean |
| 4171 | +xs : List Nat, |
| 4172 | +h : ∃ (x : Nat) (H : x ∈ xs), x < 3 |
| 4173 | +⊢ ∀ (y : Nat), y ∈ xs → y < 5 |
| 4174 | +``` |
| 4175 | + |
| 4176 | +The local constants will be reverted and an instance will be found for |
| 4177 | +`Testable (∀ (xs : List Nat), (∃ x ∈ xs, x < 3) → (∀ y ∈ xs, y < 5))`. |
| 4178 | +The `Testable` instance is supported by an instance of `Sampleable (List Nat)`, |
| 4179 | +`Decidable (x < 3)` and `Decidable (y < 5)`. |
| 4180 | + |
| 4181 | +Examples will be created in ascending order of size (more or less) |
| 4182 | + |
| 4183 | +The first counter-examples found will be printed and will result in an error: |
| 4184 | + |
| 4185 | +``` |
| 4186 | +=================== |
| 4187 | +Found problems! |
| 4188 | +xs := [1, 28] |
| 4189 | +x := 1 |
| 4190 | +y := 28 |
| 4191 | +------------------- |
| 4192 | +``` |
| 4193 | + |
| 4194 | +If `plausible` successfully tests 100 examples, it acts like |
| 4195 | +admit. If it gives up or finds a counter-example, it reports an error. |
| 4196 | + |
| 4197 | +For more information on writing your own `Sampleable` and `Testable` |
| 4198 | +instances, see `Testing.Plausible.Testable`. |
| 4199 | + |
| 4200 | +Optional arguments given with `plausible (config : { ... })` |
| 4201 | +* `numInst` (default 100): number of examples to test properties with |
| 4202 | +* `maxSize` (default 100): final size argument |
| 4203 | + |
| 4204 | +Options: |
| 4205 | +* `set_option trace.plausible.decoration true`: print the proposition with quantifier annotations |
| 4206 | +* `set_option trace.plausible.discarded true`: print the examples discarded because they do not |
| 4207 | + satisfy assumptions |
| 4208 | +* `set_option trace.plausible.shrink.steps true`: trace the shrinking of counter-example |
| 4209 | +* `set_option trace.plausible.shrink.candidates true`: print the lists of candidates considered |
| 4210 | + when shrinking each variable |
| 4211 | +* `set_option trace.plausible.instance true`: print the instances of `testable` being used to test |
| 4212 | + the proposition |
| 4213 | +* `set_option trace.plausible.success true`: print the tested samples that satisfy a property |
| 4214 | + |
4162 | 4215 | ## polyrith |
4163 | 4216 | Defined in: `Mathlib.Tactic.Polyrith.«tacticPolyrithOnly[_]»` |
4164 | 4217 |
|
|
0 commit comments