]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/cicAnnotationHinter.ml
new MathQL syntax
[helm.git] / helm / interface / cicAnnotationHinter.ml
index 21f30a722b74b163652702f8ee0a2aa34afb85b5..86bcb4588b163202ed176b4a7855d749182777d5 100644 (file)
@@ -1,3 +1,28 @@
+(* Copyright (C) 2000, HELM Team.
+ * 
+ * This file is part of HELM, an Hypertextual, Electronic
+ * Library of Mathematics, developed at the Computer Science
+ * Department, University of Bologna, Italy.
+ * 
+ * HELM is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * HELM is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HELM; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ * MA  02111-1307, USA.
+ * 
+ * For details, see the HELM World-Wide-Web page,
+ * http://cs.unibo.it/helm/.
+ *)
+
 (******************************************************************************)
 (*                                                                            *)
 (*                               PROJECT HELM                                 *)
@@ -75,6 +100,7 @@ let get_id annterm =
    | C.ACast (id,_,_,_)            -> id
    | C.AProd (id,_,_,_,_)          -> id
    | C.ALambda (id,_,_,_,_)        -> id
+   | C.ALetIn (id,_,_,_,_)         -> id
    | C.AAppl (id,_,_)              -> id
    | C.AConst (id,_,_,_)           -> id
    | C.AAbst (id,_,_)              -> id
@@ -127,6 +153,15 @@ let create_hint_from_term annotation_window annterm =
            "Body", "<node id = '" ^ boid ^ "'/>" ;
            "Type", "<node id = '" ^ tyid ^ "'/>"
         |]
+   | C.ALetIn (id,_,_,ty,bo) ->
+      let boid = get_id bo
+      and tyid = get_id ty in
+       link_hints annotation_window
+        [| "Binder",
+            "<attribute child = '2' name = 'binder' id = '" ^ id ^ "'/>" ;
+           "Term", "<node id = '" ^ boid ^ "'/>" ;
+           "Target", "<node id = '" ^ tyid ^ "'/>"
+        |]
    | C.AAppl (id,_,args) ->
       let argsid =
        Array.mapi
@@ -248,12 +283,21 @@ let create_hint_from_obj annotation_window annobj =
            "Ingredients", "<attribute name = 'params' id = '" ^ id ^ "'/>" ;
            "Type", "<node id = '" ^ tyid ^ "'/>"
         |]
-   | C.AVariable (id,_,_,ty) ->
+   | C.AVariable (id,_,_,bo,ty) ->
       let tyid = get_id ty in
        link_hints annotation_window
-        [| "Name", "<attribute name = 'name' id = '" ^ id ^ "'/>" ;
-           "Type", "<node id = '" ^ tyid ^ "'/>"
-        |]
+        (match bo with
+            None ->
+             [| "Name", "<attribute name = 'name' id = '" ^ id ^ "'/>" ;
+                "Type", "<node id = '" ^ tyid ^ "'/>"
+             |]
+          | Some bo ->
+             let boid = get_id bo in
+              [| "Name", "<attribute name = 'name' id = '" ^ id ^ "'/>" ;
+                 "Body", "<node id = '" ^ boid ^ "'/>" ;
+                 "Type", "<node id = '" ^ tyid ^ "'/>"
+              |]
+        )
    | C.ACurrentProof (id,_,_,conjs,bo,ty) ->
       let boid = get_id bo
       and tyid = get_id ty