Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 0f6593e1 by Jean-Christophe Filliâtre

### list.Sorted generalized for elements of any type

parent e2fb1f1f
 ... ... @@ -164,4 +164,5 @@ why3.conf /modules/string/ /modules/stack/ /modules/queue/ /modules/pqueue/
 ... ... @@ -5,7 +5,7 @@ module M use import int.Int use import list.Length use import list.Sorted use import list.SortedInt use import list.Permut let rec insert x l variant { length l } = ... ...
 ... ...
 ... ... @@ -5,7 +5,7 @@ module M use import int.Int use import list.Length use import list.Sorted use import list.SortedInt use import list.Append use import list.Permut ... ...
This diff is collapsed.
 ... ... @@ -4,7 +4,7 @@ module FindInSortedList use import int.Int use import list.Mem use import list.Sorted use import list.SortedInt lemma Sorted_not_mem: forall x y : int, l : list int. ... ...
 ... ...
 ... ... @@ -25,7 +25,7 @@ module Queue | Cons x t -> result = x /\ q.elts = t end } | Empty -> { q.elts = old q.elts = Nil } val top: val peek: q: t 'a -> {} 'a ... ... @@ -35,7 +35,7 @@ module Queue val clear: q: t 'a -> {} unit writes q {q.elts = Nil } val copy: q: t 'a -> {} t 'a { result = q } val copy: q: t 'a -> {} t 'a reads q { result = q } val is_empty: q: t 'a -> {} bool reads q { result=True <-> q.elts = Nil } ... ... @@ -61,9 +61,9 @@ module Test let test1 () = let s = Queue.create () in Queue.push 1 s; let x = Queue.top s in assert { x = 1 }; let x = Queue.peek s in assert { x = 1 }; Queue.push 2 s; let x = Queue.top s in assert { x = 1 }; let x = Queue.peek s in assert { x = 1 }; () end ... ...
 ... ... @@ -132,22 +132,31 @@ end theory Sorted use export List use import int.Int inductive sorted (l: list int) = type t predicate le t t inductive sorted (l: list t) = | Sorted_Nil: sorted Nil | Sorted_One: forall x: int. sorted (Cons x Nil) forall x: t. sorted (Cons x Nil) | Sorted_Two: forall x y: int, l: list int. x <= y -> sorted (Cons y l) -> sorted (Cons x (Cons y l)) forall x y: t, l: list t. le x y -> sorted (Cons y l) -> sorted (Cons x (Cons y l)) use import Mem lemma Sorted_mem: forall x: int, l: list int. (forall y: int. mem y l -> x <= y) /\ sorted l <-> sorted (Cons x l) lemma sorted_mem: forall x: t, l: list t. (forall y: t. mem y l -> le x y) /\ sorted l <-> sorted (Cons x l) end theory SortedInt use import int.Int clone export Sorted with type t = int, predicate le = (<=) end ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!