@@ -127,7 +127,7 @@ let rec term : p_term pp = fun ppf t ->
127
127
match ts with
128
128
| None -> ()
129
129
| Some [||] when ! empty_context -> ()
130
- | Some ts -> out ppf " [%a]" (Array. pp func " ; " ) ts
130
+ | Some ts -> out ppf " . [%a]" (Array. pp func " ; " ) ts
131
131
in
132
132
match (t.elt, priority) with
133
133
| (P_Type , _ ) -> out ppf " TYPE"
@@ -154,9 +154,8 @@ let rec term : p_term pp = fun ppf t ->
154
154
out ppf " @[@[<hv2>let @[<2>%a%a%a@] ≔@ %a@ @]in@ %a@]"
155
155
ident x params_list xs typ a func t func u
156
156
| (P_NLit(i ) , _ ) -> out ppf " %i" i
157
- (* We print minimal parentheses, and ignore the [Wrap] constructor. *)
158
- | (P_Wrap(t ) , _ ) -> pp priority ppf t
159
- | (P_Expl(t ) , _ ) -> out ppf " {@[<hv2>%a@]}" func t
157
+ | (P_Wrap(t ) , _ ) -> out ppf " (@[<hv2>%a@])" func t
158
+ | (P_Expl(t ) , _ ) -> out ppf " [@[<hv2>%a@]]" func t
160
159
| (_ , _ ) -> out ppf " (@[<hv2>%a@])" func t
161
160
in
162
161
let rec toplevel ppf t =
@@ -172,9 +171,10 @@ let rec term : p_term pp = fun ppf t ->
172
171
toplevel ppf t
173
172
174
173
and params : p_params pp = fun ppf (ids , t , b ) ->
175
- match b with
176
- | false -> out ppf " @[(@,@[<2>%a%a@]@,)@]" param_ids ids typ t
177
- | true -> out ppf " @[{@,@[<2>%a%a@]@,}@]" param_ids ids typ t
174
+ if b then out ppf " @[[@,@[<2>%a%a@]@,]@]" param_ids ids typ t
175
+ else match t with
176
+ | Some t -> out ppf " @[(@,@[<2>%a : %a@]@,)@]" param_ids ids term t
177
+ | None -> out ppf " @[@,@[<2>%a@]@,@]" param_ids ids
178
178
179
179
(* starts with a space if the list is not empty *)
180
180
and params_list : p_params list pp = fun ppf ->
@@ -188,9 +188,9 @@ let rule : string -> p_rule pp = fun kw ppf {elt=(l,r);_} ->
188
188
out ppf " %s %a ↪ %a" kw term l term r
189
189
190
190
let inductive : string -> p_inductive pp =
191
- let cons ppf (id ,a ) = out ppf " | %a : %a" ident id term a in
191
+ let cons ppf (id ,a ) = out ppf " @, | %a : %a" ident id term a in
192
192
fun kw ppf {elt =(id ,a ,cs );_} ->
193
- out ppf " @[<v>%s %a : %a ≔@, %a@]" kw ident id term a (List. pp cons " @, " ) cs
193
+ out ppf " @[<v>%s %a : %a ≔%a@]" kw ident id term a (List. pp cons " " ) cs
194
194
195
195
let equiv : (p_term * p_term) pp = fun ppf (l ,r ) ->
196
196
out ppf " %a ≡ %a" term l term r
@@ -245,18 +245,18 @@ let query : p_query pp = fun ppf { elt; _ } ->
245
245
match elt with
246
246
| P_query_assert (true , a ) -> out ppf " assertnot ⊢ %a" assertion a
247
247
| P_query_assert (false ,a ) -> out ppf " assert ⊢ %a" assertion a
248
- | P_query_debug (true ,s ) -> out ppf " set debug \" +%s\" " s
249
- | P_query_debug (false ,s ) -> out ppf " set debug \" -%s\" " s
248
+ | P_query_debug (true ,s ) -> out ppf " debug \" +%s\" " s
249
+ | P_query_debug (false ,s ) -> out ppf " debug \" -%s\" " s
250
250
| P_query_flag (s , b ) ->
251
- out ppf " set flag \" %s\" %s" s (if b then " on" else " off" )
251
+ out ppf " flag \" %s\" %s" s (if b then " on" else " off" )
252
252
| P_query_infer (t , _ ) -> out ppf " type %a" term t
253
253
| P_query_normalize (t , _ ) -> out ppf " compute %a" term t
254
- | P_query_prover s -> out ppf " set prover \" %s\" " s
255
- | P_query_prover_timeout n -> out ppf " set prover_timeout %d" n
254
+ | P_query_prover s -> out ppf " prover \" %s\" " s
255
+ | P_query_prover_timeout n -> out ppf " prover_timeout %d" n
256
256
| P_query_print None -> out ppf " print"
257
257
| P_query_print (Some qid ) -> out ppf " print %a" qident qid
258
258
| P_query_proofterm -> out ppf " proofterm"
259
- | P_query_verbose i -> out ppf " set verbose %i" i
259
+ | P_query_verbose i -> out ppf " verbose %i" i
260
260
261
261
let tactic : p_tactic pp = fun ppf { elt; _ } ->
262
262
begin match elt with
@@ -273,10 +273,10 @@ let tactic : p_tactic pp = fun ppf { elt; _ } ->
273
273
| P_tac_refl -> out ppf " reflexivity"
274
274
| P_tac_rewrite (b ,p ,t ) ->
275
275
let dir ppf b = if not b then out ppf " left" in
276
- let pat ppf p = out ppf " [%a]" rw_patt p in
276
+ let pat ppf p = out ppf " . [%a]" rw_patt p in
277
277
out ppf " rewrite%a%a %a" dir b (Option. pp pat) p term t
278
- | P_tac_simpl None -> out ppf " simpl "
279
- | P_tac_simpl (Some qid ) -> out ppf " simpl %a" qident qid
278
+ | P_tac_simpl None -> out ppf " simplify "
279
+ | P_tac_simpl (Some qid ) -> out ppf " simplify %a" qident qid
280
280
| P_tac_solve -> out ppf " solve"
281
281
| P_tac_sym -> out ppf " symmetry"
282
282
| P_tac_why3 p ->
@@ -298,7 +298,7 @@ let notation : Sign.notation pp = fun ppf -> function
298
298
| _ -> ()
299
299
300
300
let rec subproof : p_subproof pp = fun ppf sp ->
301
- out ppf " < @[<hv2>@ %a@ @]> " proofsteps sp
301
+ out ppf " { @[<hv2>@ %a@ @]} " proofsteps sp
302
302
303
303
and subproofs : p_subproof list pp = fun ppf spl ->
304
304
out ppf " @[<hv>%a@]" (pp_print_list ~pp_sep: pp_print_space subproof) spl
@@ -310,7 +310,7 @@ and proofstep : p_proofstep pp = fun ppf (Tactic (t, spl)) ->
310
310
out ppf " @[<hv2>%a@,%a;@]" tactic t subproofs spl
311
311
312
312
let proof : (p_proof * p_proof_end) pp = fun ppf (p , pe ) ->
313
- out ppf " begin@[<hv2>@ %a@ @] %a"
313
+ out ppf " begin@ @ [<hv2>%a@]@ %a"
314
314
(fun ppf -> function
315
315
| [block] -> proofsteps ppf block
316
316
(* No braces for a single toplevel block *)
@@ -322,11 +322,10 @@ let command : p_command pp = fun ppf { elt; _ } ->
322
322
| P_builtin (s , qid ) -> out ppf " @[builtin \" %s\" @ ≔ %a@]" s qident qid
323
323
| P_inductive (_ , _ , [] ) -> assert false (* not possible *)
324
324
| P_inductive (ms , xs , i :: il ) ->
325
- out ppf " @[<v>@[%a%a@]%a@,%a@,end@]"
326
- modifiers ms
327
- (List. pp params " " ) xs
328
- (inductive " inductive" ) i
329
- (List. pp (inductive " with" ) " @," ) il
325
+ let with_ind ppf i = out ppf " @,%a" (inductive " with" ) i in
326
+ out ppf " @[<v>@[%a%a@]%a%a@]"
327
+ modifiers ms (List. pp params " " ) xs
328
+ (inductive " inductive" ) i (List. pp with_ind " " ) il
330
329
| P_notation (qid , n ) -> out ppf " notation %a %a" qident qid notation n
331
330
| P_open ps -> out ppf " open %a" (List. pp path " " ) ps
332
331
| P_query q -> query ppf q
@@ -336,7 +335,9 @@ let command : p_command pp = fun ppf { elt; _ } ->
336
335
(List. pp path " " ) ps
337
336
| P_require_as (p ,i ) -> out ppf " @[require %a@ as %a@]" path p ident i
338
337
| P_rules [] -> assert false (* not possible *)
339
- | P_rules (r :: rs ) -> rule " rule" ppf r; List. iter (rule " with" ppf) rs
338
+ | P_rules (r :: rs ) ->
339
+ let with_rule ppf r = out ppf " @.%a" (rule " with" ) r in
340
+ rule " rule" ppf r; List. iter (with_rule ppf) rs
340
341
| P_symbol
341
342
{ p_sym_mod; p_sym_nam; p_sym_arg; p_sym_typ;
342
343
p_sym_trm; p_sym_prf; p_sym_def } ->
0 commit comments