X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_transformations%2FtacticAst2Box.ml;h=f0626c7724d3056b0e224a3cda39ecdb5c3195b9;hb=23641e7c4b061a2dbc5862d763e8c3602793a94c;hp=902a1d661eeabda075b9e8c1cc760b97610625f0;hpb=d5478735145dd7a920ff1f7e0966b35f306bc3c7;p=helm.git diff --git a/helm/ocaml/cic_transformations/tacticAst2Box.ml b/helm/ocaml/cic_transformations/tacticAst2Box.ml index 902a1d661..f0626c772 100644 --- a/helm/ocaml/cic_transformations/tacticAst2Box.ml +++ b/helm/ocaml/cic_transformations/tacticAst2Box.ml @@ -43,20 +43,20 @@ let rec count_tactic current_size tac = | Apply (_, term) -> countterm (current_size + 6) term | Auto _ -> current_size + 4 | Assumption _ -> current_size + 10 - | Change (_, t1, t2, where) -> - let size1 = countterm (current_size + 12) t1 in (* change, with *) - let size2 = countterm size1 t2 in - (match where with - None -> size2 - | Some ident -> size2 + 3 + String.length ident) -(* | Change_pattern _ -> assert false (* TODO *) *) + | Compare (_, term) -> countterm (current_size + 7) term + | Constructor (_, n) -> current_size + 12 | Contradiction _ -> current_size + 13 - | Cut (_, term) -> countterm (current_size + 4) term - | Decompose (_, ident, principles) -> - List.fold_left - (fun size s -> size + (String.length s)) - (current_size + 11 + String.length ident) principles - | Discriminate (_, ident) -> current_size + 12 + (String.length ident) + | Cut (_, ident, term) -> + let id_size = + match ident with + None -> 0 + | Some id -> String.length id + 4 + in + countterm (current_size + 4 + id_size) term + | DecideEquality _ -> current_size + 15 + | Decompose (_, term) -> + countterm (current_size + 11) term + | Discriminate (_, term) -> countterm (current_size + 12) term | Elim (_, term, using) -> let size1 = countterm (current_size + 5) term in (match using with @@ -69,7 +69,8 @@ let rec count_tactic current_size tac = countterm (current_size + 5) term | Fourier _ -> current_size + 7 | Goal (_, n) -> current_size + 4 + int_of_float (ceil (log10 (float n))) - | Injection (_, ident) -> current_size + 10 + (String.length ident) + | Injection (_, term) -> + countterm (current_size + 10) term | Intros (_, num, idents) -> List.fold_left (fun size s -> size + (String.length s)) @@ -77,14 +78,10 @@ let rec count_tactic current_size tac = | Left _ -> current_size + 4 | LetIn (_, term, ident) -> countterm (current_size + 5 + String.length ident) term -(* | Reduce _ *) - | Reduce _ -> assert false (* TODO *) | Reflexivity _ -> current_size + 11 | Replace (_, t1, t2) -> let size1 = countterm (current_size + 14) t1 in (* replace, with *) countterm size1 t2 -(* | Replace_pattern _ -> assert false (* TODO *) *) - | Rewrite _ -> assert false (* TODO *) | Right _ -> current_size + 5 | Ring _ -> current_size + 4 | Split _ -> current_size + 5 @@ -135,37 +132,17 @@ and big_tactic2box = function ast2astBox term]) | Assumption _ -> Box.Text([],"assumption") | Auto _ -> Box.Text([],"auto") - | Change (_, t1, t2, where) -> - let where = - (match where with - None -> [] - | Some ident -> - [Box.Text([],"in"); - Box.smallskip; - Box.Text([],ident)]) in - Box.V([], - (pretty_append - [Box.Text([],"change")] - t1)@ - (pretty_append - [Box.Text([],"with")] - t2)@where) -(* | Change_pattern _ -> assert false (* TODO *) *) - | Contradiction _ -> Box.Text([],"contradiction") - | Cut (_, term) -> - Box.V([],[Box.Text([],"cut"); + | Compare (_, term) -> + Box.V([],[Box.Text([],"compare"); Box.indent(ast2astBox term)]) - | Decompose (_, ident, principles) -> - let principles = - List.map (fun x -> Box.Text([],x)) principles in + | Constructor (_,n) -> Box.Text ([],"constructor " ^ string_of_int n) + | Contradiction _ -> Box.Text([],"contradiction") + | DecideEquality _ -> Box.Text([],"decide equality") + | Decompose (_, term) -> Box.V([],[Box.Text([],"decompose"); - Box.H([],[Box.Text([],"["); - Box.V([],principles); - Box.Text([],"]")]); - Box.Text([],ident)]) - | Discriminate (_, ident) -> - Box.V([],[Box.Text([],"discriminate"); - Box.Text([],ident)]) + Box.indent(ast2astBox term)]) + | Discriminate (_, term) -> + Box.V([],pretty_append [Box.Text([],"discriminate")] term) | Elim (_, term, using) -> let using = (match using with @@ -192,9 +169,6 @@ and big_tactic2box = function Box.indent(ast2astBox term)]) | Fourier _ -> Box.Text([],"fourier") | Goal (_, n) -> Box.Text([],"goal " ^ string_of_int n) - | Injection (_, ident) -> - Box.V([],[Box.Text([],"transitivity"); - Box.indent (Box.Text([],ident))]) | Intros (_, num, idents) -> let num = (match num with @@ -213,8 +187,6 @@ and big_tactic2box = function Box.smallskip; Box.Text([],"=")]); Box.indent (ast2astBox term)]) -(* | Reduce _ *) - | Reduce _ -> assert false (* TODO *) | Reflexivity _ -> Box.Text([],"reflexivity") | Replace (_, t1, t2) -> Box.V([], @@ -224,8 +196,6 @@ and big_tactic2box = function (pretty_append [Box.Text([],"with")] t2)) -(* | Replace_pattern _ -> assert false (* TODO *) *) - | Rewrite _ -> assert false (* TODO *) | Right _ -> Box.Text([],"right") | Ring _ -> Box.Text([],"ring") | Split _ -> Box.Text([],"split")