Skip to content
Snippets Groups Projects
Commit 5fb6c7d6 authored by Ali Sinan Köksal's avatar Ali Sinan Köksal
Browse files

inductive proof for size of append.

parent c8bd0066
Branches
Tags
No related merge requests found
......@@ -72,6 +72,10 @@ object ListWithSize {
case Cons(x,xs) => sizeAppend(xs, l2)
}) ensuring(res => res && size(append(l1,l2)) == size(l1) + size(l2))
@induct
def sizeAppendInductive(l1 : List, l2 : List) : Boolean =
(size(append(l1, l2)) == size(l1) + size(l2)) holds
// proved with unrolling=4
def concat(l1: List, l2: List) : List = concat0(l1, l2, Nil())
// ensuring(content(_) == content(l1) ++ content(l2))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment