let compile_user_hypothesis name labels predicate =
let h_name = "H_" ^ name in
let d_name = "Def_" ^ name in
let context = push_context "compile-axiom" in
try
let here =
try Axiomatics.label_name (List.hd labels)
with _ -> Wp_parameters.fatal "No default label for Axiom '%s'" name
in
let env = axiom_env here in
let body = prop env predicate in
let implicits , closures = M.userdef_signature env.frame [] [body] in
let property =
D.forall implicits
(F.p_iff
(F.p_call h_name (List.map F.var implicits))
(flush_context "compile-axiom" context body)) in
Hashtbl.add user_axiomdefs name
(Some {
a_name = name ;
a_labels = List.map Axiomatics.label_name labels ;
a_hyp_name = h_name ;
a_def_name = d_name ;
a_implicit = implicits ;
a_closure = closures ;
a_property = property ;
}) ;
with err ->
Hashtbl.add user_axiomdefs name None ;
kill_context "compile-axiom" context ;
raise err