]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/interface/cicAnnotationHinter.ml
First very partial implementation of LetIn and bodyed Variables
[helm.git] / helm / interface / cicAnnotationHinter.ml
index 21f30a722b74b163652702f8ee0a2aa34afb85b5..88d4eb49c6d665f39cdee629328f7f4ed468c157 100644 (file)
@@ -75,6 +75,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 +128,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 +258,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