]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_disambiguation/logic_notation.ml
first moogle template checkin
[helm.git] / helm / ocaml / cic_disambiguation / logic_notation.ml
index 1d47711da721d2d9419169d460acf0df76ab9512..2227b2741e14c6dd6fadac9a75ba4401ba8dc3d2 100644 (file)
 open CicTextualParser2
 
 EXTEND
-  term: LEVEL "add"
+  term: LEVEL "logic_add"
     [
       [ t1 = term; SYMBOL <:unicode<lor>> (* ∨ *); t2 = term ->
           return_term loc (CicAst.Appl [CicAst.Symbol ("or", 0); t1; t2])
       ]
     ];
-  term: LEVEL "mult"
+  term: LEVEL "logic_mult"
     [
       [ t1 = term; SYMBOL <:unicode<land>> (* ∧ *); t2 = term ->
         return_term loc (CicAst.Appl [CicAst.Symbol ("and", 0); t1; t2])
       ]
     ];
-  term: LEVEL "inv"
+  term: LEVEL "logic_inv"
     [
       [ SYMBOL <:unicode<lnot>> (* ¬ *); t = term ->
         return_term loc (CicAst.Appl [CicAst.Symbol ("not", 0); t])
@@ -47,6 +47,10 @@ EXTEND
 END
 
 let _ =
+    (* TODO cut-and-pasted code: here, in arit_notation.ml and
+     * disambiguateChoices.ml *)
+  let const s = Cic.Const (s, []) in
+  let mutind s = Cic.MutInd (s, 0, []) in
   DisambiguateChoices.add_symbol_choice "eq"
     ("leibnitz's equality",
      (fun interp _ args ->
@@ -58,5 +62,12 @@ let _ =
        Cic.Appl [
          Cic.MutInd (HelmLibraryObjects.Logic.eq_URI, 0, []);
            Cic.Implicit (Some `Type); t1; t2
-       ]))
+      ]));
+  DisambiguateChoices.add_binary_op "and" "logical and"
+    (mutind HelmLibraryObjects.Logic.and_URI);
+  DisambiguateChoices.add_binary_op "or" "logical or"
+    (mutind HelmLibraryObjects.Logic.or_URI);
+  DisambiguateChoices.add_unary_op "not" "logical not"
+    (const HelmLibraryObjects.Logic.not_URI);
 
+(* vim:set encoding=utf8: *)