]> matita.cs.unibo.it Git - helm.git/commitdiff
Quick patch: the maxmeta is now pushed/popped when compiling an external file.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 27 Feb 2013 20:19:04 +0000 (20:19 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Wed, 27 Feb 2013 20:19:04 +0000 (20:19 +0000)
This is implemented imperatively for now. It should go into a status.

matita/components/ng_refiner/nCicMetaSubst.ml
matita/components/ng_refiner/nCicMetaSubst.mli

index e3ee8d60e0bdb48025c46a84da36e107d7f8e42f..0207c9231e058b15d5ab820d21b0bf1719ca2cca 100644 (file)
@@ -47,10 +47,13 @@ let outside exc_opt =
 exception MetaSubstFailure of string Lazy.t
 exception Uncertain of string Lazy.t
 
-let newmeta,maxmeta = 
+let newmeta,maxmeta,pushmaxmeta,popmaxmeta = 
   let maxmeta = ref 0 in
+  let pushedmetas = ref [] in
   (fun () -> incr maxmeta; !maxmeta),
-  (fun () -> !maxmeta)
+  (fun () -> !maxmeta),
+  (fun () -> pushedmetas := !maxmeta::!pushedmetas; maxmeta := 0),
+  (fun () -> match !pushedmetas with [] -> assert false | hd::tl -> pushedmetas := tl)
 ;;
 
 exception NotFound of [`NotInTheList | `NotWellTyped];;
index fdb37772816c672f1bc400a7664f3ca62aeeb332..398325df41fd08e28422b097b068e935d0e3d1e0 100644 (file)
@@ -19,6 +19,10 @@ val debug: bool ref
 (* the index of the last created meta *)
 val maxmeta: unit -> int
 
+(* Bad, this should be made functional and put in the status! *)
+val pushmaxmeta: unit -> unit
+val popmaxmeta: unit -> unit
+
 (* the delift function takes in input a metavariable index, a local_context
  * and a term t, and substitutes every subterm t' of t with its position 
  * (searched up-to unification) in