]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_transformations/cexpr2pres_hashtbl.ml
Notation for Rdiv and Rminus.
[helm.git] / helm / ocaml / cic_transformations / cexpr2pres_hashtbl.ml
index 657464270b727a8421c2f747a225127eabbbe423..676b55dc4755d82783ff44a04d3f8c07eaa726b2 100644 (file)
@@ -415,5 +415,34 @@ Hashtbl.add C2P.symbol_table_charcount "minus" (binary
        P.two_rows_table_without_brackets aattr
          (cexpr2pres_charcount ~priority:60 ~assoc:true ~tail:[] a)
          (cexpr2pres_charcount ~priority:60 ~assoc:false ~tail:tail b)
-         (P.Mo(sattr,"-"))))
+         (P.Mo(sattr,"-"))));
+
+(* div *)
+Hashtbl.add C2P.symbol_table "div" (binary
+  (fun a b ~priority ~assoc ~tail aattr sattr ->
+     if (priority > 60) || (priority = 60 && assoc) then
+       P.row_with_brackets aattr
+         (cexpr2pres ~priority:60 ~assoc:true ~tail:[] a)
+         (cexpr2pres ~priority:60 ~assoc:false 
+            ~tail:(P.Mtext([],")")::tail) b)
+         (P.Mo(sattr,"/"))
+     else 
+       P.row_without_brackets aattr
+         (cexpr2pres ~priority:60 ~assoc:true ~tail:[] a)
+         (cexpr2pres ~priority:60 ~assoc:false ~tail:tail b)
+         (P.Mo(sattr,"/"))));
+
+Hashtbl.add C2P.symbol_table_charcount "div" (binary
+  (fun a b ~priority ~assoc ~tail aattr sattr ->
+     if (priority > 60) || (priority = 60 && assoc) then
+       P.two_rows_table_with_brackets aattr
+         (cexpr2pres_charcount ~priority:60 ~assoc:true ~tail:[] a)
+         (cexpr2pres_charcount ~priority:60 ~assoc:false 
+           ~tail:(P.Mtext([],")")::tail) b)
+         (P.Mo(sattr,"/"))
+     else
+       P.two_rows_table_without_brackets aattr
+         (cexpr2pres_charcount ~priority:60 ~assoc:true ~tail:[] a)
+         (cexpr2pres_charcount ~priority:60 ~assoc:false ~tail:tail b)
+         (P.Mo(sattr,"/"))))
 ;;