Module Type STRAT_MODEL.
Declare Module AV : ADR_VAL.
Inductive res (PRED : Type) : Type :=
| NO':  forall sh: Share.t, ~(readable_share sh) -> res PRED
| YES': forall sh: Share.t, readable_share sh -> kind -> fpreds PRED -> res PRED
| PURE': kind -> fpreds PRED -> res PRED.
Definition res_fmap (A B:Type) (f:A->B) (g:B->A)(x:res A) : res B :=
match x with
| NO' rsh nsh => NO' B rsh nsh
| YES' sh rsh k pds => YES' B sh rsh k (fmap fpreds f g pds)
| PURE' k pds => PURE' B k (fmap fpreds f g pds)
end.
Definition f_res : functor := Functor ff_res.
Inductive res_join (PRED : Type) : f_res PRED -> f_res PRED -> f_res PRED -> Prop :=
| res_join_NO1 : forall sh1 nsh1 sh2 nsh2 sh3 nsh3,
join sh1 sh2 sh3 ->
res_join PRED (NO' PRED sh1 nsh1) (NO' PRED sh2 nsh2)
(NO' PRED sh3 nsh3)
| res_join_NO2 : forall sh1 nsh1 sh2 rsh2 sh3 rsh3 k p,
join sh1 sh2 sh3 ->
res_join PRED (NO' PRED sh1 nsh1) (YES' PRED sh2 rsh2 k p)
(YES' PRED sh3 rsh3 k p)
| res_join_NO3 : forall sh1 rsh1 sh2 nsh2 sh3 rsh3 k p,
join sh1 sh2 sh3 ->
res_join PRED (YES' PRED sh1 rsh1 k p) (NO' PRED sh2 nsh2)
(YES' PRED sh3 rsh3 k p)
| res_join_YES : forall sh1 rsh1 sh2 rsh2 sh3 rsh3 k p,
join sh1 sh2 sh3 ->
res_join PRED (YES' PRED sh1 rsh1 k p) (YES' PRED sh2 rsh2 k p) (YES' PRED sh3 rsh3 k p)
| res_join_PURE : forall k p, res_join PRED (PURE' PRED k p) (PURE' PRED k p) (PURE' PRED k p).

Axiom pa_rj : forall PRED, @Perm_alg _ (res_join PRED).