make_arg_for_apply true hd
(List.fold_right (make_arg_for_apply false) tl [])
| _ -> assert false
+
let get_name = function
| Some s -> s
| None -> "_"
and ce2pres =
function
`Declaration d ->
- (match d.Con.dec_name with
- Some s ->
- let ty = term2pres d.Con.dec_type in
- B.H ([],
- [(B.b_kw "Assume");
- B.b_space;
- B.Object ([], P.Mi([],s));
- B.Text([],":");
- ty])
- | None ->
- prerr_endline "NO NAME!!"; assert false)
+ let ty = term2pres d.Con.dec_type in
+ B.H ([],
+ [(B.b_kw "Assume");
+ B.b_space;
+ B.Object ([], P.Mi([],get_name d.Con.dec_name));
+ B.Text([],":");
+ ty])
| `Hypothesis h ->
- (match h.Con.dec_name with
- Some s ->
- let ty = term2pres h.Con.dec_type in
- B.H ([],
- [(B.b_kw "Suppose");
- B.b_space;
- B.Text([],"(");
- B.Object ([], P.Mi ([],s));
- B.Text([],")");
- B.b_space;
- ty])
- | None ->
- prerr_endline "NO NAME!!"; assert false)
+ let ty = term2pres h.Con.dec_type in
+ B.H ([],
+ [(B.b_kw "Suppose");
+ B.b_space;
+ B.Text([],"(");
+ B.Object ([], P.Mi ([],get_name h.Con.dec_name));
+ B.Text([],")");
+ B.b_space;
+ ty])
| `Proof p ->
proof2pres p
| `Definition d ->
- (match d.Con.def_name with
- Some s ->
- let term = term2pres d.Con.def_term in
- B.H ([],
- [ B.b_kw "Let"; B.b_space;
- B.Object ([], P.Mi([],s));
- B.Text([]," = ");
- term])
- | None ->
- prerr_endline "NO NAME!!"; assert false)
+ let term = term2pres d.Con.def_term in
+ B.H ([],
+ [ B.b_kw "Let"; B.b_space;
+ B.Object ([], P.Mi([],get_name d.Con.def_name));
+ B.Text([]," = ");
+ term])
and acontext2pres ac continuation indent =
List.fold_right
(match e with
`Declaration h
| `Hypothesis h ->
- let name =
- (match h.Con.dec_name with
- None -> "NO NAME???"
- | Some n ->n) in
+ let name = get_name h.Con.dec_name in
[B.b_space;
B.Object ([], P.Mi ([],name));
B.Text([],":");
| _ -> assert false) in
match proof.Con.proof_context with
`Hypothesis hyp1::`Hypothesis hyp2::tl ->
- let get_name hyp =
- (match hyp.Con.dec_name with
- None -> "_"
- | Some s -> s) in
let preshyp1 =
B.H ([],
[B.Text([],"(");
- B.Object ([], P.Mi([],get_name hyp1));
+ B.Object ([], P.Mi([],get_name hyp1.Con.dec_name));
B.Text([],")");
B.skip;
term2pres hyp1.Con.dec_type]) in
let preshyp2 =
B.H ([],
[B.Text([],"(");
- B.Object ([], P.Mi([],get_name hyp2));
+ B.Object ([], P.Mi([],get_name hyp2.Con.dec_name));
B.Text([],")");
B.skip;
term2pres hyp2.Con.dec_type]) in
match proof.Con.proof_context with
`Declaration decl::`Hypothesis hyp::tl
| `Hypothesis decl::`Hypothesis hyp::tl ->
- let get_name decl =
- (match decl.Con.dec_name with
- None -> "_"
- | Some s -> s) in
let presdecl =
B.H ([],
[(B.b_kw "let");
B.skip;
- B.Object ([], P.Mi([],get_name decl));
+ B.Object ([], P.Mi([],get_name decl.Con.dec_name));
B.Text([],":"); term2pres decl.Con.dec_type]) in
let suchthat =
B.H ([],
[(B.b_kw "such that");
B.skip;
B.Text([],"(");
- B.Object ([], P.Mi([],get_name hyp));
+ B.Object ([], P.Mi([],get_name hyp.Con.dec_name));
B.Text([],")");
B.skip;
term2pres hyp.Con.dec_type]) in