X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_disambiguation%2Flogic_notation.ml;h=2227b2741e14c6dd6fadac9a75ba4401ba8dc3d2;hb=6912a028bef118d8e9d7c2847200510a9b055c6a;hp=85c5be3ea324fefc82d004eb7d7b03c62388855a;hpb=6459acbd4bb69475cfaa0b37a9771ced94193667;p=helm.git diff --git a/helm/ocaml/cic_disambiguation/logic_notation.ml b/helm/ocaml/cic_disambiguation/logic_notation.ml index 85c5be3ea..2227b2741 100644 --- a/helm/ocaml/cic_disambiguation/logic_notation.ml +++ b/helm/ocaml/cic_disambiguation/logic_notation.ml @@ -23,30 +23,34 @@ * http://helm.cs.unibo.it/ *) -open CicTextualParser2Ast open CicTextualParser2 EXTEND - term: LEVEL "add" + term: LEVEL "logic_add" [ [ t1 = term; SYMBOL <:unicode> (* ∨ *); t2 = term -> - return_term loc (Appl_symbol ("or", 0, [t1; t2])) + return_term loc (CicAst.Appl [CicAst.Symbol ("or", 0); t1; t2]) ] ]; - term: LEVEL "mult" + term: LEVEL "logic_mult" [ [ t1 = term; SYMBOL <:unicode> (* ∧ *); t2 = term -> - return_term loc (Appl_symbol ("and", 0, [t1; t2])) + return_term loc (CicAst.Appl [CicAst.Symbol ("and", 0); t1; t2]) ] ]; - term: LEVEL "inv" + term: LEVEL "logic_inv" [ [ SYMBOL <:unicode> (* ¬ *); t = term -> - return_term loc (Appl_symbol ("not", 0, [t])) ] + return_term loc (CicAst.Appl [CicAst.Symbol ("not", 0); t]) + ] ]; 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 -> @@ -57,6 +61,13 @@ let _ = in Cic.Appl [ Cic.MutInd (HelmLibraryObjects.Logic.eq_URI, 0, []); - Cic.Implicit; t1; t2 - ])) + 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: *)