Definition nat_to_perm (i:nat) :=
(match i with
| 0 => Some None
| 1 => Some (Some Nonempty)
| 2 => Some (Some Readable)
| 3 => Some (Some Writable)
| 4 => Some (Some Freeable)
| _ => None
end)%nat.
Definition perm_to_nat (p: option (option permission)) :=
match p with
| Some (None) => 0
| Some (Some Nonempty) => 1
| Some (Some Readable) => 2
| Some (Some Writable) => 3
| Some (Some Freeable) => 4
| None => 5
end.
Definition nat_to_perm_simpl (i:nat) :=
(match i with
| 0 => None
| 1 => Some Nonempty
| 2 => Some Readable
| 3 => Some Writable
| 4 => Some Freeable
| _ => None
end)%nat.
Definition perm_to_nat_simpl (p: option permission) :=
match p with
| None => 0
| Some Nonempty => 1
| Some Readable => 2
| Some Writable => 3
| Some Freeable => 4
end.

(* Specifications: *)
Lemma perm_to_nat_bound:
forall p,
perm_to_nat p < 6.
Lemma perm_to_nat_bound_simpl:
forall p,
perm_to_nat_simpl p < 5.
Lemma nat_to_perm_perm_to_nat:
forall p,
nat_to_perm (perm_to_nat p) = p.
Lemma nat_to_perm_perm_to_nat_simpl:
forall p,
nat_to_perm_simpl (perm_to_nat_simpl p) = p.
Lemma finite_bounded_nat_aux_func:
forall hi ,
konig.finite
( fun f:nat -> option (option permission) => bounded_nat_func_aux f hi).
Lemma finite_bounded_nat_aux_func_simpl:
forall hi ,
konig.finite
( fun f:nat -> option permission => bounded_nat_func_aux f hi).
Lemma finite_bounded_nat_func:
forall hi ,
konig.finite
( fun f:nat -> option (option permission) => bounded_nat_func' f hi).
Lemma finite_bounded_nat_func_simpl:
forall hi ,
konig.finite
( fun f:nat -> option permission => bounded_nat_func' f hi).
Lemma finite_bounded_func:
forall hi lo,
konig.finite
( fun f:Z -> option (option permission) => bounded_func' f hi lo).
Lemma finite_bounded_func_simpl:
forall hi lo,
konig.finite
( fun f:Z -> option permission => bounded_func' f hi lo).
Lemma finite_bounded_op_func_simpl:
forall hi lo,
konig.finite
( fun f: option (Z -> option permission) => bounded_func_op f hi lo).
Lemma finite_bounded_op_func:
forall hi lo,
konig.finite
( fun f: option (Z -> option (option permission)) => bounded_func_op f hi lo).
Lemma finite_sub_maps:
forall m2,
@bounded_map permission m2 ->
konig.finite
(fun m1 => @sub_map (option permission) permission m1 m2).
Lemma perm_to_nat_bound:
forall p,
perm_to_nat p < 6.
Lemma perm_to_nat_bound_simpl:
forall p,
perm_to_nat_simpl p < 5.
Lemma nat_to_perm_perm_to_nat:
forall p,
nat_to_perm (perm_to_nat p) = p.
Lemma nat_to_perm_perm_to_nat_simpl:
forall p,
nat_to_perm_simpl (perm_to_nat_simpl p) = p.
Lemma finite_bounded_nat_aux_func:
forall hi ,
konig.finite
( fun f:nat -> option (option permission) => bounded_nat_func_aux f hi).
Lemma finite_bounded_nat_aux_func_simpl:
forall hi ,
konig.finite
( fun f:nat -> option permission => bounded_nat_func_aux f hi).
Lemma finite_bounded_nat_func:
forall hi ,
konig.finite
( fun f:nat -> option (option permission) => bounded_nat_func' f hi).
Lemma finite_bounded_nat_func_simpl:
forall hi ,
konig.finite
( fun f:nat -> option permission => bounded_nat_func' f hi).
Lemma finite_bounded_func:
forall hi lo,
konig.finite
( fun f:Z -> option (option permission) => bounded_func' f hi lo).
Lemma finite_bounded_func_simpl:
forall hi lo,
konig.finite
( fun f:Z -> option permission => bounded_func' f hi lo).
Lemma finite_bounded_op_func_simpl:
forall hi lo,
konig.finite
( fun f: option (Z -> option permission) => bounded_func_op f hi lo).
Lemma finite_bounded_op_func:
forall hi lo,
konig.finite
( fun f: option (Z -> option (option permission)) => bounded_func_op f hi lo).
Lemma finite_sub_maps:
forall m2,
@bounded_map permission m2 ->
konig.finite
(fun m1 => @sub_map (option permission) permission m1 m2).