[Imprint][Data Privacy Statement][E-Mail]



View long theorem info. View the proof. Back to main index. View the specification. View theorem base summary, View theorem base listing, the used properties by spec, the dependency list, the symbol table,

Proof step 1 from proof permut-correct (conclusion) (back to tree)

ar0 = ar ⊦ ⟨permut#(; ar, listofar)⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

User applied rule call right

And obtained the following new goals

Rule argument

pos: right 1

Additional information

Used simplifier rules: permut: ⊦ ;

Proof step 2 from proof permut-correct (previous step) (back to tree)

ar0 = ar ⊦ ⟨listofar := []; sort#(; ar); let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar, ar`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar);listofar.toSet = smallerPerms(ar) ++ ar) ∧ (¬ hasNext → max(ar)) wfbound # greaterPerms(ar) + (hasNext ⊃ 1;0) */; listofar := listofar + ar; next#(; ar; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

Heuristic symbolic execution applied rule assign right

And obtained the following new goals

Rule argument

Additional information

Proof step 3 from proof permut-correct (previous step) (back to tree)

ar0 = ar, listofar = [] ⊦ ⟨sort#(; ar); let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar, ar`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar);listofar.toSet = smallerPerms(ar) ++ ar) ∧ (¬ hasNext → max(ar)) wfbound # greaterPerms(ar) + (hasNext ⊃ 1;0) */; listofar := listofar + ar; next#(; ar; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ x + a = x + a '; (s)

Proof step 4 from proof permut-correct (previous step) (back to tree)

ar0 = ar, listofar = [] ⊦ ⟨sort#(; ar); let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar, ar`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar);listofar.toSet = smallerPerms(ar) ++ ar) ∧ (¬ hasNext → max(ar)) wfbound # greaterPerms(ar) + (hasNext ⊃ 1;0) */; listofar := listofar + ar '; next#(; ar; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

User applied rule apply program lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:sort-def, seq:ar0 = ar ⊦ ⟨sort#(; ar)⟩ (ordered≤(ar) ∧ perm(ar0, ar)), subst:[ar, ar0] → [ar, ar], List([[1,0,0]])

Additional information

Proof step 5 from proof permut-correct (previous step) (back to tree)

ar0 = ar ⊦ ⟨sort#(; ar)⟩ (ordered≤(ar) ∧ perm(ar0, ar))

Lemma sort-def

Proof step 6 from proof permut-correct (previous step) (back to tree)

ar = ar, ar0 = ar, ar3 = ar, listofar = [] ⊦ [sort#(; ar) ] (( ordered≤(ar) ∧ perm(ar3, ar) → ⟨let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar, ar`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar);listofar.toSet = smallerPerms(ar) ++ ar) ∧ (¬ hasNext → max(ar)) wfbound # greaterPerms(ar) + (hasNext ⊃ 1;0) */; listofar := listofar + ar '; next#(; ar; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))) ; default :: true )

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 7 from proof permut-correct (previous step) (back to tree)

ar0 = ar, listofar = [] ⊦ [sort#(; ar) ] (( ordered≤(ar) ∧ perm(ar0, ar) → ⟨let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar, ar`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar);listofar.toSet = smallerPerms(ar) ++ ar) ∧ (¬ hasNext → max(ar)) wfbound # greaterPerms(ar) + (hasNext ⊃ 1;0) */; listofar := listofar + ar '; next#(; ar; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))) ; default :: true )

User applied rule skip call

And obtained the following new goals

Rule argument

pos: right 1

Additional information

Proof step 8 from proof permut-correct (previous step) (back to tree)

ar0 = ar, listofar = [] ⊦ ∀ ar. ordered≤(ar) ∧ perm(ar0, ar) → ⟨let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar, ar`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar);listofar.toSet = smallerPerms(ar) ++ ar) ∧ (¬ hasNext → max(ar)) wfbound # greaterPerms(ar) + (hasNext ⊃ 1;0) */; listofar := listofar + ar '; next#(; ar; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 9 from proof permut-correct (previous step) (back to tree)

listofar = [], ordered≤(ar1), perm(ar0, ar1) ⊦ ⟨let hasNext = true in while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar1, ar1`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext → max(ar1)) wfbound # greaterPerms(ar1) + (hasNext ⊃ 1;0) */; listofar := listofar + ar1 '; next#(; ar1; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

Heuristic symbolic execution applied rule let right

And obtained the following new goals

Rule argument

Additional information

Proof step 10 from proof permut-correct (previous step) (back to tree)

hasNext ↔ true, listofar = [], ordered≤(ar1), perm(ar0, ar1) ⊦ ⟨while hasNext do {/* invariant ¬ dups(listofar) ∧ perm(ar1, ar1`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext → max(ar1)) wfbound # greaterPerms(ar1) + (hasNext ⊃ 1;0) */; listofar := listofar + ar1 '; next#(; ar1; hasNext)}⟩ (¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0))

Heuristic annotation applied rule annotation right

And obtained the following new goals

Rule argument

rule: invariant right arg: inv: ¬ dups(listofar) ∧ perm(ar1, ar1`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar1) ;listofar.toSet = smallerPerms(ar1) ++ ar1 ) ∧ (¬ hasNext → max(ar1)) fmapos: right 1 bound: # greaterPerms(ar1) + (hasNext ⊃ 1;0) pos: right 1

Additional information

Used simplifier rules: ordered-arraylist-base0: ⊦ ordered≤([]); nil-toSet: ⊦ [].toSet = ∅; ordered-smallerPerms: ⊦ ordered≤(ar) → smallerPerms(ar) = ∅; <; (wellfounded) ⊦ ¬ dups([]); (s) ⊦ perm(x, x); (s) Used formulas: ¬ dups(listofar) ∧ perm(ar1, ar1`) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext → max(ar1)), # greaterPerms(ar1) + (hasNext ⊃ 1;0) = # greaterPerms(ar1) + (hasNext ⊃ 1;0)

Proof step 11 from proof permut-correct (previous step) (back to tree)

hasNext1 ↔ true, hasNext ↔ hasNext0, ar1 = ar, hasNext, listofar0 = [], ordered≤(ar2), ordered≤(listofar), perm(ar0, ar2), perm(ar1, ar2), ¬ dups(listofar), ¬ hasNext → max(ar1), (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ⊦ ⟨listofar := listofar + ar1 '; next#(; ar1; hasNext)⟩ ( ( ¬ dups(listofar) ∧ perm(ar1, ar2) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext → max(ar1))) ∧ # greaterPerms(ar1) + (hasNext ⊃ 1;0) < # greaterPerms(ar) + (hasNext0 ⊃ 1;0))

Heuristic symbolic execution applied rule assign right

And obtained the following new goals

Rule argument

Additional information

Proof step 12 from proof permut-correct (previous step) (back to tree)

hasNext ↔ hasNext0, hasNext1 ↔ true, ar1 = ar, hasNext, listofar = listofar1 + ar1 ', listofar0 = [], ordered≤(listofar1), ordered≤(ar2), perm(ar1, ar2), perm(ar0, ar2), ¬ dups(listofar1), ¬ hasNext → max(ar1), (hasNext ⊃ listofar1.toSet = smallerPerms(ar1);listofar1.toSet = smallerPerms(ar1) ++ ar1) ⊦ ⟨next#(; ar1; hasNext)⟩ ( ( ¬ dups(listofar) ∧ perm(ar1, ar2) ∧ ordered≤(listofar) ∧ (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext → max(ar1))) ∧ # greaterPerms(ar1) + (hasNext ⊃ 1;0) < # greaterPerms(ar) + (hasNext0 ⊃ 1;0))

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: a: ⊦ (x + y) + z = x + y + z; from specification list[list-of-natarray] ⊦ a ∈ b ' ↔ a = b; (s) ⊦ a ∈ x + y ↔ a ∈ x ∨ a ∈ y; (s) in-15: ⊦ x + a ' = y → a ∈ y; (forward) from specification list[list-of-natarray]

Proof step 13 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar1 = ar, hasNext0, hasNext1, listofar = listofar1 + ar ', ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1) ⊦ ⟨next#(; ar1; hasNext1)⟩ ( ¬ dups(listofar) ∧ perm(ar1, ar2) ∧ ordered≤(listofar) ∧ (hasNext1 ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext1 → max(ar1)) ∧ # greaterPerms(ar1) + (hasNext1 ⊃ 1;0) < # greaterPerms(ar) + (hasNext0 ⊃ 1;0))

User applied rule apply program lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:next-proper-permutation, seq:ar = ar0 ⊦ ⟨next#(; ar; hasNext)⟩ (hasNext ⊃ nextperm(ar0, ar);ar = ar0 ∧ max(ar)), subst:[hasNext, ar, ar0] → [hasNext1, ar1, ar1], List([[1,0,0]])

Additional information

Proof step 14 from proof permut-correct (previous step) (back to tree)

ar = ar0 ⊦ ⟨next#(; ar; hasNext)⟩ (hasNext ⊃ nextperm(ar0, ar);ar = ar0 ∧ max(ar))

Lemma next-proper-permutation

Proof step 15 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar1 = ar, ar1 = ar1, ar5 = ar1, hasNext0, hasNext1, listofar = listofar1 + ar ', ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1) ⊦ [next#(; ar1; hasNext1) ] (( (hasNext1 ⊃ nextperm(ar5, ar1);ar1 = ar5 ∧ max(ar1)) → ¬ dups(listofar) ∧ perm(ar1, ar2) ∧ ordered≤(listofar) ∧ (hasNext1 ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext1 → max(ar1)) ∧ # greaterPerms(ar1) + (hasNext1 ⊃ 1;0) < # greaterPerms(ar) + (hasNext0 ⊃ 1;0)) ; default :: true )

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 16 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar1 = ar, hasNext0, hasNext1, listofar = listofar1 + ar ', ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1) ⊦ [next#(; ar1; hasNext1) ] (( (hasNext1 ⊃ nextperm(ar, ar1);ar1 = ar ∧ max(ar)) → ¬ dups(listofar) ∧ perm(ar1, ar2) ∧ ordered≤(listofar) ∧ (hasNext1 ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext1 → max(ar1)) ∧ # greaterPerms(ar1) + (hasNext1 ⊃ 1;0) < # greaterPerms(ar) + (hasNext0 ⊃ 1;0)) ; default :: true )

User applied rule skip call

And obtained the following new goals

Rule argument

pos: right 1

Additional information

Proof step 17 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar1 = ar, hasNext0, hasNext1, listofar = listofar1 + ar ', ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1) ⊦ ∀ ar1, hasNext1. (hasNext1 ⊃ nextperm(ar, ar1);ar1 = ar ∧ max(ar)) → ¬ dups(listofar) ∧ perm(ar1, ar2) ∧ ordered≤(listofar) ∧ (hasNext1 ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ∧ (¬ hasNext1 → max(ar1)) ∧ # greaterPerms(ar1) + (hasNext1 ⊃ 1;0) < # greaterPerms(ar) + (hasNext0 ⊃ 1;0)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ordered-append: ⊦ ordered≤(arx) ∧ arx.toSet = smallerPerms(ar) → ordered≤(arx + ar '); c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ m < n + 1 ↔ ¬ n < m; (s) a: ⊦ (x + y) + z = x + y + z; from specification list[list-of-natarray] ⊦ dups(x + a ') ↔ a ∈ x ∨ dups(x); (ws)

Proof step 18 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1), (hasNext ⊃ nextperm(ar, ar3);ar3 = ar ∧ max(ar)) ⊦ ¬ ar ∈ listofar1 ∧ perm(ar3, ar2) ∧ (hasNext ⊃ (listofar1 + ar ').toSet = smallerPerms(ar3);(listofar1 + ar ').toSet = smallerPerms(ar3) ++ ar3) ∧ (¬ hasNext → max(ar3)) ∧ ¬ # greaterPerms(ar) < # greaterPerms(ar3) + (hasNext ⊃ 1;0)

User applied rule case distinction

And obtained the following new goals

Rule argument

pos: right 1

Additional information

Proof step 19 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ar ∈ listofar1, ¬ dups(listofar1), (hasNext ⊃ nextperm(ar, ar3);ar3 = ar ∧ max(ar)) ⊦

Heuristic if-then-else split applied rule case distinction

And obtained the following new goals

Rule argument

pos: left 8

Additional information

Proof step 20 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), hasNext, nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ar ∈ listofar1, ¬ dups(listofar1) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 21 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ar ∈ listofar1, ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: set-basic[array-set], name:Extension, seq: ⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2), subst:[s1, s2] → [listofar1.toSet, smallerPerms(ar)], <all paths>

Additional information

Used terms: listofar1.toSet, smallerPerms(ar)

Proof step 22 from proof permut-correct (previous step) (back to tree)

⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2)

A spec-lemma

Proof step 23 from proof permut-correct (previous step) (back to tree)

nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ar ∈ listofar1, ¬ dups(listofar1), ∀ a. a ∈ listofar1.toSet ↔ a ∈ smallerPerms(ar) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: toSet: ⊦ ar ∈ arx.toSet ↔ ar ∈ arx; smaller-perms: ⊦ ar0 ∈ smallerPerms(ar) ↔ ar ≠ ar0 ∧ perm(ar, ar0) ∧ ar0 ≤ ar;

Proof step 24 from proof permut-correct (previous step) (back to tree)

nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ar ∈ listofar1, ¬ dups(listofar1), ∀ a. a ∈ listofar1 ↔ ar ≠ a ∧ perm(ar, a) ∧ a ≤ ar ⊦

Heuristic quantifier closing applied rule all left

And closed the goal!

Rule argument

pos: left 8 terms: ar

Additional information

Used terms: ar

Proof step 25 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar3 = ar, ¬ hasNext, max(ar), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ar ∈ listofar1, ¬ dups(listofar1) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 26 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), max(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ar ∈ listofar1, ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: set-basic[array-set], name:Extension, seq: ⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2), subst:[s1, s2] → [listofar1.toSet, smallerPerms(ar)], <all paths>

Additional information

Used terms: listofar1.toSet, smallerPerms(ar)

Proof step 27 from proof permut-correct (previous step) (back to tree)

⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2)

A spec-lemma

Proof step 28 from proof permut-correct (previous step) (back to tree)

max(ar), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ar ∈ listofar1, ¬ dups(listofar1), ∀ a. a ∈ listofar1.toSet ↔ a ∈ smallerPerms(ar) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: toSet: ⊦ ar ∈ arx.toSet ↔ ar ∈ arx; smaller-perms: ⊦ ar0 ∈ smallerPerms(ar) ↔ ar ≠ ar0 ∧ perm(ar, ar0) ∧ ar0 ≤ ar;

Proof step 29 from proof permut-correct (previous step) (back to tree)

max(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ar ∈ listofar1, ¬ dups(listofar1), ∀ a. a ∈ listofar1 ↔ ar ≠ a ∧ perm(ar, a) ∧ a ≤ ar ⊦

Heuristic quantifier closing applied rule all left

And closed the goal!

Rule argument

pos: left 8 terms: ar

Additional information

Used terms: ar

Proof step 30 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1), ¬ perm(ar3, ar2), (hasNext ⊃ nextperm(ar, ar3);ar3 = ar ∧ max(ar)) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ perm(x, y) ∧ ¬ perm(x0, y) → x ≠ x0; (s)

Proof step 31 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1), ¬ perm(ar3, ar2) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:next-permutation, seq:⊦ nextperm(ar1, ar2) ↔ perm(ar1, ar2) ∧ ar1 ≠ ar2 ∧ ar1 ≤ ar2 ∧ (∀ ar3. perm(ar1, ar3) ∧ ar3 ≠ ar1 ∧ ar3 ≠ ar2 → ¬(ar1 ≤ ar3 ∧ ar3 ≤ ar2)), subst:[ar1, ar2] → [ar, ar3], <all paths>

Additional information

Used terms: ar, ar3

Proof step 32 from proof permut-correct (previous step) (back to tree)

⊦ nextperm(ar1, ar2) ↔ perm(ar1, ar2) ∧ ar1 ≠ ar2 ∧ ar1 ≤ ar2 ∧ (∀ ar3. perm(ar1, ar3) ∧ ar3 ≠ ar1 ∧ ar3 ≠ ar2 → ¬(ar1 ≤ ar3 ∧ ar3 ≤ ar2))

Lemma next-permutation

Proof step 33 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar ≠ ar3, ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), perm(ar, ar3), ar ≤ ar3, ¬ dups(listofar1), ¬ perm(ar3, ar2), ∀ ar0. perm(ar, ar0) ∧ ar0 ≠ ar ∧ ar0 ≠ ar3 → ¬(ar ≤ ar0 ∧ ar0 ≤ ar3) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ perm(x, y) ∧ ¬ perm(x0, y) → x ≠ x0; (s)

Proof step 34 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar3), perm(ar, ar2), perm(ar0, ar2), ar ≤ ar3, ¬ dups(listofar1), ¬ perm(ar3, ar2), ∀ ar1. perm(ar, ar1) ∧ ar1 ≠ ar ∧ ar1 ≠ ar3 → ¬ ar ≤ ar1 ∨ ¬ ar1 ≤ ar3 ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: list-perm[natarray-oarray-sort], name:trans, seq: ⊦ perm(x, y) ∧ perm(y, z) → perm(x, z), subst:[y, x, z] → [ar, ar3, ar2], <all paths>

Additional information

Used terms: ar, ar3, ar2

Proof step 35 from proof permut-correct (previous step) (back to tree)

⊦ perm(x, y) ∧ perm(y, z) → perm(x, z)

A spec-lemma

Proof step 36 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), perm(ar, ar3), ar ≤ ar3, ¬ dups(listofar1), ¬ perm(ar3, ar2), ∀ ar1. perm(ar, ar1) ∧ ar1 ≠ ar ∧ ar1 ≠ ar3 → ¬ ar ≤ ar1 ∨ ¬ ar1 ≤ ar3 ⊦ perm(ar3, ar) ∧ perm(ar, ar2)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 37 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar3), perm(ar, ar2), perm(ar0, ar2), ar ≤ ar3, ¬ dups(listofar1), ¬ perm(ar3, ar2), ¬ perm(ar3, ar), ∀ ar1. perm(ar, ar1) ∧ ar1 ≠ ar ∧ ar1 ≠ ar3 → ¬ ar ≤ ar1 ∨ ¬ ar1 ≤ ar3 ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: list-perm[natarray-oarray-sort], name:sym, seq: ⊦ perm(x, y) ↔ perm(y, x), subst:[x, y] → [ar3, ar], <all paths>

Additional information

Used terms: ar3, ar

Proof step 38 from proof permut-correct (previous step) (back to tree)

⊦ perm(x, y) ↔ perm(y, x)

A spec-lemma

Proof step 39 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1), (hasNext ⊃ nextperm(ar, ar3);ar3 = ar ∧ max(ar)) ⊦ (hasNext ⊃ (listofar1 + ar ').toSet = smallerPerms(ar3);(listofar1 + ar ').toSet = smallerPerms(ar3) ++ ar3)

Heuristic if-then-else split applied rule case distinction

And obtained the following new goals

Rule argument

pos: left 7

Additional information

Proof step 40 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), hasNext, nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1) ⊦ (hasNext ⊃ (listofar1 + ar ').toSet = smallerPerms(ar3);(listofar1 + ar ').toSet = smallerPerms(ar3) ++ ar3)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 41 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), (listofar1 + ar ').toSet ≠ smallerPerms(ar3), nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:next-perm-smallerPerms, seq: ⊦ nextperm(ar1, ar2) → smallerPerms(ar2) = smallerPerms(ar1) ++ ar1, subst:[ar1, ar2] → [ar, ar3], <all paths>

Additional information

Used terms: ar, ar3

Proof step 42 from proof permut-correct (previous step) (back to tree)

⊦ nextperm(ar1, ar2) → smallerPerms(ar2) = smallerPerms(ar1) ++ ar1

Lemma next-perm-smallerPerms

Proof step 43 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), (listofar1 + ar ').toSet ≠ smallerPerms(ar) ++ ar, nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1) ⊦

User applied rule subst equation

And obtained the following new goals

Rule argument

pos: left 1, flags: rotate, discard

Additional information

Proof step 44 from proof permut-correct (previous step) (back to tree)

(listofar1 + ar ').toSet ≠ listofar1.toSet ++ ar, nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: set-basic[array-set], name:Extension, seq: ⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2), subst:[s1, s2] → [(listofar1 + ar ').toSet, listofar1.toSet ++ ar], <all paths>

Additional information

Used simplifier rules: toSet: ⊦ ar ∈ arx.toSet ↔ ar ∈ arx; ⊦ a ∈ s ++ b ↔ a = b ∨ a ∈ s; (s) ⊦ a ∈ x + y ↔ a ∈ x ∨ a ∈ y; (s) ⊦ a ∈ b ' ↔ a = b; (s) a: ⊦ (x + y) + z = x + y + z; from specification list[list-of-natarray] Used terms: (listofar1 + ar ').toSet, listofar1.toSet ++ ar

Proof step 45 from proof permut-correct (previous step) (back to tree)

⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2)

A spec-lemma

Proof step 46 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), ar3 = ar, ¬ hasNext, max(ar), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1) ⊦ (hasNext ⊃ (listofar1 + ar ').toSet = smallerPerms(ar3);(listofar1 + ar ').toSet = smallerPerms(ar3) ++ ar3)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 47 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), (listofar1 + ar ').toSet ≠ smallerPerms(ar) ++ ar, max(ar), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1) ⊦

User applied rule subst equation

And obtained the following new goals

Rule argument

pos: left 1, flags: rotate, discard

Additional information

Proof step 48 from proof permut-correct (previous step) (back to tree)

(listofar1 + ar ').toSet ≠ listofar1.toSet ++ ar, max(ar), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: set-basic[array-set], name:Extension, seq: ⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2), subst:[s1, s2] → [(listofar1 + ar ').toSet, listofar1.toSet ++ ar], <all paths>

Additional information

Used simplifier rules: toSet: ⊦ ar ∈ arx.toSet ↔ ar ∈ arx; ⊦ a ∈ s ++ b ↔ a = b ∨ a ∈ s; (s) ⊦ a ∈ x + y ↔ a ∈ x ∨ a ∈ y; (s) ⊦ a ∈ b ' ↔ a = b; (s) a: ⊦ (x + y) + z = x + y + z; from specification list[list-of-natarray] Used terms: (listofar1 + ar ').toSet, listofar1.toSet ++ ar

Proof step 49 from proof permut-correct (previous step) (back to tree)

⊦ s1 = s2 ↔ (∀ a. a ∈ s1 ↔ a ∈ s2)

A spec-lemma

Proof step 50 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), # greaterPerms(ar) < # greaterPerms(ar3) + (hasNext ⊃ 1;0), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1), (hasNext ⊃ nextperm(ar, ar3);ar3 = ar ∧ max(ar)) ⊦

Heuristic nonsplitting cut applied rule cut formula

And obtained the following new goals

Rule argument

fma: nextperm(ar, ar3)

Additional information

Used simplifier rules: f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic ⊦ n + 0 = n; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ ¬ a < a; (s) Used formulas: nextperm(ar, ar3)

Proof step 51 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), # greaterPerms(ar) < # greaterPerms(ar3) + (hasNext ⊃ 1;0), nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1), (hasNext ⊃ nextperm(ar, ar3);ar3 = ar ∧ max(ar)) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ m < n → n ≠ 0; (s) f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic

Proof step 52 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), # greaterPerms(ar) < # greaterPerms(ar3) + (hasNext ⊃ 1;0), nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), ¬ dups(listofar1), ¬ hasNext → ar3 = ar ∧ max(ar) ⊦

Heuristic nonsplitting cut applied rule cut formula

And obtained the following new goals

Rule argument

fma: ¬ hasNext

Additional information

Used simplifier rules: ⊦ n + 0 = n; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic f: ⊦ m < n → n ≠ 0; (forward) from specification nat-basic ⊦ m < n → n ≠ 0; (s) ⊦ ¬ a < a; (s) Used formulas: ¬ hasNext

Proof step 53 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), hasNext, # greaterPerms(ar) < # greaterPerms(ar3) + (hasNext ⊃ 1;0), nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), ¬ dups(listofar1), ¬ hasNext → ar3 = ar ∧ max(ar) ⊦

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Used simplifier rules: ⊦ m < n ↔ ¬ n ≤ m; (ss) c: ⊦ m + n = n + m; from specification nat-basic a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic ⊦ m < n + 1 ↔ ¬ n < m; (s)

Proof step 54 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), nextperm(ar, ar3), ordered≤(ar2), ordered≤(listofar1), perm(ar0, ar2), perm(ar, ar2), # greaterPerms(ar) ≤ # greaterPerms(ar3), ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:next-perm-greaterPerms, seq: ⊦ nextperm(ar1, ar2) → greaterPerms(ar1) = greaterPerms(ar2) ++ ar2, subst:[ar2, ar1] → [ar3, ar], <all paths>

Additional information

Used terms: ar3, ar

Proof step 55 from proof permut-correct (previous step) (back to tree)

⊦ nextperm(ar1, ar2) → greaterPerms(ar1) = greaterPerms(ar2) ++ ar2

Lemma next-perm-greaterPerms

Proof step 56 from proof permut-correct (previous step) (back to tree)

listofar1.toSet = smallerPerms(ar), nextperm(ar, ar3), ordered≤(listofar1), ordered≤(ar2), perm(ar, ar2), perm(ar0, ar2), #(greaterPerms(ar3) ++ ar3) ≤ # greaterPerms(ar3), ¬ dups(listofar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: set-basic[array-set], name:Size-insert, seq: ⊦ ¬ a ∈ s → #(s ++ a) = # s + 1, subst:[s, a] → [greaterPerms(ar3), ar3], <all paths>

Additional information

Used simplifier rules: greater-perms: ⊦ ar0 ∈ greaterPerms(ar) ↔ ar ≠ ar0 ∧ perm(ar, ar0) ∧ ar ≤ ar0; ⊦ m + 1 ≤ n ↔ m < n; (s) ⊦ ¬ a < a; (s) a: ⊦ (m + n0) + n1 = m + n0 + n1; from specification nat-basic c: ⊦ m + n = n + m; from specification nat-basic ⊦ a ∈ s → s ++ a = s; (s) ⊦ m ≤ m; (s) Used terms: greaterPerms(ar3), ar3

Proof step 57 from proof permut-correct (previous step) (back to tree)

⊦ ¬ a ∈ s → #(s ++ a) = # s + 1

A spec-lemma

Proof step 58 from proof permut-correct (previous step) (back to tree)

hasNext1 ↔ true, ¬ hasNext, listofar0 = [], ordered≤(ar2), ordered≤(listofar), perm(ar0, ar2), perm(ar1, ar2), ¬ dups(listofar), ¬ hasNext → max(ar1), (hasNext ⊃ listofar.toSet = smallerPerms(ar1);listofar.toSet = smallerPerms(ar1) ++ ar1) ⊦ ¬ dups(listofar) ∧ ordered≤(listofar) ∧ listofar.toSet = allPerms(ar0)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 59 from proof permut-correct (previous step) (back to tree)

listofar.toSet = smallerPerms(ar1) ++ ar1, smallerPerms(ar1) ++ ar1 ≠ allPerms(ar0), max(ar1), ordered≤(listofar), ordered≤(ar2), perm(ar1, ar2), perm(ar0, ar2), ¬ dups(listofar) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:max-smaller-perms-all-perms, seq: ⊦ max(ar) → smallerPerms(ar) ++ ar = allPerms(ar), subst:[ar] → [ar1], <all paths>

Additional information

Used terms: ar1

Proof step 60 from proof permut-correct (previous step) (back to tree)

⊦ max(ar) → smallerPerms(ar) ++ ar = allPerms(ar)

Lemma max-smaller-perms-all-perms

Proof step 61 from proof permut-correct (previous step) (back to tree)

listofar.toSet = allPerms(ar1), allPerms(ar1) ≠ allPerms(ar0), max(ar1), ordered≤(ar2), ordered≤(listofar), perm(ar0, ar2), perm(ar1, ar2), ¬ dups(listofar) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: <toplevel>, name:perm-all-perms-eq, seq: ⊦ perm(ar0, ar1) → allPerms(ar0) = allPerms(ar1), subst:[ar1, ar0] → [ar1, ar0], <all paths>

Additional information

Used terms: ar1, ar0

Proof step 62 from proof permut-correct (previous step) (back to tree)

⊦ perm(ar0, ar1) → allPerms(ar0) = allPerms(ar1)

Lemma perm-all-perms-eq

Proof step 63 from proof permut-correct (previous step) (back to tree)

listofar.toSet = allPerms(ar1), allPerms(ar1) ≠ allPerms(ar0), max(ar1), ordered≤(listofar), ordered≤(ar2), perm(ar1, ar2), perm(ar0, ar2), ¬ dups(listofar), ¬ perm(ar0, ar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: list-perm[natarray-oarray-sort], name:trans, seq: ⊦ perm(x, y) ∧ perm(y, z) → perm(x, z), subst:[y, x, z] → [ar2, ar0, ar1], <all paths>

Additional information

Used terms: ar2, ar0, ar1

Proof step 64 from proof permut-correct (previous step) (back to tree)

⊦ perm(x, y) ∧ perm(y, z) → perm(x, z)

A spec-lemma

Proof step 65 from proof permut-correct (previous step) (back to tree)

listofar.toSet = allPerms(ar1), allPerms(ar1) ≠ allPerms(ar0), max(ar1), ordered≤(ar2), ordered≤(listofar), perm(ar0, ar2), perm(ar1, ar2), ¬ dups(listofar), ¬ perm(ar0, ar1) ⊦ perm(ar0, ar2) ∧ perm(ar2, ar1)

Heuristic simplifier applied rule simplifier

And obtained the following new goals

Rule argument

Additional information

Proof step 66 from proof permut-correct (previous step) (back to tree)

listofar.toSet = allPerms(ar1), allPerms(ar1) ≠ allPerms(ar0), max(ar1), ordered≤(listofar), ordered≤(ar2), perm(ar1, ar2), perm(ar0, ar2), ¬ dups(listofar), ¬ perm(ar0, ar1), ¬ perm(ar2, ar1) ⊦

User applied rule apply rewrite lemma

And obtained the following new goals

Rule argument

spec: list-perm[natarray-oarray-sort], name:sym, seq: ⊦ perm(x, y) ↔ perm(y, x), subst:[x, y] → [ar2, ar1], <all paths>

Additional information

Used terms: ar2, ar1

Proof step 67 from proof permut-correct (previous step) (back to tree)

⊦ perm(x, y) ↔ perm(y, x)

A spec-lemma

Proof Tree for permut-correct (View conclusion)

The following image shows the proof tree of sequent calculus. The proved goal is at the bottom. You can click on the nodes to view additional rules. See here for details on colors in a proof tree.

the proof tree