| hd0 ≠ null ⊦ h(hd0) = mknode(cur, a, null) → ( (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ↔ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd, lst, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b) + a ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, hd0) * hd0 => mknode(cur, a, null) * hP)(h)) )) |
h(hd0) = mknode(cur, a, null), hd0 ≠ null ⊦ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ↔ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd, lst, prv, null, x) * hP)(h) ;hd0 = lst0 ∧ (∃ y, b. x = (y + b) + a ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, hd0) * hd0 => mknode(cur, a, null) * hP)(h)) )
| h(hd0) = mknode(cur, a, null), hd0 ≠ null ⊦ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ↔ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd, lst, prv, null, x) * hP)(h) ;hd0 = lst0 ∧ (∃ y, b. x = (y + b) + a ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, hd0) * hd0 => mknode(cur, a, null) * hP)(h)) ) |
h(hd0) = mknode(cur, a, null), hd0 ≠ null ⊦ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ↔ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) )
Used simplifier rules: ⊦ x + a = x + a '; (s)
| h(hd0) = mknode(cur, a, null), hd0 ≠ null ⊦ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ↔ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) ) |
h(hd0) = mknode(cur, a, null), hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) )
h(hd0) = mknode(cur, a, null), hd0 ≠ null, x ≠ [], ¬ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h), (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ;hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) ) ⊦
| h(hd0) = mknode(cur, a, null), hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ x ≠ [] ∧ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) ) |
h(hd0) = mknode(cur, a, null), x = [], hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦
h(hd0) = mknode(cur, a, null), hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) )
| h(hd0) = mknode(cur, a, null), x = [], hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ |
h(hd0) = mknode(cur, a, null), hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, []) * hP)(h) ⊦
| h(hd0) = mknode(cur, a, null), hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, []) * hP)(h) ⊦ |
Used simplifier rules: dll-trav-null: ⊦ (dll-trav(prv, hd, lst, null, hd0, lst0, nxt, x) * hP)(h) ↔ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd, lst, prv, nxt, x) * hP)(h); dlls-last-base: ⊦ dlls(hd, lst, prv, nxt, []) = (emp ∧ ⌜hd = nxt⌝ ∧ ⌜lst = prv⌝ ); ll-trav-nonnull: ⊦ cur ≠ null → ( (dll-trav(prv, hd, lst, cur, hd0, lst0, nxt, x) * hP)(h) ↔ (∃ x0, x1, a. x = x0 + (a + x1) ∧ ( dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a, hd0) * dlls(hd0, lst0, cur, nxt, x1) * hP )(h))); ⊦ a + x = a ' + x; (s) ⊦ x + y = [] ↔ x = [] ∧ y = []; (s) ⊦ a ' ≠ []; (s) a: ⊦ (x + y) + z = x + y + z; from specification list sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep ⊦ ⌜false⌝ = false; (s) ⊦ (false ∧ hP) = false; (s) and-ass: ⊦ ((hP0 ∧ hP1) ∧ hP2) = (hP0 ∧ hP1 ∧ hP2); from specification heap-sep and-com: ⊦ (hP0 ∧ hP1) = (hP1 ∧ hP0); from specification heap-sep ⊦ false * hP = false; (s) ⊦ ¬ false(h); (s) Used formulas: cur = null
| h(hd0) = mknode(cur, a, null), hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ; hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) ) |
h(hd0) = mknode(cur, a, null), cur ≠ null, hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h))
Used simplifier rules: dll-trav-null: ⊦ (dll-trav(prv, hd, lst, null, hd0, lst0, nxt, x) * hP)(h) ↔ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd, lst, prv, nxt, x) * hP)(h); sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep
| h(hd0) = mknode(cur, a, null), cur ≠ null, hd0 ≠ null, (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) |
h(hd0) = mknode(cur, a, null), cur ≠ null, hd0 ≠ null, (dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a0, hd0) * dlls(hd0, lst0, cur, null, x1) * hP)(h) ⊦ hd0 = lst0 ∧ (∃ y, b. x0 + a0 ' + x1 = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h))
Used simplifier rules: ll-trav-nonnull: ⊦ cur ≠ null → ( (dll-trav(prv, hd, lst, cur, hd0, lst0, nxt, x) * hP)(h) ↔ (∃ x0, x1, a. x = x0 + (a + x1) ∧ ( dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a, hd0) * dlls(hd0, lst0, cur, nxt, x1) * hP )(h))); sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ a + x = a ' + x; (s)
| h(hd0) = mknode(cur, a, null), cur ≠ null, hd0 ≠ null, (dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a0, hd0) * dlls(hd0, lst0, cur, null, x1) * hP)(h) ⊦ hd0 = lst0 ∧ (∃ y, b. x0 + a0 ' + x1 = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) |
h(hd0) = mknode(cur, a, null), x1 = a1 + x, cur ≠ null, hd0 ≠ null, (dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a0, hd0) * dlls(hd0, lst0, cur, null, x1) * hP)(h) ⊦ hd0 = lst0 ∧ (∃ y, b. x0 + a0 ' + x1 = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h))
Used simplifier rules: dlls-last-base: ⊦ dlls(hd, lst, prv, nxt, []) = (emp ∧ ⌜hd = nxt⌝ ∧ ⌜lst = prv⌝ ); List[A] freely generated by [], +; ⊦ ⌜false⌝ = false; (s) ⊦ (false ∧ hP) = false; (s) and-ass: ⊦ ((hP0 ∧ hP1) ∧ hP2) = (hP0 ∧ hP1 ∧ hP2); from specification heap-sep and-com: ⊦ (hP0 ∧ hP1) = (hP1 ∧ hP0); from specification heap-sep ⊦ false * hP = false; (s) sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep ⊦ ¬ false(h); (s)
| h(hd0) = mknode(cur, a, null), x1 = a1 + x, cur ≠ null, hd0 ≠ null, (dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a0, hd0) * dlls(hd0, lst0, cur, null, x1) * hP)(h) ⊦ hd0 = lst0 ∧ (∃ y, b. x0 + a0 ' + x1 = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) |
cur ≠ null, hd0 ≠ null, (((hd0 => mknode(cur, a, null) * dlls(hd, lst, prv, cur, x0)) * cur => mknode(lst, a0, hd0)) * hP)(h) ⊦ ∃ y, b. x0 + a0 ' = y + b ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, hd0) * hd0 => mknode(cur, a, null) * hP)(h)
Used simplifier rules: dlls-last-rec: ⊦ dlls(hd, lst, prv, nxt, a ' + x) = _∃(λ nxt0. hd => mknode(prv, a, nxt0) * dlls(nxt0, lst, hd, nxt, x)); dlls-last-head-null: ⊦ dlls(null, lst, prv, nxt, x) = (emp ∧ ⌜nxt = null⌝ ∧ ⌜lst = prv⌝ ∧ ⌜x = []⌝ ); a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ # y = # y0 → (x + y = z + y0 ↔ x = z ∧ y = y0); (ws) ⊦ x + [] = x; (s) and-com: ⊦ (hP0 ∧ hP1) = (hP1 ∧ hP0); from specification heap-sep and-ass: ⊦ ((hP0 ∧ hP1) ∧ hP2) = (hP0 ∧ hP1 ∧ hP2); from specification heap-sep ⊦ ⌜bv⌝ (h) ↔ bv; (s) ⊦ (hP0 ∧ hP1)(h) ↔ hP0(h) ∧ hP1(h); (s) sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep ⊦ (⌜bv⌝ ∧ hP0) * hP1 = (⌜bv⌝ ∧ hP0 * hP1); (s) ⊦ emp * hP = hP; (s) ⊦ (true ∧ hP) = hP; (s) ⊦ ⌜true⌝ = true; (s) ⊦ a + x = a ' + x; (s) ⊦ mknode(left, val, left0) = mknode(left1, val0, left2) ↔ left = left1 ∧ val = val0 ∧ left0 = left2; (ws) ⊦ (r => o0 * hP)(h) → h(r) = o0; (s) ⊦ (_∃ bP * hP)(h) ↔ (∃ b. (bP(b) * hP)(h)); (s)
| cur ≠ null, hd0 ≠ null, (((hd0 => mknode(cur, a, null) * dlls(hd, lst, prv, cur, x0)) * cur => mknode(lst, a0, hd0)) * hP)(h) ⊦ ∃ y, b. x0 + a0 ' = y + b ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, hd0) * hd0 => mknode(cur, a, null) * hP)(h) |
Used simplifier rules: sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep Used terms: x0, a0
| h(hd0) = mknode(cur, a, null), hd0 ≠ null, x ≠ [], ¬ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h), (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ;hd0 = lst0 ∧ (∃ y, b. x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h)) ) ⊦ |
h(hd0) = mknode(cur, a, null), hd0 ≠ null, x ≠ [], ¬ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h), (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ;hd0 = lst0 ∧ x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h) ) ⊦
| h(hd0) = mknode(cur, a, null), hd0 ≠ null, x ≠ [], ¬ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h), (cur = null ⊃ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd0, lst0, prv, null, x) * hP)(h) ;hd0 = lst0 ∧ x = (y + b ') + a ' ∧ (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h) ) ⊦ |
h(hd0) = mknode(cur, a, null), hd0 = lst0, x = (y + b ') + a ', cur ≠ null, hd0 ≠ null, x ≠ [], (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h), ¬ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦
Used simplifier rules: dll-trav-null: ⊦ (dll-trav(prv, hd, lst, null, hd0, lst0, nxt, x) * hP)(h) ↔ hd = hd0 ∧ lst = lst0 ∧ (dlls(hd, lst, prv, nxt, x) * hP)(h); sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep
| h(hd0) = mknode(cur, a, null), hd0 = lst0, x = (y + b ') + a ', cur ≠ null, hd0 ≠ null, x ≠ [], (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h), ¬ (dll-trav(prv, hd, lst, cur, hd0, lst0, null, x) * hP)(h) ⊦ |
cur ≠ null, lst0 ≠ null, (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h) ⊦ ∃ x0, x1, a0. (y + b ') + a ' = x0 + a0 ' + x1 ∧ (dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a0, lst0) * dlls(lst0, lst0, cur, null, x1) * hP)(h)
Used simplifier rules: ll-trav-nonnull: ⊦ cur ≠ null → ( (dll-trav(prv, hd, lst, cur, hd0, lst0, nxt, x) * hP)(h) ↔ (∃ x0, x1, a. x = x0 + (a + x1) ∧ ( dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a, hd0) * dlls(hd0, lst0, cur, nxt, x1) * hP )(h))); sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ a + x = a ' + x; (s) ⊦ a ' ≠ []; (s) ⊦ x + y = [] ↔ x = [] ∧ y = []; (s) ⊦ mknode(left, val, left0) = mknode(left1, val0, left2) ↔ left = left1 ∧ val = val0 ∧ left0 = left2; (ws) ⊦ (r => o0 * hP)(h) → h(r) = o0; (s)
| cur ≠ null, lst0 ≠ null, (dlls(hd, lst, prv, cur, y) * cur => mknode(lst, b, lst0) * lst0 => mknode(cur, a, null) * hP)(h) ⊦ ∃ x0, x1, a0. (y + b ') + a ' = x0 + a0 ' + x1 ∧ (dlls(hd, lst, prv, cur, x0) * cur => mknode(lst, a0, lst0) * dlls(lst0, lst0, cur, null, x1) * hP)(h) |
Used simplifier rules: dlls-last-one: ⊦ dlls(hd, lst, prv, nxt, a ') = (hd => mknode(prv, a, nxt) ∧ ⌜lst = hd⌝ ); a: ⊦ (x + y) + z = x + y + z; from specification list ⊦ ⌜true⌝ = true; (s) ⊦ (true ∧ hP) = hP; (s) and-ass: ⊦ ((hP0 ∧ hP1) ∧ hP2) = (hP0 ∧ hP1 ∧ hP2); from specification heap-sep and-com: ⊦ (hP0 ∧ hP1) = (hP1 ∧ hP0); from specification heap-sep sep-ass: ⊦ (hP0 * hP1) * hP2 = hP0 * hP1 * hP2; from specification heap-sep sep-com: ⊦ hP0 * hP1 = hP1 * hP0; from specification heap-sep Used terms: y, a ', b
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.