]> matita.cs.unibo.it Git - helm.git/blobdiff - components/cic_disambiguation/doc/precedence.txt
branch for universe
[helm.git] / components / cic_disambiguation / doc / precedence.txt
diff --git a/components/cic_disambiguation/doc/precedence.txt b/components/cic_disambiguation/doc/precedence.txt
new file mode 100644 (file)
index 0000000..09efea8
--- /dev/null
@@ -0,0 +1,32 @@
+
+Input                  Should be parsed as             Derived constraint
+                                                       on precedence
+--------------------------------------------------------------------------------
+\lambda x.x y          \lambda x.(x y)               lambda > apply
+S x = y                  (= (S x) y)                   apply  > infix operators
+\forall x.x=x         (\forall x.(= x x))             infix operators > binders
+\lambda x.x \to x    \lambda. (x \to x)                \to > \lambda
+--------------------------------------------------------------------------------
+
+Precedence total order:
+
+  apply > infix operators > to > binders
+
+where binders are all binders except lambda (i.e. \forall, \pi, \exists)
+
+to test:
+  
+./test_parser term << EOT 
+  \lambda x.x y
+  S x = y
+  \forall x.x=x
+  \lambda x.x \to x
+EOT
+  
+should respond with:
+  
+  \lambda x.(x y)
+  (eq (S x) y)
+  \forall x.(eq x x)
+  \lambda x.(x \to x)
+