File: Mathlib/Testing/SlimCheck/Testable.lean

full_name: SlimCheck.TestResult.success
code: /-- Result of trying to disprove `p`
The constructors are:
* `success : (Unit ⊕' p) → TestResult p`
  succeed when we find another example satisfying `p`
  In `success h`, `h` is an optional proof of the proposition.
  Without the proof, all we know is that we found one example
  where `p` holds. With a proof, the one test was sufficient to
  prove that `p` holds and we do not need to keep finding examples.
* `gaveUp : ℕ → TestResult p`
  give up when a well-formed example cannot be generated.
  `gaveUp n` tells us that `n` invalid examples were tried.
  Above 100, we give up on the proposition and report that we
  did not find a way to properly test it.
* `failure : ¬ p → (List String) → ℕ → TestResult p`
  a counter-example to `p`; the strings specify values for the relevant variables.
  `failure h vs n` also carries a proof that `p` does not hold. This way, we can
  guarantee that there will be no false positive. The last component, `n`,
  is the number of times that the counter-example was shrunk.
-/
inductive TestResult (p : Prop) where
  | success : Unit ⊕' p → TestResult p
  | gaveUp : Nat → TestResult p
  | failure : ¬ p → List String → Nat → TestResult p
  deriving Inhabited
goal: Unit ⊕' p → SlimCheck.TestResult p

full_name: SlimCheck.TestResult.gaveUp
code: /-- Result of trying to disprove `p`
The constructors are:
* `success : (Unit ⊕' p) → TestResult p`
  succeed when we find another example satisfying `p`
  In `success h`, `h` is an optional proof of the proposition.
  Without the proof, all we know is that we found one example
  where `p` holds. With a proof, the one test was sufficient to
  prove that `p` holds and we do not need to keep finding examples.
* `gaveUp : ℕ → TestResult p`
  give up when a well-formed example cannot be generated.
  `gaveUp n` tells us that `n` invalid examples were tried.
  Above 100, we give up on the proposition and report that we
  did not find a way to properly test it.
* `failure : ¬ p → (List String) → ℕ → TestResult p`
  a counter-example to `p`; the strings specify values for the relevant variables.
  `failure h vs n` also carries a proof that `p` does not hold. This way, we can
  guarantee that there will be no false positive. The last component, `n`,
  is the number of times that the counter-example was shrunk.
-/
inductive TestResult (p : Prop) where
  | success : Unit ⊕' p → TestResult p
  | gaveUp : Nat → TestResult p
  | failure : ¬ p → List String → Nat → TestResult p
  deriving Inhabited
goal: ℕ → SlimCheck.TestResult p

full_name: SlimCheck.TestResult
code: /-- Result of trying to disprove `p`
The constructors are:
* `success : (Unit ⊕' p) → TestResult p`
  succeed when we find another example satisfying `p`
  In `success h`, `h` is an optional proof of the proposition.
  Without the proof, all we know is that we found one example
  where `p` holds. With a proof, the one test was sufficient to
  prove that `p` holds and we do not need to keep finding examples.
* `gaveUp : ℕ → TestResult p`
  give up when a well-formed example cannot be generated.
  `gaveUp n` tells us that `n` invalid examples were tried.
  Above 100, we give up on the proposition and report that we
  did not find a way to properly test it.
* `failure : ¬ p → (List String) → ℕ → TestResult p`
  a counter-example to `p`; the strings specify values for the relevant variables.
  `failure h vs n` also carries a proof that `p` does not hold. This way, we can
  guarantee that there will be no false positive. The last component, `n`,
  is the number of times that the counter-example was shrunk.
-/
inductive TestResult (p : Prop) where
  | success : Unit ⊕' p → TestResult p
  | gaveUp : Nat → TestResult p
  | failure : ¬ p → List String → Nat → TestResult p
  deriving Inhabited
goal: Type

full_name: SlimCheck.instInhabitedTestResult
code: /-- Result of trying to disprove `p`
The constructors are:
* `success : (Unit ⊕' p) → TestResult p`
  succeed when we find another example satisfying `p`
  In `success h`, `h` is an optional proof of the proposition.
  Without the proof, all we know is that we found one example
  where `p` holds. With a proof, the one test was sufficient to
  prove that `p` holds and we do not need to keep finding examples.
* `gaveUp : ℕ → TestResult p`
  give up when a well-formed example cannot be generated.
  `gaveUp n` tells us that `n` invalid examples were tried.
  Above 100, we give up on the proposition and report that we
  did not find a way to properly test it.
* `failure : ¬ p → (List String) → ℕ → TestResult p`
  a counter-example to `p`; the strings specify values for the relevant variables.
  `failure h vs n` also carries a proof that `p` does not hold. This way, we can
  guarantee that there will be no false positive. The last component, `n`,
  is the number of times that the counter-example was shrunk.
-/
inductive TestResult (p : Prop) where
  | success : Unit ⊕' p → TestResult p
  | gaveUp : Nat → TestResult p
  | failure : ¬ p → List String → Nat → TestResult p
  deriving Inhabited
goal: {a : Prop} → Inhabited (SlimCheck.TestResult a)

full_name: SlimCheck.TestResult.failure
code: /-- Result of trying to disprove `p`
The constructors are:
* `success : (Unit ⊕' p) → TestResult p`
  succeed when we find another example satisfying `p`
  In `success h`, `h` is an optional proof of the proposition.
  Without the proof, all we know is that we found one example
  where `p` holds. With a proof, the one test was sufficient to
  prove that `p` holds and we do not need to keep finding examples.
* `gaveUp : ℕ → TestResult p`
  give up when a well-formed example cannot be generated.
  `gaveUp n` tells us that `n` invalid examples were tried.
  Above 100, we give up on the proposition and report that we
  did not find a way to properly test it.
* `failure : ¬ p → (List String) → ℕ → TestResult p`
  a counter-example to `p`; the strings specify values for the relevant variables.
  `failure h vs n` also carries a proof that `p` does not hold. This way, we can
  guarantee that there will be no false positive. The last component, `n`,
  is the number of times that the counter-example was shrunk.
-/
inductive TestResult (p : Prop) where
  | success : Unit ⊕' p → TestResult p
  | gaveUp : Nat → TestResult p
  | failure : ¬ p → List String → Nat → TestResult p
  deriving Inhabited
goal: ¬p → List String → ℕ → SlimCheck.TestResult p

full_name: SlimCheck.Configuration.quiet
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Bool

full_name: SlimCheck.Configuration.traceShrink
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Bool

full_name: SlimCheck.Configuration
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Type

full_name: SlimCheck.Configuration.traceDiscarded
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Bool

full_name: SlimCheck.Configuration.traceShrinkCandidates
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Bool

full_name: SlimCheck.Configuration.randomSeed
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Option ℕ

full_name: SlimCheck.Configuration.traceSuccesses
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Bool

full_name: SlimCheck.Configuration.numInst
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: ℕ

full_name: SlimCheck.Configuration.maxSize
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: ℕ

full_name: SlimCheck.Configuration.numRetries
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: ℕ

full_name: SlimCheck.instInhabitedConfiguration
code: /-- Configuration for testing a property. -/
structure Configuration where
  numInst : Nat := 100
  maxSize : Nat := 100
  numRetries : Nat := 10
  traceDiscarded : Bool := false
  traceSuccesses : Bool := false
  traceShrink : Bool := false
  traceShrinkCandidates : Bool := false
  randomSeed : Option Nat := none
  quiet : Bool := false
  deriving Inhabited
goal: Inhabited SlimCheck.Configuration

full_name: SlimCheck.instToExprConfiguration
code: instance : ToExpr Configuration 
goal: Lean.ToExpr SlimCheck.Configuration

full_name: SlimCheck.evalUnsafe._@.Mathlib.Testing.SlimCheck.Testable._hyg.246
code: /--
Allow elaboration of `Configuration` arguments to tactics.
-/
declare_config_elab elabConfig Configuration
goal: Lean.Expr → Lean.Elab.TermElabM SlimCheck.Configuration

full_name: SlimCheck.eval._@.Mathlib.Testing.SlimCheck.Testable._hyg.246
code: /--
Allow elaboration of `Configuration` arguments to tactics.
-/
declare_config_elab elabConfig Configuration
goal: Lean.Expr → Lean.Elab.TermElabM SlimCheck.Configuration

full_name: SlimCheck.elabConfig
code: /--
Allow elaboration of `Configuration` arguments to tactics.
-/
declare_config_elab elabConfig Configuration
goal: Lean.Syntax → Lean.Elab.TermElabM SlimCheck.Configuration

full_name: SlimCheck.PrintableProp
code: /--
`PrintableProp p` allows one to print a proposition so that
`SlimCheck` can indicate how values relate to each other.
It's basically a poor man's delaborator.
-/
class PrintableProp (p : Prop) where
  printProp : String
goal: Type

full_name: SlimCheck.PrintableProp.printProp
code: /--
`PrintableProp p` allows one to print a proposition so that
`SlimCheck` can indicate how values relate to each other.
It's basically a poor man's delaborator.
-/
class PrintableProp (p : Prop) where
  printProp : String
goal: String

full_name: SlimCheck.instPrintableProp
code: instance (priority := low) : PrintableProp p 
goal: SlimCheck.PrintableProp p

full_name: SlimCheck.Testable
code: /-- `Testable p` uses random examples to try to disprove `p`. -/
class Testable (p : Prop) where
  run (cfg : Configuration) (minimize : Bool) : Gen (TestResult p)
goal: Type

full_name: SlimCheck.Testable.run
code: /-- `Testable p` uses random examples to try to disprove `p`. -/
class Testable (p : Prop) where
  run (cfg : Configuration) (minimize : Bool) : Gen (TestResult p)
goal: SlimCheck.Gen (SlimCheck.TestResult p)

full_name: SlimCheck.NamedBinder
code: @[nolint unusedArguments]
def NamedBinder (_n : String) (p : Prop) : Prop 
goal: Prop

full_name: SlimCheck.TestResult.toString
code: def toString : TestResult p → String
  
goal: SlimCheck.TestResult p → String

full_name: SlimCheck.TestResult.instToString
code: instance : ToString (TestResult p) 
goal: ToString (SlimCheck.TestResult p)

full_name: SlimCheck.TestResult.combine
code: /-- Applicative combinator proof carrying test results. -/
def combine {p q : Prop} : Unit ⊕' (p → q) → Unit ⊕' p → Unit ⊕' q
  
goal: Unit ⊕' (p → q) → Unit ⊕' p → Unit ⊕' q

full_name: SlimCheck.TestResult.and
code: /-- Combine the test result for properties `p` and `q` to create a test for their conjunction. -/
def and : TestResult p → TestResult q → TestResult (p ∧ q)
  
goal: SlimCheck.TestResult p → SlimCheck.TestResult q → SlimCheck.TestResult (p ∧ q)

full_name: SlimCheck.TestResult.or
code: /-- Combine the test result for properties `p` and `q` to create a test for their disjunction. -/
def or : TestResult p → TestResult q → TestResult (p ∨ q)
  
goal: SlimCheck.TestResult p → SlimCheck.TestResult q → SlimCheck.TestResult (p ∨ q)

full_name: SlimCheck.TestResult.imp
code: /-- If `q → p`, then `¬ p → ¬ q` which means that testing `p` can allow us
to find counter-examples to `q`. -/
def imp (h : q → p) (r : TestResult p)
    (p : Unit ⊕' (p → q) := PSum.inl ()) : TestResult q 
goal: optParam (Unit ⊕' (p → q)) (PSum.inl ()) → SlimCheck.TestResult q

full_name: SlimCheck.TestResult.iff
code: /-- Test `q` by testing `p` and proving the equivalence between the two. -/
def iff (h : q ↔ p) (r : TestResult p) : TestResult q 
goal: SlimCheck.TestResult q

full_name: SlimCheck.TestResult.addInfo
code: /-- When we assign a value to a universally quantified variable,
we record that value using this function so that our counter-examples
can be informative. -/
def addInfo (x : String) (h : q → p) (r : TestResult p)
    (p : Unit ⊕' (p → q) := PSum.inl ()) : TestResult q 
goal: optParam (Unit ⊕' (p → q)) (PSum.inl ()) → SlimCheck.TestResult q

full_name: SlimCheck.TestResult.addVarInfo
code: /-- Add some formatting to the information recorded by `addInfo`. -/
def addVarInfo {γ : Type*} [Repr γ] (var : String) (x : γ) (h : q → p) (r : TestResult p)
    (p : Unit ⊕' (p → q) := PSum.inl ()) : TestResult q 
goal: optParam (Unit ⊕' (p → q)) (PSum.inl ()) → SlimCheck.TestResult q

full_name: SlimCheck.TestResult.isFailure
code: def isFailure : TestResult p → Bool
  
goal: SlimCheck.TestResult p → Bool

full_name: SlimCheck.Configuration.verbose
code: /-- A configuration with all the trace options enabled, useful for debugging. -/
def verbose : Configuration 
goal: SlimCheck.Configuration

full_name: SlimCheck.Testable.runProp
code: def runProp (p : Prop) [Testable p] : Configuration → Bool → Gen (TestResult p) 
goal: SlimCheck.Configuration → Bool → SlimCheck.Gen (SlimCheck.TestResult p)

full_name: SlimCheck.Testable.slimTrace
code: /-- A `dbgTrace` with special formatting -/
def slimTrace {m : Type → Type*} [Pure m] (s : String) : m PUnit 
goal: m PUnit.{1}

full_name: SlimCheck.Testable.andTestable
code: instance andTestable [Testable p] [Testable q] : Testable (p ∧ q) 
goal: SlimCheck.Testable (p ∧ q)

full_name: SlimCheck.Testable.orTestable
code: instance orTestable [Testable p] [Testable q] : Testable (p ∨ q) 
goal: SlimCheck.Testable (p ∨ q)

full_name: SlimCheck.Testable.iffTestable
code: instance iffTestable [Testable ((p ∧ q) ∨ (¬ p ∧ ¬ q))] : Testable (p ↔ q) 
goal: SlimCheck.Testable (p ↔ q)

full_name: SlimCheck.Testable.decGuardTestable
code: instance decGuardTestable [PrintableProp p] [Decidable p] {β : p → Prop} [∀ h, Testable (β h)] :
    Testable (NamedBinder var <| ∀ h, β h) 
goal: SlimCheck.Testable (SlimCheck.NamedBinder var (∀ (h : p), β h))

full_name: SlimCheck.Testable.forallTypesTestable
code: instance forallTypesTestable {f : Type → Prop} [Testable (f Int)] :
    Testable (NamedBinder var <| ∀ x, f x) 
goal: SlimCheck.Testable (SlimCheck.NamedBinder var (∀ (x : Type), f x))

full_name: SlimCheck.Testable.factTestable
code: instance factTestable [Testable p] : Testable (Fact p) 
goal: SlimCheck.Testable (Fact p)

full_name: SlimCheck.Testable.formatFailure
code: /--
Format the counter-examples found in a test failure.
-/
def formatFailure (s : String) (xs : List String) (n : Nat) : String 
goal: String

full_name: SlimCheck.Testable.addShrinks
code: /--
Increase the number of shrinking steps in a test result.
-/
def addShrinks (n : Nat) : TestResult p → TestResult p
  
goal: SlimCheck.TestResult p → SlimCheck.TestResult p

full_name: SlimCheck.Testable.instInhabitedOptionTOfPure
code: instance {α : Type u} {m : Type u → Type*} [Pure m] : Inhabited (OptionT m α) 
goal: Inhabited (OptionT m α)

full_name: SlimCheck.Testable.minimizeAux
code: /-- Shrink a counter-example `x` by using `Shrinkable.shrink x`, picking the first
candidate that falsifies a property and recursively shrinking that one.
The process is guaranteed to terminate because `shrink x` produces
a proof that all the values it produces are smaller (according to `SizeOf`)
than `x`. -/
partial def minimizeAux [SampleableExt α] {β : α → Prop} [∀ x, Testable (β x)] (cfg : Configuration)
    (var : String) (x : SampleableExt.proxy α) (n : Nat) :
    OptionT Gen (Σ x, TestResult (β (SampleableExt.interp x))) 
goal: OptionT SlimCheck.Gen
  ((x : SlimCheck.SampleableExt.proxy α) × SlimCheck.TestResult (β (SlimCheck.SampleableExt.interp x)))

full_name: SlimCheck.Testable.minimize
code: /-- Once a property fails to hold on an example, look for smaller counter-examples
to show the user. -/
def minimize [SampleableExt α] {β : α → Prop} [∀ x, Testable (β x)] (cfg : Configuration)
    (var : String) (x : SampleableExt.proxy α) (r : TestResult (β <| SampleableExt.interp x)) :
    Gen (Σ x, TestResult (β <| SampleableExt.interp x)) 
goal: SlimCheck.Gen ((x : SlimCheck.SampleableExt.proxy α) × SlimCheck.TestResult (β (SlimCheck.SampleableExt.interp x)))

full_name: SlimCheck.Testable.varTestable
code: /-- Test a universal property by creating a sample of the right type and instantiating the
bound variable with it. -/
instance varTestable [SampleableExt α] {β : α → Prop} [∀ x, Testable (β x)] :
    Testable (NamedBinder var <| ∀ x : α, β x) 
goal: SlimCheck.Testable (SlimCheck.NamedBinder var (∀ (x : α), β x))

full_name: SlimCheck.Testable.propVarTestable
code: /-- Test a universal property about propositions -/
instance propVarTestable {β : Prop → Prop} [∀ b : Bool, Testable (β b)] :
  Testable (NamedBinder var <| ∀ p : Prop, β p)

goal: SlimCheck.Testable (SlimCheck.NamedBinder var (∀ (p : Prop), β p))

full_name: SlimCheck.Testable.unusedVarTestable
code: instance (priority := high) unusedVarTestable {β : Prop} [Nonempty α] [Testable β] :
  Testable (NamedBinder var (α → β))

goal: SlimCheck.Testable (SlimCheck.NamedBinder var (α → β))

full_name: SlimCheck.Testable.subtypeVarTestable
code: instance (priority := 2000) subtypeVarTestable {p : α → Prop} {β : α → Prop}
    [∀ x, PrintableProp (p x)]
    [∀ x, Testable (β x)]
    [SampleableExt (Subtype p)] {var'} :
    Testable (NamedBinder var <| Π x : α, NamedBinder var' <| p x → β x) 
goal: SlimCheck.Testable (SlimCheck.NamedBinder var (∀ (x : α), SlimCheck.NamedBinder var' (p x → β x)))

full_name: SlimCheck.Testable.decidableTestable
code: instance (priority := low) decidableTestable {p : Prop} [PrintableProp p] [Decidable p] :
    Testable p 
goal: SlimCheck.Testable p

full_name: SlimCheck.Eq.printableProp
code: instance Eq.printableProp [Repr α] {x y : α} : PrintableProp (x = y) 
goal: SlimCheck.PrintableProp (x = y)

full_name: SlimCheck.Ne.printableProp
code: instance Ne.printableProp [Repr α] {x y : α} : PrintableProp (x ≠ y) 
goal: SlimCheck.PrintableProp (x ≠ y)

full_name: SlimCheck.LE.printableProp
code: instance LE.printableProp [Repr α] [LE α] {x y : α} : PrintableProp (x ≤ y) 
goal: SlimCheck.PrintableProp (x ≤ y)

full_name: SlimCheck.LT.printableProp
code: instance LT.printableProp [Repr α] [LT α] {x y : α} : PrintableProp (x < y) 
goal: SlimCheck.PrintableProp (x < y)

full_name: SlimCheck.And.printableProp
code: instance And.printableProp [PrintableProp x] [PrintableProp y] : PrintableProp (x ∧ y) 
goal: SlimCheck.PrintableProp (x ∧ y)

full_name: SlimCheck.Or.printableProp
code: instance Or.printableProp [PrintableProp x] [PrintableProp y] : PrintableProp (x ∨ y) 
goal: SlimCheck.PrintableProp (x ∨ y)

full_name: SlimCheck.Iff.printableProp
code: instance Iff.printableProp [PrintableProp x] [PrintableProp y] : PrintableProp (x ↔ y) 
goal: SlimCheck.PrintableProp (x ↔ y)

full_name: SlimCheck.Imp.printableProp
code: instance Imp.printableProp [PrintableProp x] [PrintableProp y] : PrintableProp (x → y) 
goal: SlimCheck.PrintableProp (x → y)

full_name: SlimCheck.Not.printableProp
code: instance Not.printableProp [PrintableProp x] : PrintableProp (¬x) 
goal: SlimCheck.PrintableProp ¬x

full_name: SlimCheck.True.printableProp
code: instance True.printableProp : PrintableProp True 
goal: SlimCheck.PrintableProp True

full_name: SlimCheck.False.printableProp
code: instance False.printableProp : PrintableProp False 
goal: SlimCheck.PrintableProp False

full_name: SlimCheck.Bool.printableProp
code: instance Bool.printableProp {b : Bool} : PrintableProp b 
goal: SlimCheck.PrintableProp (b = true)

full_name: SlimCheck.Fact.printableProp
code: instance Fact.printableProp [PrintableProp p] : PrintableProp (Fact p) 
goal: SlimCheck.PrintableProp (Fact p)

full_name: SlimCheck.retry
code: /-- Execute `cmd` and repeat every time the result is `gave_up` (at most `n` times). -/
def retry (cmd : Rand (TestResult p)) : Nat → Rand (TestResult p)
  
goal: ℕ → Rand (SlimCheck.TestResult p)

full_name: SlimCheck.giveUp
code: /-- Count the number of times the test procedure gave up. -/
def giveUp (x : Nat) : TestResult p → TestResult p
  
goal: SlimCheck.TestResult p → SlimCheck.TestResult p

full_name: SlimCheck.Testable.runSuiteAux
code: /-- Try `n` times to find a counter-example for `p`. -/
def Testable.runSuiteAux (p : Prop) [Testable p] (cfg : Configuration) :
    TestResult p → Nat → Rand (TestResult p)

goal: SlimCheck.TestResult p → ℕ → Rand (SlimCheck.TestResult p)

full_name: SlimCheck.Testable.runSuite
code: /-- Try to find a counter-example of `p`. -/
def Testable.runSuite (p : Prop) [Testable p] (cfg : Configuration := {}) : Rand (TestResult p) 
goal: Rand (SlimCheck.TestResult p)

full_name: SlimCheck.Testable.checkIO
code: /-- Run a test suite for `p` in `BaseIO` using the global RNG in `stdGenRef`. -/
def Testable.checkIO (p : Prop) [Testable p] (cfg : Configuration := {}) : BaseIO (TestResult p) 
goal: BaseIO (SlimCheck.TestResult p)

full_name: SlimCheck.Decorations.addDecorations
code: /-- Traverse the syntax of a proposition to find universal quantifiers
quantifiers and add `NamedBinder` annotations next to them. -/
partial def addDecorations (e : Expr) : MetaM Expr 
goal: Lean.MetaM Lean.Expr

full_name: SlimCheck.Decorations.DecorationsOf
code: /-- `DecorationsOf p` is used as a hint to `mk_decorations` to specify
that the goal should be satisfied with a proposition equivalent to `p`
with added annotations. -/
@[nolint unusedArguments]
abbrev DecorationsOf (_p : Prop) 
goal: Type

full_name: SlimCheck.Decorations.tacticMk_decorations
code: /-- In a goal of the shape `⊢ DecorationsOf p`, `mk_decoration` examines
the syntax of `p` and adds `NamedBinder` around universal quantifications
to improve error messages. This tool can be used in the declaration of a
function as follows:
```lean
def foo (p : Prop) (p' : Decorations.DecorationsOf p := by mk_decorations) [Testable p'] : ...
```
`p` is the parameter given by the user, `p'` is a definitionally equivalent
proposition where the quantifiers are annotated with `NamedBinder`.
-/
scoped elab "mk_decorations" : tactic => do
  let goal ← getMainGoal
  let goalType ← goal.getType
  if let .app (.const ``Decorations.DecorationsOf _) body := goalType then
    closeMainGoal (← addDecorations body)
goal: Lean.ParserDescr

full_name: SlimCheck.Decorations._aux_Mathlib_Testing_SlimCheck_Testable___elabRules_SlimCheck_Decorations_tacticMk_decorations_1
code: /-- In a goal of the shape `⊢ DecorationsOf p`, `mk_decoration` examines
the syntax of `p` and adds `NamedBinder` around universal quantifications
to improve error messages. This tool can be used in the declaration of a
function as follows:
```lean
def foo (p : Prop) (p' : Decorations.DecorationsOf p := by mk_decorations) [Testable p'] : ...
```
`p` is the parameter given by the user, `p'` is a definitionally equivalent
proposition where the quantifiers are annotated with `NamedBinder`.
-/
scoped elab "mk_decorations" : tactic => do
  let goal ← getMainGoal
  let goalType ← goal.getType
  if let .app (.const ``Decorations.DecorationsOf _) body := goalType then
    closeMainGoal (← addDecorations body)
goal: Lean.Elab.Tactic.Tactic

full_name: SlimCheck.Testable.check
code: /-- Run a test suite for `p` and throw an exception if `p` does not hold. -/
def Testable.check (p : Prop) (cfg : Configuration := {})
    (p' : Decorations.DecorationsOf p := by mk_decorations) [Testable p'] : Lean.CoreM PUnit 
goal: Lean.CoreM PUnit.{1}

full_name: SlimCheck.«_aux_Mathlib_Testing_SlimCheck_Testable___macroRules_SlimCheck_command#test__1»
code: macro tk:"#test " e:term : command => `(command| #eval%$tk Testable.check $e)
goal: Lean.Macro

full_name: SlimCheck.«command#test_»
code: macro tk:"#test " e:term : command => `(command| #eval%$tk Testable.check $e)
goal: Lean.ParserDescr