]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/tactics/proofEngineTypes.ml
added initial_status
[helm.git] / helm / ocaml / tactics / proofEngineTypes.ml
index ac0713bd057dc364c44a193f71cb1b475a14e564..8d1def22ebd7bd360df377967a3bd85885fd0355 100644 (file)
@@ -31,6 +31,21 @@ type proof = UriManager.uri option * Cic.metasenv * Cic.term * Cic.term
 type goal = int
 type status = proof * goal
 
+let initial_status ty metasenv =
+  let rec aux max = function
+    | [] -> max + 1
+    | (idx, _, _) :: tl ->
+        if idx > max then
+          aux idx tl
+        else
+          aux max tl
+  in
+  let newmeta_idx = aux 0 metasenv in
+  let proof =
+    None, (newmeta_idx, [], ty) :: metasenv, Cic.Meta (newmeta_idx, []), ty
+  in
+  (proof, newmeta_idx)
+
   (**
     a tactic: make a transition from one status to another one or, usually,
     raise a "Fail" (@see Fail) exception in case of failure