]> matita.cs.unibo.it Git - helm.git/commitdiff
count_pattern implemented
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 1 Jul 2005 13:53:46 +0000 (13:53 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Fri, 1 Jul 2005 13:53:46 +0000 (13:53 +0000)
helm/ocaml/cic_transformations/tacticAst2Box.ml

index fc511932423723292b41ebd21d490b81790f5907..151ebfd7b335b7d7ad7a6ad306a7020d8b7ac575 100644 (file)
 open Ast2pres
 open TacticAst
 
-let count_pattern current_size p =
+let count_pattern current_size (wanted,hyps_pat,concl_pat) =
  if current_size > maxsize then current_size
  else
-assert false
+  let size = countterm (current_size + 3) concl_pat in
+  let size =
+   List.fold_left
+    (fun s (id,t) -> countterm (s + String.length id + 1) t) size hyps_pat in
+  match wanted with
+     None -> size + 3
+   | Some t -> countterm (size + 9) t
 
 let count_kind =
  function