From a96ac1d9b14c89392c5672fb94944363ced625b8 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Wed, 28 Apr 2004 14:11:51 +0000 Subject: [PATCH] - split logic operators away from aritmetic ones so that \forall n:nat. n > 0 \or n = 0 is parsed "correctly" --- helm/ocaml/cic_disambiguation/cicTextualParser2.ml | 3 +++ helm/ocaml/cic_disambiguation/logic_notation.ml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index 76f62b417..8bb732a58 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -176,6 +176,9 @@ 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]) diff --git a/helm/ocaml/cic_disambiguation/logic_notation.ml b/helm/ocaml/cic_disambiguation/logic_notation.ml index 073e2cdf3..2227b2741 100644 --- a/helm/ocaml/cic_disambiguation/logic_notation.ml +++ b/helm/ocaml/cic_disambiguation/logic_notation.ml @@ -26,19 +26,19 @@ open CicTextualParser2 EXTEND - term: LEVEL "add" + term: LEVEL "logic_add" [ [ t1 = term; SYMBOL <:unicode> (* ∨ *); t2 = term -> 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 (CicAst.Appl [CicAst.Symbol ("and", 0); t1; t2]) ] ]; - term: LEVEL "inv" + term: LEVEL "logic_inv" [ [ SYMBOL <:unicode> (* ¬ *); t = term -> return_term loc (CicAst.Appl [CicAst.Symbol ("not", 0); t]) -- 2.39.2