Definition PPO_rule (r: rule) : Prop :=
  match r with
    | rule_intro f lp t => PPO t (fapply f (map (@term_from_pattern _ _ _) lp))
  end.Definition PPO_prog : Prop :=
  forall r, In r prog -> PPO_rule r.

Lemma PPO_rule_PPO_instance s f lp t : PPO_rule (rule_intro f lp t) -> PPO (subst s t) (fapply f (map (@term_from_value _ _ _) (map (psubst s) lp))).