X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitaProof.ml;h=6c73b4b14d9cf20bc057d678add9ab036ebb14c2;hb=481992ea591bf53cba758a96e7d42e9cdce7e129;hp=5612043f3b2857b0b896673d753b345cdab356e9;hpb=b5d69130dd83587b5fb9cbb39251aaa8df8c456e;p=helm.git diff --git a/helm/matita/matitaProof.ml b/helm/matita/matitaProof.ml index 5612043f3..6c73b4b14 100644 --- a/helm/matita/matitaProof.ml +++ b/helm/matita/matitaProof.ml @@ -23,11 +23,11 @@ * http://helm.cs.unibo.it/ *) -class proofStatus ~uri ~typ = - object +class proofStatus ~typ ~metasenv ~uri () = + object (self) inherit MatitaTypes.subject - val mutable _proof = (uri, [ 1, [], typ ], Cic.Meta (1, []), typ) + val mutable _proof = (uri, (1, [], typ) :: metasenv, Cic.Meta (1, []), typ) val mutable _goal = Some 1 method proof = _proof @@ -41,11 +41,11 @@ class proofStatus ~uri ~typ = _proof <- p; _goal <- Some g - method to_xml = + method toXml = let (uri, metasenv, bo, ty) = _proof in let currentproof = (* TODO CSC: Wrong: [] is just plainly wrong *) - Cic.CurrentProof (UriManager.name_of_uri uri,metasenv,bo,ty,[]) + Cic.CurrentProof (UriManager.name_of_uri uri,metasenv, bo, ty, []) in let (acurrentproof,_,_,ids_to_inner_sorts,_,_,_) = Cic2acic.acic_object_of_cic_object ~eta_fix:false currentproof @@ -59,15 +59,38 @@ class proofStatus ~uri ~typ = in (xml, bodyxml) + method toString = + let (xml, bodyxml) = self#toXml in + let buf = Buffer.create 10240 in + Buffer.add_string buf "\n"; + Buffer.add_string buf "\n"; + Buffer.add_string buf "\n"; + Buffer.add_string buf (Misc.strip_xml_headings (Xml.pp_to_string xml)); + Buffer.add_string buf (Misc.strip_xml_headings(Xml.pp_to_string bodyxml)); + Buffer.add_string buf + (match _goal with + | None -> "" + | Some goal -> Printf.sprintf "%d" goal); + Buffer.add_string buf "\n"; + Buffer.contents buf + end -class proof ~uri ~typ = +let proofStatus ~typ ?(metasenv = []) ?(uri = MatitaTypes.untitled_con_uri) () = + new proofStatus ~typ ~metasenv ~uri () + +let proofStatus_of_string s = + MatitaTypes.not_implemented "MatitaProof.proofStatus_of_string" + +class proof ~typ ?metasenv ?uri () = object - val mutable _status = new proofStatus ~uri ~typ + val mutable _status = proofStatus ~typ ?metasenv ?uri () method status = _status method setStatus s = _status <- s end +let proof = new proof + class tacticCommand ~(tactic:ProofEngineTypes.tactic) (status: proofStatus) = object val statusBackup = status#status