## VerifyThis @ FM 2012, problem 1

Longest Repeated Substring

Authors: Claude Marché / François Bobot

Tools: Why3

References: VerifyThis @ FM2012

see also the index (by topic, by tool, by reference, by year)

# VerifyThis@fm2012 competition, Challenge 1: Longest Repeated Substring

The following is the original description of the verification task, reproduced verbatim. A reference implementation in Java (based on code by Robert Sedgewick and Kevin Wayne) was also given. The Why3 implementation below follows the Java implementation as faithfully as possible.

```Longest Common Prefix (LCP) - 45 minutes

-----------------

Longest Common Prefix (LCP) is an algorithm used for text querying. In
the following, we model text as an integer array. You may use other
representations (e.g., Java Strings), if your system supports them.

LCP can be implemented with the pseudocode given below. Formalize and
verify the following informal specification for LCP.

Input:  an integer array a, and two indices x and y into this array
Output: length of the longest common prefix of the subarrays of a
starting at x and y respectively.

Pseudocode:

int lcp(int[] a, int x, int y) {
int l = 0;
while (x+l<a.length && y+l<a.length && a[x+l]==a[y+l]) {
l++;
}
return l;
}

========

BACKGROUND
----------

Together with a suffix array, LCP can be used to solve interesting text
problems, such as finding the longest repeated substring (LRS) in a text.

A suffix array (for a given text) is an array of all suffixes of the
text. For the text [7,8,8,6], the suffix array is
[[7,8,8,6],
[8,8,6],
[8,6],
[6]]

Typically, the suffixes are not stored explicitly as above but
represented as pointers into the original text. The suffixes in a suffix
array  are sorted in lexicographical order. This way, occurrences of
repeated substrings in the original text are neighbors in the suffix
array.

For the above, example (assuming pointers are 0-based integers), the
sorted suffix array is:

[3,0,2,1]

-----------------

The attached Java code contains an implementation of a suffix array
(SuffixArray.java), consisting essentially of a lexicographical
comparison on arrays, a sorting routine, and LCP.

The client code (LRS.java) uses these to solve the LRS problem. Verify
that it does so correctly.
```

## First module: longest common prefix

it corresponds to the basic part of the challenge

```module LCP

use export int.Int
use import array.Array

```

`is_common_prefix a x y l` is true when the prefixes of length `l` at respective positions `x` and `y` in array `a` are identical. In other words, the array parts a`x..x+l-1` and a`y..y+l-1` are equal

```predicate is_common_prefix (a:array int) (x y l:int) =
0 <= l /\ x+l <= a.length /\ y+l <= a.length /\
(forall i:int. 0 <= i < l -> a[x+i] = a[y+i])

```

This lemma helps for the proof of `lcp` (but is not mandatory) and is needed later (for `le_trans`)

```lemma not_common_prefix_if_last_char_are_different:
forall a:array int, x y:int, l:int.
0 <= l /\ x+l < a.length /\ y+l < a.length /\ a[x+l] <> a[y+l] ->
not is_common_prefix a x y (l+1)

```

`is_longest_common_prefix a x y l` is true when `l` is the maximal length such that prefixes at positions `x` and `y` in array `a` are identical.

```predicate is_longest_common_prefix (a:array int) (x y l:int) =
is_common_prefix a x y l /\
forall m:int. l < m -> not (is_common_prefix a x y m)

```

This lemma helps to proving `lcp` (but again is not mandatory), and is needed for proving `lcp_sym` and `le_trans` lemmas, and the post-condition of `compare` function in the "absurd" case

```lemma longest_common_prefix_succ:
forall a:array int, x y l:int.
is_common_prefix a x y l /\ not (is_common_prefix a x y (l+1)) ->
is_longest_common_prefix a x y l

use export ref.Refint

```

the first function, that computes the longest common prefix

```let lcp (a:array int) (x y:int) : int
requires { 0 <= x <= a.length }
requires { 0 <= y <= a.length }
ensures { is_longest_common_prefix a x y result }
= let n = a.length in
let l = ref 0 in
while x + !l < n && y + !l < n && a[x + !l] = a[y + !l] do
invariant { is_common_prefix a x y !l }
variant { n - !l }
incr l
done;
!l

end

module LCP_test

```

test harness for lcp

```use import array.Array
use import LCP

(*
let test () =
let arr = Array.make 4 0 in
arr[0]<-1; arr[1]<-2; arr[2]<-2; arr[3]<-5;
let x = lcp arr 1 2 in
assert { is_common_prefix arr 1 2 1};
assert { not is_common_prefix arr 1 2 2};
check { x = 1 };
(* int[] brr = {1,2,3,5}; *)
let brr = Array.make 4 0 in
brr[0]<-1; brr[1]<-2; brr[2]<-3; brr[3]<-5;
let x = lcp brr 1 2 in
assert { is_common_prefix brr 1 2 0};
assert { not is_common_prefix brr 1 2 1};
check { x = 0 };
(* int[] crr = {1,2,3,5}; *)
let crr = Array.make 4 0 in
crr[0]<-1; crr[1]<-2; crr[2]<-3; crr[3]<-5;
let x = lcp crr 2 3 in
assert { is_common_prefix crr 2 3 0};
assert { not is_common_prefix crr 2 3 1};
check { x = 0 };
(* int[] drr = {1,2,3,3}; *)
let drr = Array.make 4 0 in
drr[0]<-1; drr[1]<-2; drr[2]<-3; drr[3]<-3;
let x = lcp drr 2 3 in
assert { is_common_prefix drr 2 3 1};
assert { not is_common_prefix drr 2 3 2};
check {x = 1}
*)

exception BenchFailure

let bench () raises { BenchFailure -> true } =
let arr = Array.make 4 0 in
arr[0]<-1; arr[1]<-2; arr[2]<-2; arr[3]<-5;
let x = lcp arr 1 2 in
if x <> 1 then raise BenchFailure;
x

end

```

## Second module: sorting suffixes

```module SuffixSort

use import int.Int
use import ref.Refint
use import array.Array
use LCP

```

order by prefix

```  predicate lt (a : array int) (x y:int) =
let n = a.length in
0 <= x <= n /\ 0 <= y <= n /\
exists l:int. LCP.is_common_prefix a x y l /\
(y+l < n /\ (x+l = n \/ a[x+l] < a[y+l]))

```

comparison function, that decides the order of prefixes

```let compare (a:array int) (x y:int) : int
requires { 0 <= x <= a.length }
requires { 0 <= y <= a.length }
ensures { result = 0 -> x = y }
ensures { result < 0 -> lt a x y }
ensures { result > 0 -> lt a y x }
=
if x = y then 0 else
let n = a.length in
let l = LCP.lcp a x y in
if x + l = n then -1 else
if y + l = n then 1 else
if a[x + l] < a[y + l] then -1 else
if a[x + l] > a[y + l] then 1 else
absurd

use map.MapInjection
```

`range a` is true when for each `i`, `a[i]` is between `0` at `a.length-1`

```  predicate range (a:array int) = MapInjection.range a.elts a.length

```

for the `permut` predicate (permutation of elements)

```  use array.ArrayPermut

predicate le (a : array int) (x y:int) = x = y \/ lt a x y

(* needed for le_trans (for cases x = y /\ le y z and le x y /\ y = z) *)
lemma lcp_same_index :
forall a:array int, x:int.
0 <= x <= a.length -> LCP.is_longest_common_prefix a x x (a.length - x)

lemma le_trans : forall a:array int, x y z:int.
le a x y /\ le a y z -> le a x z

```

spec of sorted in increasing prefix order

```  use map.Map

predicate sorted_sub (a:array int) (data:Map.map int int) (l u:int) =
forall i1 i2 : int. l <= i1 <= i2 < u ->
le a (Map.get data i1) (Map.get data i2)

predicate sorted (a : array int) (data:array int) =
sorted_sub a data.elts 0 data.length

let sort (a:array int) (data : array int)
requires { data.length = a.length }
requires { range data }
ensures { sorted a data }
ensures { ArrayPermut.permut_all (old data) data }
=
'Init:
for i = 0 to data.length - 1 do
invariant { ArrayPermut.permut_all (at data 'Init) data   }
invariant { sorted_sub a data.elts 0 i  }
invariant { range data }
let j = ref i in
while !j > 0 && compare a data[!j-1] data[!j] > 0 do
invariant { 0 <= !j <= i }
invariant { range data }
invariant { ArrayPermut.permut_all (at data 'Init) data   }
invariant { sorted_sub a data.elts 0 !j }
invariant { sorted_sub a data.elts !j (i+1) }
invariant { forall k1 k2:int. 0 <= k1 < !j /\ !j+1 <= k2 <= i ->
le a data[k1] data[k2] }
variant { !j }
'L:
let b = !j - 1 in
let t = data[!j] in
data[!j] <- data[b];
data[b] <- t;
assert { ArrayPermut.exchange (at data 'L) data (!j-1) !j };
decr j
done;
(* needed to prove the invariant [sorted_sub a data.elts 0 i] *)
assert { !j > 0 -> le a data[!j-1] data[!j] }
done

end

module SuffixSort_test

use import int.Int
use import array.Array
use LCP
use SuffixSort

exception BenchFailure

let bench () raises { BenchFailure -> true } =
let arr = Array.make 4 0 in
(* [7,8,8,6] *)
arr[0]<-7; arr[1]<-8; arr[2]<-8; arr[3]<-6;
let suf = Array.make 4 0 in
for i = 0 to 3 do
invariant { forall j:int. 0 <= j < i -> suf[j] = j }
suf[i] <- i
done;
SuffixSort.sort arr suf;
(* should be [3,0,2,1] *)
if suf[0] <> 3 then raise BenchFailure;
if suf[1] <> 0 then raise BenchFailure;
if suf[2] <> 2 then raise BenchFailure;
if suf[3] <> 1 then raise BenchFailure;
suf

end

```

## Third module: Suffix Array Data Structure

```module SuffixArray

use import int.Int
use import array.Array
use LCP
use SuffixSort
use map.Map
use map.MapInjection

predicate permutation (m:Map.map int int) (u : int) =
MapInjection.range m u /\ MapInjection.injective m u

type suffixArray = {
values : array int;
suffixes : array int;
}
invariant { self.values.length = self.suffixes.length /\
permutation self.suffixes.elts self.suffixes.length /\
SuffixSort.sorted self.values self.suffixes }

let select (s:suffixArray) (i:int) : int
requires { 0 <= i < s.values.length }
ensures { result = s.suffixes[i] }
= s.suffixes[i]

use array.ArrayPermut

```

needed to establish invariant in function `create`

```lemma permut_permutation : forall a1 a2:array int.
ArrayPermut.permut_all a1 a2 /\ permutation a1.elts a1.length ->
permutation a2.elts a2.length

```

constructor of suffixArray structure

```let create (a:array int) : suffixArray
ensures { result.values = a }
= let n = a.length in
let suf = Array.make n 0 in
for i = 0 to n-1 do
invariant { forall j:int. 0 <= j < i -> suf[j] = j }
suf[i] <- i done;
SuffixSort.sort a suf;
{ values = a; suffixes = suf }

let lcp (s:suffixArray) (i:int) : int
requires { 0 < i < s.values.length }
ensures { LCP.is_longest_common_prefix s.values
s.suffixes[i-1] s.suffixes[i] result }
= LCP.lcp s.values s.suffixes[i] s.suffixes[i-1]

end

module SuffixArray_test

use import array.Array
use import SuffixArray

(*
let test () =
let arr = Array.make 4 0 in
arr[0]<-1; arr[1]<-2; arr[2]<-2; arr[3]<-5;
let sa = create arr in
assert { sa.suffixes[0] = 0 };
assert { sa.suffixes[1] = 1 };
assert { sa.suffixes[2] = 2 };
assert { sa.suffixes[3] = 3 };
let x = lcp sa 1 in
check {x = 0};
(* int[] brr = {1,2,3,5}; *)
let brr = Array.make 4 0 in
brr[0]<-1; brr[1]<-2; brr[2]<-3; brr[3]<-5;
let sa = create brr in
let x = lcp sa 1 in
check {x = 0 (* TODO *)};
(* int[] crr = {1,2,3,5}; *)
let crr = Array.make 4 0 in
crr[0]<-1; crr[1]<-2; crr[2]<-3; crr[3]<-5;
let sa = create crr in
let x = lcp sa 2 in
check {x = 0 (* TODO *)};
(* int[] drr = {1,2,3,3}; *)
let drr = Array.make 4 0 in
drr[0]<-1; drr[1]<-2; drr[2]<-3; drr[3]<-3;
let sa = create drr in
let x = lcp sa 2 in
check {x = 0 (* TODO *)}
*)

exception BenchFailure

let bench () raises { BenchFailure -> true } =
let arr = Array.make 4 0 in
(* [7,8,8,6] *)
arr[0]<-7; arr[1]<-8; arr[2]<-8; arr[3]<-6;
let sa = create arr in
if sa.suffixes[0] <> 3 then raise BenchFailure;
if sa.suffixes[1] <> 0 then raise BenchFailure;
if sa.suffixes[2] <> 2 then raise BenchFailure;
if sa.suffixes[3] <> 1 then raise BenchFailure;
sa

end

```

## Fourth module: Longest Repeated Substring

```module LRS

use import int.Int
use import ref.Ref
use import array.Array
use map.MapInjection
use LCP
use SuffixSort
use SuffixArray

```

additional properties relating `le` and `longest_common_prefix`

```(* needed for [lrs] function, last before last assert *)
lemma lcp_sym :
forall a:array int, x y l:int.
0 <= x <= a.length /\ 0 <= y <= a.length ->
LCP.is_longest_common_prefix a x y l ->
LCP.is_longest_common_prefix a y x l

```

allows CVC to prove the next lemma

```lemma le_le_common_prefix:
forall a:array int, x y z l:int.
SuffixSort.le a x y /\ SuffixSort.le a y z ->
LCP.is_common_prefix a x z l -> LCP.is_common_prefix a y z l

```

proved by Alt-Ergo and CVC. But only by Alt-Ergo if previous lemma is removed

```  lemma le_le_longest_common_prefix:
forall a:array int, x y z l m :int.
SuffixSort.le a x y /\ SuffixSort.le a y z ->
LCP.is_longest_common_prefix a x z l /\
LCP.is_longest_common_prefix a y z m
-> l <= m

val solStart : ref int
val solLength : ref int
val ghost solStart2 : ref int

let lrs (a:array int) : unit
requires { a.length > 0 }
ensures { 0 <= !solLength <= a.length }
ensures { 0 <= !solStart <= a.length }
ensures { 0 <= !solStart2 <= a.length /\ !solStart <> !solStart2 /\
LCP.is_longest_common_prefix a !solStart !solStart2 !solLength }
ensures { forall x y l:int.
0 <= x < y < a.length /\
LCP.is_longest_common_prefix a x y l ->
!solLength >= l }
=
let sa = SuffixArray.create a in
solStart := 0;
solLength := 0;
solStart2 := a.length;
for i=1 to a.length - 1 do
invariant { 0 <= !solLength <= a.length }
invariant { 0 <= !solStart <= a.length }
invariant {
0 <= !solStart2 <= a.length /\ !solStart <> !solStart2 /\
LCP.is_longest_common_prefix a !solStart !solStart2 !solLength }
invariant { forall j k l:int.
0 <= j < k < i /\
LCP.is_longest_common_prefix a
sa.SuffixArray.suffixes[j] sa.SuffixArray.suffixes[k] l ->
!solLength >= l }
let l = SuffixArray.lcp sa i in
if l > !solLength then begin
solStart := SuffixArray.select sa i;
solStart2 := SuffixArray.select sa (i-1);
solLength := l
end
done;
```

the following assert needs `lcp_sym` lemma

```    assert { forall j k l:int.
0 <= j < a.length /\ 0 <= k < a.length /\ j <> k /\
LCP.is_longest_common_prefix a
sa.SuffixArray.suffixes[j] sa.SuffixArray.suffixes[k] l ->
!solLength >= l};
(* we state explicitly that sa.suffixes is surjective *)
assert { forall x y:int.
0 <= x < y < a.length ->
exists j k : int.
0 <= j < a.length /\ 0 <= k < a.length /\ j <> k /\
x = sa.SuffixArray.suffixes[j] /\
y = sa.SuffixArray.suffixes[k] };
()

end

module LRS_test

use import array.Array
use import ref.Ref
use import LRS

exception BenchFailure

let bench () raises { BenchFailure -> true } =
let arr = Array.make 4 0 in
(* [7,8,8,6] *)
arr[0]<-7; arr[1]<-8; arr[2]<-8; arr[3]<-6;
lrs arr;
if !solStart <> 1 then raise BenchFailure;
if !solLength <> 1 then raise BenchFailure;
(!solStart, !solLength)

end
```

# Why3 Proof Results for Project "verifythis_fm2012_LRS"

## Theory "verifythis_fm2012_LRS.LCP": fully verified in 0.10 s

 Obligations Alt-Ergo (0.99.1) CVC3 (2.4.1) CVC4 (1.4) Eprover (1.8-001) Vampire (0.6) Z3 (4.3.2) not_common_prefix_if_last_char_are_different 0.01 --- --- --- --- 0.01 longest_common_prefix_succ 0.02 --- --- --- --- 0.06 3. VC for lcp --- --- --- --- --- --- split_goal_wp 1. loop invariant init 0.02 0.02 0.02 --- --- 0.02 2. index in array bounds 0.02 0.03 0.01 0.02 0.02 0.02 3. index in array bounds 0.02 0.03 0.00 0.02 0.02 0.02 4. loop invariant preservation 0.01 --- --- --- --- --- 5. loop variant decrease 0.02 0.02 0.02 0.54 1.16 0.01 6. postcondition 0.01 --- --- --- --- --- 7. postcondition 0.02 0.02 0.01 0.06 1.03 --- 8. postcondition 0.03 0.02 0.00 0.11 0.95 ---

## Theory "verifythis_fm2012_LRS.LCP_test": fully verified in 0.02 s

 Obligations Alt-Ergo (0.99.1) 1. VC for bench 0.02

## Theory "verifythis_fm2012_LRS.SuffixSort": fully verified in 0.15 s

 Obligations Alt-Ergo (0.99.1) CVC3 (2.4.1) CVC4 (1.4) Eprover (1.8-001) Vampire (0.6) Z3 (4.3.2) 1. VC for compare --- --- --- --- --- --- split_goal_wp 1. postcondition 0.01 0.00 0.00 0.00 0.00 0.00 2. postcondition 0.01 0.02 0.00 --- --- 0.00 3. postcondition 0.02 0.00 0.00 --- --- 0.00 4. precondition 0.02 0.02 0.00 0.00 0.00 0.02 5. precondition 0.02 0.01 0.00 0.00 0.00 0.02 6. postcondition 0.00 0.01 0.00 0.00 0.00 0.00 7. postcondition 0.02 0.02 0.02 0.20 --- --- 8. postcondition 0.02 0.01 0.00 0.01 0.05 0.00 9. postcondition 0.01 0.02 0.00 0.00 0.00 0.00 10. postcondition 0.02 0.01 0.00 0.03 0.02 0.00 11. postcondition 0.02 --- --- --- --- --- 12. index in array bounds 0.01 0.02 0.01 0.03 --- 0.02 13. index in array bounds 0.02 0.02 0.00 0.02 --- 0.02 14. postcondition 0.00 0.02 0.00 0.00 0.01 0.00 15. postcondition 0.00 0.03 0.02 --- --- --- 16. postcondition 0.01 0.02 0.00 0.04 0.02 0.00 17. index in array bounds 0.02 0.02 0.00 0.00 0.00 0.00 18. index in array bounds 0.02 0.01 0.01 0.00 0.00 0.00 19. postcondition 0.01 0.00 0.00 0.00 0.00 0.00 20. postcondition 0.02 0.01 0.01 0.03 0.02 0.00 21. postcondition 0.02 --- --- --- --- --- 22. unreachable point 0.02 --- --- --- --- --- lcp_same_index 0.01 0.01 0.02 --- --- 0.01 le_trans 0.10 --- --- --- --- --- 4. VC for sort --- --- --- --- --- --- split_goal_wp 1. postcondition 0.01 0.01 0.02 --- --- 0.02 2. postcondition 0.01 0.02 0.02 0.31 0.34 0.03 3. loop invariant init 0.01 0.02 0.02 0.46 0.34 0.02 4. loop invariant init 0.01 0.02 0.02 --- --- 0.03 5. loop invariant init 0.01 0.00 0.01 0.01 0.01 0.02 6. loop invariant init 0.01 0.02 0.02 0.01 0.01 0.02 7. loop invariant init 0.01 0.01 0.02 0.01 0.01 0.04 8. loop invariant init 0.01 0.01 0.02 0.08 0.04 0.03 9. loop invariant init 0.01 0.01 0.02 0.01 0.00 --- 10. loop invariant init 0.02 0.02 --- --- --- --- 11. loop invariant init 0.01 0.01 0.01 0.13 0.12 0.05 12. type invariant 0.02 0.02 0.02 0.01 0.00 0.02 13. index in array bounds 0.01 0.02 0.02 --- 1.04 0.04 14. index in array bounds 0.00 0.02 0.02 --- --- 0.03 15. precondition 0.02 0.02 0.03 --- 0.22 0.06 16. precondition 0.02 0.02 0.02 0.37 0.21 0.05 17. index in array bounds 0.01 0.02 0.02 0.01 0.00 0.03 18. index in array bounds 0.01 0.02 0.02 0.01 0.01 0.00 19. index in array bounds 0.02 0.02 0.02 0.02 0.01 0.04 20. index in array bounds 0.02 0.02 0.02 0.01 0.01 0.03 21. assertion 0.04 --- --- --- --- --- 22. loop invariant preservation 0.02 0.03 0.02 0.03 0.22 0.04 23. loop invariant preservation --- 0.05 --- --- --- 0.81 inline_goal 1. loop invariant preservation 0.42 --- --- --- --- --- 24. loop invariant preservation 2.00 0.13 0.16 --- --- --- 25. loop invariant preservation --- 0.05 0.39 --- --- --- 26. loop invariant preservation --- --- --- --- --- 0.37 27. loop invariant preservation --- 0.05 --- --- --- --- 28. loop variant decrease 0.01 --- 0.04 0.03 0.15 --- 29. assertion 0.02 0.03 0.02 0.12 0.02 --- 30. loop invariant preservation 0.02 0.02 0.02 0.01 0.01 0.04 31. loop invariant preservation 0.16 --- 0.21 --- --- --- 32. loop invariant preservation 0.02 0.02 0.02 0.01 0.01 0.07 33. assertion 0.02 0.02 0.02 0.01 0.01 0.00 34. loop invariant preservation 0.02 0.02 0.02 0.01 0.00 0.04 35. loop invariant preservation 0.00 0.02 0.02 0.08 0.03 --- 36. loop invariant preservation 0.01 0.02 0.02 0.01 0.00 0.06 37. type invariant 0.01 0.01 0.01 0.01 0.00 0.02 38. postcondition 0.01 0.02 0.02 0.13 0.00 --- 39. postcondition 0.01 0.02 0.02 0.07 0.03 0.03

## Theory "verifythis_fm2012_LRS.SuffixSort_test": fully verified in 0.16 s

 Obligations Alt-Ergo (0.99.1) 1. VC for bench 0.16

## Theory "verifythis_fm2012_LRS.SuffixArray": fully verified in 1.22 s

 Obligations Alt-Ergo (0.99.1) CVC3 (2.4.1) CVC4 (1.4) Coq (8.6.1) Eprover (1.8-001) Vampire (0.6) Z3 (4.3.2) 1. VC for select 0.01 0.01 0.03 --- 0.01 0.01 0.03 permut_permutation --- --- --- 1.12 --- --- --- 3. VC for create --- --- --- --- --- --- --- split_goal_wp 1. array creation size 0.01 0.01 0.02 --- 0.01 0.01 0.00 2. precondition 0.01 0.01 0.02 --- 0.01 0.01 0.00 3. precondition 0.01 0.02 0.03 --- 0.04 0.20 0.03 4. type invariant 0.01 0.05 0.02 --- --- --- 0.05 5. loop invariant init 0.01 0.02 0.03 --- 0.08 0.04 0.00 6. type invariant 0.01 0.01 0.03 --- 0.00 0.00 0.02 7. index in array bounds 0.00 0.01 0.03 --- 0.71 0.52 0.02 8. loop invariant preservation 0.01 0.02 0.05 --- --- --- 0.03 9. type invariant 0.02 0.01 0.04 --- 0.00 0.00 0.02 10. precondition 0.01 0.05 0.02 --- 0.01 0.01 0.00 11. precondition 0.01 0.02 0.04 --- --- 0.24 0.03 12. type invariant 0.08 0.10 0.06 --- --- 3.51 --- 4. VC for lcp --- --- --- --- --- --- --- split_goal_wp 1. index in array bounds 0.01 0.03 0.03 --- --- --- 0.03 2. index in array bounds 0.01 0.01 0.03 --- --- --- 0.03 3. precondition 0.01 0.05 0.02 --- --- 3.00 0.06 4. precondition 0.02 0.04 0.02 --- --- --- 0.06 5. postcondition 0.03 --- 0.02 --- --- --- ---

## Theory "verifythis_fm2012_LRS.SuffixArray_test": fully verified in 0.02 s

 Obligations Alt-Ergo (0.99.1) 1. VC for bench 0.02

## Theory "verifythis_fm2012_LRS.LRS": fully verified in 0.51 s

 Obligations Alt-Ergo (0.99.1) CVC3 (2.4.1) CVC4 (1.4) Coq (8.6.1) Eprover (1.8-001) Vampire (0.6) Z3 (4.3.2) lcp_sym 0.01 --- 0.02 --- --- --- --- le_le_common_prefix 0.10 --- --- --- --- --- --- le_le_longest_common_prefix 0.19 0.06 0.11 --- 0.02 --- --- 4. VC for lrs --- --- --- --- --- --- --- split_goal_wp 1. assertion 0.02 0.02 0.03 --- --- --- 0.04 2. assertion 0.02 0.02 0.03 --- --- --- 0.05 3. postcondition 0.02 0.02 0.03 --- 0.02 0.01 0.04 4. postcondition 0.02 0.04 0.03 --- 0.01 0.01 0.08 5. postcondition 0.03 0.03 0.08 --- --- --- 0.04 6. postcondition 0.03 0.03 0.03 --- --- --- 0.05 7. loop invariant init 0.01 0.03 0.03 --- 0.01 0.01 0.08 8. loop invariant init 0.02 0.02 0.03 --- 0.01 0.01 0.04 9. loop invariant init 0.02 0.02 0.07 --- --- --- 0.04 10. loop invariant init 0.02 0.03 0.03 --- --- --- 0.05 11. precondition 0.01 0.02 0.04 --- 0.49 2.93 0.04 12. precondition 0.02 0.02 0.03 --- 0.09 0.01 0.04 13. precondition 0.02 0.04 0.06 --- --- --- 0.04 14. loop invariant preservation 0.02 0.16 0.04 --- 0.31 3.25 0.05 15. loop invariant preservation 0.03 0.17 0.03 --- 0.22 3.34 0.05 16. loop invariant preservation 0.16 0.18 0.03 --- --- --- --- 17. loop invariant preservation --- 3.69 --- --- --- --- --- 18. loop invariant preservation 0.00 0.04 0.03 --- 0.08 0.01 0.08 19. loop invariant preservation 0.01 0.02 0.03 --- 0.08 0.01 0.05 20. loop invariant preservation 0.03 0.02 0.03 --- 0.01 0.05 --- 21. loop invariant preservation --- 2.15 0.04 --- --- --- --- 22. assertion 0.03 0.15 0.05 --- 1.10 --- --- 23. assertion --- --- --- 0.88 --- --- --- 24. postcondition 0.01 0.02 0.03 --- 0.10 0.01 0.05 25. postcondition 0.01 0.04 0.03 --- 0.10 0.00 0.08 26. postcondition 0.02 0.05 0.03 --- 0.01 0.05 --- 27. postcondition --- --- --- 0.69 --- --- ---

## Theory "verifythis_fm2012_LRS.LRS_test": fully verified in 0.01 s

 Obligations Alt-Ergo (0.99.1) 1. VC for bench 0.01