Skip to content

Commit 6a769fa

Browse files
committed
add docstring Trans
1 parent d06782d commit 6a769fa

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

Diff for: AesopTest/Forward/SynthTrans.lean

+18-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,25 @@ elab "testTrans " nHyps:num firstNum:num " by " ts:tacticSeq : command => do
3939
-- saturate
4040
-- trivial
4141

42+
/--
43+
#### Transitivity.
4244
43-
def runTestTrans (nHs : Nat) (fH : Nat) : CommandElabM Nanos := do
44-
let mut nHs := Syntax.mkNatLit nHs
45-
let mut fH := Syntax.mkNatLit fH
45+
This test compares the efficiency of the procedures on scaled up version of
46+
a transitivity problem.
47+
48+
Given some predicate `P ?x₁ ?x₂`, we register the rule `r : P x y → P y z → P x z`.
49+
The procedures are then compared on a context containing `nHs` hypotheses
50+
of the form `(h₁ : P a (n + 1)), ..., (hₙ : P (a + n - 1) (a + n))`.
51+
Saturating this goal adds a total of `n(n-1)/2` hypotheses to the context.
52+
53+
- `nHs` : Number of hypotheses in the context.
54+
- `a` : Starting integer for the transitivity chain.
55+
Note that this affects the run time as big number are designed to be much
56+
harder to unify.
57+
-/
58+
def runTestTrans (n : Nat) (a : Nat) : CommandElabM Nanos := do
59+
let mut nHs := Syntax.mkNatLit n
60+
let mut fH := Syntax.mkNatLit a
4661
let cmd := elabCommand <| ← `(testTrans $nHs $fH by
4762
set_option maxRecDepth 1000000 in
4863
set_option maxHeartbeats 5000000 in

0 commit comments

Comments
 (0)