Definition p_compatible_QI qic qif:= forall f lp t, forall s:variable -> value,
let ru := rule_intro f lp t in
(In ru prog) ->
p_term_assignment qic qif (subst s t) ≤p
p_term_assignment qic qif (subst s (lhs_of_rule ru)).

(* Specifications: *)
Lemma p_compatible_compatible qic:
{pqif | p_compatible_QI qic pqif} -> {qif | compatible_QI qic qif}.
Lemma p_term_assignment_ext qic f f':
(forall x, f x = f' x) ->
forall t, p_term_assignment qic f t= p_term_assignment qic f' t.
Lemma p_compatible_QI_ext qic f f':
(forall x, f x = f' x) ->
p_compatible_QI qic f ->
p_compatible_QI qic f'.
Lemma p_compatible_QI_split qic f h:
{g | p_compatible_QI qic (f;;h;;g)} -> {g | p_compatible_QI qic (f;;g)}.
Lemma p_term_assignment_first_choice qic f t v:
p_term_assignment qic f t = Some v ->
forall g, p_term_assignment qic (f;;g) t = Some v.
Lemma value_as_p_term_assignment qic qif: forall v:value,
(p_term_assignment qic qif (term_from_value v)) = Some (value_assignment qic v).