Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
ba8bd4b5
Commit
ba8bd4b5
authored
Jul 01, 2011
by
Andrei Paskevich
Browse files
remove trailing whitespace, tabs, and latin1 characters
parent
37f06a22
Changes
56
Hide whitespace changes
Inline
Side-by-side
ROADMAP
View file @
ba8bd4b5
...
...
@@ -50,7 +50,9 @@
* choisir un logo
=== Roadmap for third release ==========================================
=== Roadmap for third release 0.70 =======================================
* increment the magic number in config (A)
* enlever les caracteres de tab des sources
et les caracteres latin1 (A)
...
...
bench/programs/bad-typing/alias1.mlw
View file @
ba8bd4b5
...
...
@@ -2,7 +2,7 @@ module M
use import module ref.Ref
let foo (x : ref int) (y : ref int) =
let foo (x : ref int) (y : ref int) =
x := 1;
y := 2
...
...
bench/programs/bad-typing/alias2.mlw
View file @
ba8bd4b5
...
...
@@ -2,7 +2,7 @@ module M
use import module ref.Ref
let foo (x : ref int) (y : ref int) =
let foo (x : ref int) (y : ref int) =
x := 1;
y := 2
...
...
bench/programs/bad-typing/alias3.mlw
View file @
ba8bd4b5
...
...
@@ -2,7 +2,7 @@ module M
use import module ref.Ref
let foo (x : ref int) (y : ref int) =
let foo (x : ref int) (y : ref int) =
x := 1;
y := 2
...
...
bench/programs/bad-typing/polyref3.mlw
View file @
ba8bd4b5
module M
use import module stdlib.Ref
use import list.List
val r : ref (list 'a)
end
bench/programs/bad-typing/variant1.mlw
View file @
ba8bd4b5
...
...
@@ -6,7 +6,7 @@ module M
(* missing variant *)
let rec even (x:int) : int variant {x} =
odd (x-1)
odd (x-1)
with odd (x:int) : int =
even (x-1)
...
...
bench/programs/bad-typing/variant2.mlw
View file @
ba8bd4b5
...
...
@@ -2,13 +2,13 @@
(* different relations *)
module M
use import int.Int
predicate rel int int
let rec even (x:int) : int variant {x} with rel =
odd (x-1)
odd (x-1)
with odd (x:int) : int variant {x} =
even (x-1)
...
...
bench/programs/good/complex_arg_1.mlw
View file @
ba8bd4b5
...
...
@@ -21,7 +21,7 @@ let f () =
end
(*
Local Variables:
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/complex_arg_1"
End:
End:
*)
bench/programs/good/complex_arg_2.mlw
View file @
ba8bd4b5
...
...
@@ -19,7 +19,7 @@ let test () =
end
(*
Local Variables:
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/complex_arg_2"
End:
End:
*)
bench/programs/good/for.mlw
View file @
ba8bd4b5
...
...
@@ -85,7 +85,7 @@ let test4d x =
end
(*
Local Variables:
Local Variables:
compile-command: "unset LANG; make -C ../../.. bench/programs/good/for"
End:
End:
*)
examples/programs/arm.mlw
View file @
ba8bd4b5
...
...
@@ -20,14 +20,14 @@ module M
let i = ref 2 in
while !i <= 10 do
invariant { 2 <= !i <= 11 /\ inv a /\
(* ghost *) !loop1 = !i - 2 /\ 2 * !loop2 <= (!i-2) * (!i-1) }
(* ghost *) !loop1 = !i - 2 /\ 2 * !loop2 <= (!i-2) * (!i-1) }
variant { 10 - !i }
(* ghost *) incr loop1;
let j = ref !i in
while a[!j] < a[!j - 1] do
invariant { 1 <= !j <= !i /\ inv a /\
(* ghost *) 2 * !loop2 <= (!i-2) * (!i-1) + 2*(!i - !j) }
variant { !j }
(* ghost *) 2 * !loop2 <= (!i-2) * (!i-1) + 2*(!i - !j) }
variant { !j }
(* ghost *) incr loop2;
let temp = a[!j] in
a[!j] <- a[!j - 1];
...
...
examples/programs/binary_search.mlw
View file @
ba8bd4b5
...
...
@@ -21,7 +21,7 @@ module M
let u = ref (length a - 1) in
while !l <= !u do
invariant {
0 <= !l /\ !u < length a /\
0 <= !l /\ !u < length a /\
forall i : int. 0 <= i < length a -> a[i] = v -> !l <= i <= !u }
variant { !u - !l }
let m = !l + div (!u - !l) 2 in
...
...
examples/programs/binary_search_c.mlw
View file @
ba8bd4b5
...
...
@@ -40,7 +40,7 @@ module M1
while !l <= !u do
invariant { 0 <= !l /\ !u <= n-1 /\
forall k:int. 0 <= k < n -> get !mem t k = v -> !l <= k <= !u }
variant { !u - !l }
variant { !u - !l }
let m = div (!l + !u) 2 in
if get !mem t m < v then l := m + 1
else if get !mem t m > v then u := m - 1
...
...
@@ -94,7 +94,7 @@ module M2
while !l <= !u do
invariant { 0 <= !l /\ !u <= n-1 /\
forall k:int. 0 <= k < n -> get !mem t k = v -> !l <= k <= !u }
variant { !u - !l }
variant { !u - !l }
let m = div (!l + !u) 2 in
if get_ t m < v then l := m + 1
else if get_ t m > v then u := m - 1
...
...
@@ -152,7 +152,7 @@ module M3
invariant { 0 <= to_int !l /\ to_int !u <= to_int n - 1 /\
forall k:int. 0 <= k < to_int n ->
to_int (get !mem t k) = to_int v -> to_int !l <= k <= to_int !u }
variant { to_int !u - to_int !l }
variant { to_int !u - to_int !l }
let m = of_int (to_int !l
+
to_int
...
...
examples/programs/course.mlw
View file @
ba8bd4b5
...
...
@@ -106,7 +106,7 @@ end
predicate invCourse (alloc:first_free_addr) (this:course) =
let (rStud,students,count,sum) = this in
count >= 0
/\
/\
valid_array alloc 0 (count - 1) students
/\
injective 0 (count - 1) students
...
...
@@ -182,7 +182,7 @@ fun SetMark(R:Course, c:[R], s: [c.Rstud], mark: int) : unit
end
(*
Local Variables:
Local Variables:
compile-command: "unset LANG; make -C ../.. examples/programs/course"
End:
End:
*)
examples/programs/dijkstra.mlw
View file @
ba8bd4b5
...
...
@@ -101,9 +101,9 @@ module M
(* paths and shortest paths
path x y d =
there is a path from x to y of length d
there is a path from x to y of length d
shortest_path x y d =
there is a path from x to y of length d, and no shorter path *)
there is a path from x to y of length d, and no shorter path *)
inductive path vertex vertex int =
| Path_nil :
...
...
@@ -195,8 +195,8 @@ module M
let su = ref (g_succ u) in
while not (set_has_next su) do
invariant
{ S.subset !su (g_succ u) /\
inv src !visited !q !d /\ inv_succ2 src !visited !q u !su }
{ S.subset !su (g_succ u) /\
inv src !visited !q !d /\ inv_succ2 src !visited !q u !su }
variant { S.cardinal !su }
let v = set_next su in
relax u v
...
...
examples/programs/distance.mlw
View file @
ba8bd4b5
(* Correctness of a program computing the minimal distance between
two words (code by Claude Marché).
two words (code by Claude March
é
).
This program computes a variant of the Levenshtein distance. Given
two strings [w1] and [w2] of respective lengths [n1] and [n2], it
...
...
@@ -98,12 +98,12 @@ module Distance
/\ (forall k:int. 0 <= k <= j -> min_suffix w1 w2 (i+1) k t[k])
/\ min_suffix w1 w2 (i+1) (j+1) !o }
begin
let temp = !o in
let temp = !o in
o := t[j];
if w1[i] = w2[j] then
t[j] <- temp
else
t[j] <- (min t[j] t[j+1]) + 1
if w1[i] = w2[j] then
t[j] <- temp
else
t[j] <- (min t[j] t[j+1]) + 1
end
done
done;
...
...
examples/programs/euler001/euler001.mlw_SumMultiple_Closed_formula_1.v
View file @
ba8bd4b5
...
...
@@ -80,7 +80,7 @@ rewrite <- (Z_div_exact_full_2 n 3).
assert
(
h
:
(
n
mod
5
=
0
\
/
n
mod
5
<>
0
)
%
Z
)
by
omega
.
destruct
h
.
rewrite
Zdiv0
.
Qed
.
(
*
DO
NOT
EDIT
BELOW
*
)
...
...
examples/programs/euler002.mlw
View file @
ba8bd4b5
...
...
@@ -43,7 +43,7 @@ theory FibSumEven "sum of even-valued Fibonacci numbers"
axiom SumTooLarge: forall m n:int.
n >= 0 -> (fib n) >= m -> fib_sum_even_lt_from m n = 0
(* Note: we take for granted that [fib] is an
increasing sequence *)
increasing sequence *)
axiom SumYes: forall n m s:int.
n >= 0 -> (fib n) < m -> mod (fib n) 2 = 0 ->
...
...
examples/programs/euler002/euler002.mlw_FibOnlyEven_fib_even_1.v
View file @
ba8bd4b5
...
...
@@ -59,14 +59,14 @@ rewrite fibn; auto with zarith.
rewrite
Zplus_mod
.
assert
(
h
:
(
0
<=
(
n
mod
3
)
<
3
)
%
Z
).
apply
Z_mod_lt
;
auto
with
zarith
.
assert
(
h
'
:
(
n
mod
3
=
0
\
/
n
mod
3
=
1
\
/
n
mod
3
=
2
)
%
Z
)
assert
(
h
'
:
(
n
mod
3
=
0
\
/
n
mod
3
=
1
\
/
n
mod
3
=
2
)
%
Z
)
by
omega
.
clear
h
.
clear
h
.
destruct
h
'
as
[
h0
|
[
h1
|
h2
]].
split
;
auto
with
zarith
.
SearchAbout
Zmod
.
assert
assert
Qed
.
(
*
DO
NOT
EDIT
BELOW
*
)
...
...
examples/programs/flag.mlw
View file @
ba8bd4b5
...
...
@@ -29,11 +29,11 @@ module Flag
label Init:
while !i < !r do
invariant { 0 <= !b <= !i <= !r <= n /\
monochrome a 0 !b Blue /\
monochrome a !b !i White /\
monochrome a !r n Red /\
length a = n /\
permut_sub a (at a Init) 0 n }
monochrome a 0 !b Blue /\
monochrome a !b !i White /\
monochrome a !r n Red /\
length a = n /\
permut_sub a (at a Init) 0 n }
variant { !r - !i }
match a[!i] with
| Blue ->
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment