Definition environ2prop_type : Expr.type.
refine ({| Expr.Impl := environ -> Prop
; Expr.Eqb := fun _ _ => false
; Expr.Eqb_correct := _
|}).
intros. congruence.
Defined.
Definition our_types := cons tycontext_type
(cons c_option_expr_type
(cons c_type_type
(cons environ_type
(cons Expr.Prop_type
(cons environ2prop_type nil))))).
Definition tycontext_type_var := Expr.tvType 0.
Definition c_option_expr_type_var := Expr.tvType 1.
Definition c_type_type_var := Expr.tvType 2.
Definition environ_type_var := Expr.tvType 3.
Definition prop_type_var := Expr.tvType 4.
Definition environ2prop_type_var := Expr.tvType 5.
Definition delta_const := @Expr.Const our_types tycontext_type_var Delta.
(*above preconstructed, below constructed by entailer *)
Definition c_option_expr_const := @Expr.Const our_types c_option_expr_type_var
(@Some expr
(Ebinop Oeq (Etempvar _h (tptr t_struct_elem))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)) tint)).
Definition ret_type_signature :=
Expr.Sig our_types (cons tycontext_type_var nil)
c_type_type_var ret_type.
Definition tc_expropt_signature_lifted : Expr.signature our_types :=
Expr.Sig our_types (cons tycontext_type_var (cons c_option_expr_type_var (cons c_type_type_var nil))) environ2prop_type_var tc_expropt.
Definition tc_expropt_signature : Expr.signature our_types :=
Expr.Sig our_types (cons tycontext_type_var (cons c_option_expr_type_var (cons c_type_type_var (cons environ_type_var nil)))) prop_type_var tc_expropt.
Definition environ_signature (rho: environ) : Expr.signature our_types :=
Expr.Sig our_types (nil) (environ_type_var) (rho).
Definition functions (rho:environ) := cons ret_type_signature
(cons tc_expropt_signature
(cons tc_expropt_signature_lifted
(cons (environ_signature rho) nil))).
Definition ret_type_delta : Expr.expr our_types.
eapply Expr.Func. apply 0%nat. apply (cons delta_const nil).
Defined.
Definition tc_expropt_application_lifted : Expr.expr our_types.
eapply Expr.Func.
apply 2%nat.
apply (cons delta_const (cons c_option_expr_const (cons ret_type_delta nil))).
Defined.
Definition tc_expropt_application_unlifted : Expr.expr our_types.
eapply Expr.Func.
apply 1%nat.
apply (cons delta_const (cons c_option_expr_const (cons ret_type_delta
(cons (Expr.Func 3%nat nil) nil)))).
Defined.
Definition reflected_tc_expropt :=
(tc_expropt Delta
(@Some expr
(Ebinop Oeq (Etempvar _h (tptr t_struct_elem))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)) tint))
(ret_type Delta)).
Definition reflected_tc_expropt_unlifted :=
forall rho,
(tc_expropt Delta
(@Some expr
(Ebinop Oeq (Etempvar _h (tptr t_struct_elem))
(Ecast (Econst_int (Int.repr 0) tint) (tptr tvoid)) tint))
(ret_type Delta) rho).

Lemma prove_goal_sound :
forall exp f p,
prove_goal exp = true ->
Expr.exprD f nil nil exp prop_type_var = Some p ->
p.