Section tbled.
Variable tbl : SymEnv.functions RType_typ.
Let RSym_sym := RSym_sym tbl.
Existing Instance RSym_sym.
Definition solve_hd_in_hlip (hd: expr typ func) : rtac typ (expr typ func) :=
match hd with
| App (Inj (inr (Smx flater))) _ => EAPPLY typ func reify_derives_refl
| _ => EAPPLY typ func reify_now_later
end.
Fixpoint solve_strip_1_later (R: expr typ func) : rtac typ (expr typ func) :=
match R with
| Inj (inr (Data (fnil tympred))) => EAPPLY typ func reify_now_later
| App (App (Inj (inr (Data (fcons tympred)))) hd) tl =>
THEN (EAPPLY typ func reify_hlip_ind)
(THEN (TRY (REFLEXIVITY tbl))
(FIRST [solve_hd_in_hlip hd; solve_strip_1_later tl]))
| _ => FAIL
end.
Definition HLIP temp var ret gt R s :=
THEN (EAPPLY typ func (reify_hlip_base temp var ret gt s))
(TRY (solve_strip_1_later R)).
Let Expr_expr_fs := Expr_expr_fs tbl.
Existing Instance Expr_expr_fs.
Let Expr_ok_fs := Expr_ok_fs tbl.
Existing Instance Expr_ok_fs.
Let ExprVar_expr := @ExprVariables.ExprVar_expr typ func.
Existing Instance ExprVar_expr.
Existing Instance MA.
Existing Instance rtac_base.MentionsAnyOk.

Lemma HLIP_sound_aux1: rtac_sound (EAPPLY typ func reify_hlip_ind).