(** *Even length*)
Inductive even : nat -> Prop :=
| EvenO : even 0
| EvenS : forall n, even n -> even (S (S n)).(** *Even length*)
Inductive even : nat -> Prop :=
| EvenO : even 0
| EvenS : forall n, even n -> even (S (S n)).(** *Even length*)
Inductive even : nat -> Prop :=
| EvenO : even 0
| EvenS : forall n, even n -> even (S (S n)).Function length_of_even (ls:list nat) : option nat :=
  match ls with
  | nil => Some 0
  | cons x1 (cons x2 ls') =>
    match length_of_even ls' with
    | Some n' => Some ( 2 + n')
    | _ => None
    end
  | cons x nil => None 
  end.

(* Specifications: *)
Lemma LOE_correct: forall ls n, length_of_even ls = Some n -> even (length ls).
Lemma perm_of_sh_readable: forall sh P, shares.readable_share_dec sh = left P -> Mem.perm_order'' (perm_of_sh sh) (Some Readable).