(* * Copyright (c) 2009-2011, Andrew Appel, Robert Dockins and Aquinas Hobor. * *)
Local Open Scope nat_scope.
Module Type TY_FUNCTOR_PROP.
Parameter F : functor.
Parameter other : Type.
End TY_FUNCTOR_PROP.
Module Type KNOT_HERED.
Declare Module TF:TY_FUNCTOR_PROP.
Parameter knot:Type.
Parameter ag_knot : ageable knot.
Existing Instance ag_knot.
Existing Instance ag_prod.
Definition predicate := pred (knot * other).
Parameter squash : (nat * F predicate) -> knot.
Parameter unsquash : knot -> (nat * F predicate).
Parameter approx : nat -> predicate -> predicate.

(* Specifications: *)
Axiom squash_unsquash : forall k:knot, squash (unsquash k) = k.
Axiom unsquash_squash : forall (n:nat) (f:F predicate),
unsquash (squash (n,f)) = (n, fmap F (approx n) f).
Axiom approx_spec : forall n p k,
proj1_sig (approx n p) k = (level k < n /\ proj1_sig p k).
Axiom knot_level : forall k:knot, level k = fst (unsquash k).
Axiom knot_age1 : forall k,
age1 k =
match unsquash k with
| (O,_) => None
| (S n,x) => Some (squash (n,x))
end.