diff options
| author | Pierre Boutillier | 2014-08-05 18:09:30 +0200 |
|---|---|---|
| committer | Pierre Boutillier | 2014-09-01 13:45:52 +0200 |
| commit | 14e6dc5800a28d49dcdb714b06c02fced7b9fdaf (patch) | |
| tree | 3e5e29685de4d9b9706ef01745305f2616c842e5 /ide | |
| parent | 9f7a633ae30f997c2e70c31681e92d1ef43f9655 (diff) | |
Coqide prints succesive hyps of the same type on 1 line
This revert somehow f5d7b2b1eda550f5bf0965286d449112acbbadde about "Hypotheses
don't respect Barendregt convention".
Diffstat (limited to 'ide')
| -rw-r--r-- | ide/ide_slave.ml | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ide/ide_slave.ml b/ide/ide_slave.ml index 6b2c52123d..42bc939b56 100644 --- a/ide/ide_slave.ml +++ b/ide/ide_slave.ml @@ -168,17 +168,28 @@ let concl_next_tac sigma concl = "right" ]) +let compact_named_context c = + let compact l (i1,c1,t1) = + match l with + | [] -> [[i1],c1,t1] + | (l2,c2,t2)::q -> + if Option.equal Constr.equal c1 c2 && Constr.equal t1 t2 + then (i1::l2,c2,t2)::q + else ([i1],c1,t1)::l + in Context.fold_named_context_reverse compact ~init:[] c + let process_goal sigma g = let env = Goal.V82.env sigma g in + let min_env = Environ.reset_context env in let id = Goal.uid g in let ccl = let norm_constr = Reductionops.nf_evar sigma (Goal.V82.concl sigma g) in string_of_ppcmds (pr_goal_concl_style_env env norm_constr) in - let process_hyp h_env d acc = - let d = Context.map_named_declaration (Reductionops.nf_evar sigma) d in - (string_of_ppcmds (pr_var_decl h_env d)) :: acc in + let process_hyp d = + let d = Context.map_named_list_declaration (Reductionops.nf_evar sigma) d in + (string_of_ppcmds (pr_var_list_decl min_env d)) in let hyps = - List.rev (Environ.fold_named_context process_hyp env ~init: []) in + List.map process_hyp (compact_named_context (Environ.named_context env)) in { Interface.goal_hyp = hyps; Interface.goal_ccl = ccl; Interface.goal_id = id; } let goals () = |
