]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_disambiguation/cicTextualParser2.ml
- split logic operators away from aritmetic ones so that
[helm.git] / helm / ocaml / cic_disambiguation / cicTextualParser2.ml
index f530a31beb30906e3dbc8f450299c6b87c53bcb4..8bb732a58960cd4175d9d1e39bf397bb433a31e8 100644 (file)
@@ -40,6 +40,13 @@ type tactical = (CicAst.term, string) TacticAst.tactic TacticAst.tactical
 type command = CicAst.term CommandAst.command
 type script = CicAst.term CommandAst.Script.script
 
+let fresh_num_instance =
+ let n = ref 0 in
+  function () ->
+   incr n;
+   !n
+;;
+
 let choice_of_uri (uri: string) =
   let cic = HelmLibraryObjects.term_of_uri (UriManager.uri_of_string uri) in
   (uri, (fun _ _ _ -> cic))
@@ -169,19 +176,23 @@ EXTEND
             return_term loc
               (CicAst.Binder (`Pi, (Cic.Anonymous, Some t1), t2))
       ]
+    | "logic_add" LEFTA   [ (* nothing here by default *) ]
+    | "logic_mult" LEFTA  [ (* nothing here by default *) ]
+    | "logic_inv" NONA    [ (* nothing here by default *) ]
     | "relop" LEFTA
       [ t1 = term; SYMBOL "="; t2 = term ->
         return_term loc (CicAst.Appl [CicAst.Symbol ("eq", 0); t1; t2])
       ]
     | "add" LEFTA     [ (* nothing here by default *) ]
     | "mult" LEFTA    [ (* nothing here by default *) ]
+    | "power" LEFTA   [ (* nothing here by default *) ]
     | "inv" NONA      [ (* nothing here by default *) ]
     | "simple" NONA
       [ sort = sort -> CicAst.Sort sort
       | n = substituted_name -> return_term loc n
       | PAREN "("; head = term; args = LIST1 term; PAREN ")" ->
           return_term loc (CicAst.Appl (head :: args))
-      | i = NUM -> return_term loc (CicAst.Num (i, 0))
+      | i = NUM -> return_term loc (CicAst.Num (i, (fresh_num_instance ())))
       | IMPLICIT -> return_term loc CicAst.Implicit
       | m = META;
         substs = [