Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file interface.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)(** * Declarative part of the interface of CoqIDE calls to Coq *)(** * Generic structures *)typeraw=booltypeverbose=bool(** The type of coqtop goals *)typegoal={goal_id:string;(** Unique goal identifier *)goal_hyp:Pp.tlist;(** List of hypotheses *)goal_ccl:Pp.t;(** Goal conclusion *)goal_name:stringoption;(** User-level goal name *)}typeevar={evar_info:string;(** A string describing an evar: type, number, environment *)}typestatus={status_path:stringlist;(** Module path of the current proof *)status_proofname:stringoption;(** Current proof name. [None] if no focused proof is in progress *)status_allproofs:stringlist;(** List of all pending proofs. Order is not significant *)status_proofnum:int;(** An id describing the state of the current proof. *)}type'apre_goals={fg_goals:'alist;(** List of the focused goals *)bg_goals:('alist*'alist)list;(** Zipper representing the unfocused background goals *)shelved_goals:'alist;(** List of the goals on the shelf. *)given_up_goals:'alist;(** List of the goals that have been given up *)}typegoals=goalpre_goalstypehint=(string*string)list(** A list of tactics applicable and their appearance *)typeoption_name=stringlisttypeoption_value=|BoolValueofbool|IntValueofintoption|StringValueofstring|StringOptValueofstringoption(** Summary of an option status *)typeoption_state={opt_sync:bool;(** Whether an option is synchronous *)opt_depr:bool;(** Whether an option is deprecated *)opt_value:option_value;(** The current value of the option *)}typesearch_constraint=|Name_Patternofstring(** Whether the name satisfies a regexp (uses Ocaml Str syntax) *)|Type_Patternofstring(** Whether the object type satisfies a pattern *)|SubType_Patternofstring(** Whether some subtype of object type satisfies a pattern *)|In_Moduleofstringlist(** Whether the object pertains to a module *)|Include_Blacklist(** Bypass the Search blacklist *)(** A list of search constraints; the boolean flag is set to [false] whenever
the flag should be negated. *)typesearch_flags=(search_constraint*bool)list(** Subset of goals to print. *)typegoal_flags={gf_mode:string;gf_fg:bool;gf_bg:bool;gf_shelved:bool;gf_given_up:bool;}(** A named object in Coq. [coq_object_qualid] is the shortest path defined for
the user. [coq_object_prefix] is the missing part to recover the fully
qualified name, i.e [fully_qualified = coq_object_prefix + coq_object_qualid].
[coq_object_object] is the actual content of the object. *)type'acoq_object={coq_object_prefix:stringlist;coq_object_qualid:stringlist;coq_object_object:'a;}typecoq_info={coqtop_version:string;protocol_version:string;release_date:string;compile_date:string;}(* a subset of DebugHook.Action.t *)typedb_continue_opt=|StepIn|StepOver|StepOut|Continue|Interrupt(** Calls result *)typelocation=(int*int)option(* start and end of the error *)typestate_id=Stateid.ttyperoute_id=Feedback.route_id(* Obsolete *)typeedit_id=int(* The fail case carries the current state_id of the prover, the GUI
should probably retract to that point *)type'avalue=|Goodof'a|Failof(state_id*location*Pp.t)type('a,'b)union=('a,'b)Util.union(* Request/Reply message protocol between Coq and CoqIDE *)(** [add ((((s,eid),(sid,v)), bp), (line_nb, bol_pos) ] adds the phrase [s] with edit id [eid]
on top of the current edit position (that is asserted to be [sid]).
[v] set to true indicates "verbose". The response [(id,rc)] is the new state
[id] assigned to the phrase. [rc] is [Inl] if the new
state id is the tip of the edit point, or [Inr tip] if the new phrase
closes a focus and [tip] is the new edit tip. [bp], [line_nb] and [bol_pos]
are the Loc.t values for the phrase in the buffer, needed to return the correct
location for [s] to the debugger *)typeadd_sty=(((string*edit_id)*(state_id*verbose))*int)*(int*int)typeadd_rty=state_id*(unit,state_id)union(** [edit_at id] declares the user wants to edit just after [id].
The response is [Inl] if the document has been rewound to that point,
[Inr (start,(stop,tip))] if [id] is in a zone that can be focused.
In that case the zone is delimited by [start] and [stop] while [tip]
is the new document [tip]. Edits made by subsequent [add] are always
performed on top of [id]. *)typeedit_at_sty=state_idtypeedit_at_rty=(unit,state_id*(state_id*state_id))union(** [query s id] executes [s] at state [id].
query used to reply with the contents of Coq's console output, and
has been deprecated in favor of sending the query answers as
feedback. It will be removed in a future version of the protocol.
*)typequery_sty=route_id*(string*state_id)typequery_rty=unit(** Fetching the list of current goals. Return [None] if no proof is in
progress, [Some gl] otherwise. *)typegoals_sty=unittypegoals_rty=goalsoption(** Same as above, but specific kind of goals can be retrieved by setting the
flags. *)typesubgoals_sty=goal_flagstypesubgoals_rty=goalsoption(** Retrieve the list of uninstantiated evars in the current proof. [None] if no
proof is in progress. *)typeevars_sty=unittypeevars_rty=evarlistoption(** Retrieving the tactics applicable to the current goal. [None] if there is
no proof in progress. *)typehints_sty=unittypehints_rty=(hintlist*hint)option(** The status, for instance "Ready in SomeSection, proving Foo", the
input boolean (if true) forces the evaluation of all unevaluated
statements *)typestatus_sty=booltypestatus_rty=status(** Search for objects satisfying the given search flags. *)typesearch_sty=search_flagstypesearch_rty=stringcoq_objectlist(** Diffs between the proof term at a given stateid and the previous one *)typeproof_diff_sty=string*Stateid.ttypeproof_diff_rty=Pp.t(** A debugger command *)typedb_cmd_sty=stringtypedb_cmd_rty=unit(** update one or more breakpoints in the specified file *)typedb_upd_bpts_sty=((string*int)*bool)listtypedb_upd_bpts_rty=unit(** continue execution (in various ways) *)typedb_continue_sty=db_continue_opttypedb_continue_rty=unit(** fetch the stack *)typedb_stack_sty=unittypedb_stack_rty=(string*(string*intlist)option)list(** fetch variable names and values for a stack frame *)typedb_vars_sty=inttypedb_vars_rty=(string*Pp.t)list(** indicate debugger config is complete *)typedb_configd_sty=unittypedb_configd_rty=unit(** Retrieve the list of options of the current toplevel *)typeget_options_sty=unittypeget_options_rty=(option_name*option_state)list(** Set the options to the given values. Warning: this is not atomic, so whenever
the call fails, the option state can be messed up... This is the caller duty
to check that everything is correct. *)typeset_options_sty=(option_name*option_value)listtypeset_options_rty=unit(** Create a "match" template for a given inductive type.
For each branch of the match, we list the constructor name
followed by enough pattern variables. *)typemkcases_sty=stringtypemkcases_rty=stringlistlist(** Quit gracefully the interpreter. *)typequit_sty=unittypequit_rty=unit(* Initialize, and return the initial state id. The argument is the filename.
* If its directory is not in dirpath, it adds it. It also loads
* compilation hints for the filename. *)typeinit_sty=stringoptiontypeinit_rty=state_idtypeabout_sty=unittypeabout_rty=coq_infotypehandle_exn_sty=Exninfo.iexntypehandle_exn_rty=state_id*location*Pp.t(* Retrocompatibility stuff *)typeinterp_sty=(raw*verbose)*string(* spiwack: [Inl] for safe and [Inr] for unsafe. *)typeinterp_rty=state_id*(string,string)Util.uniontypestop_worker_sty=stringtypestop_worker_rty=unittypeprint_ast_sty=state_idtypeprint_ast_rty=Xml_datatype.xmltypeannotate_sty=stringtypeannotate_rty=Xml_datatype.xmltypewait_sty=unittypewait_rty=unittypehandler={add:add_sty->add_rty;edit_at:edit_at_sty->edit_at_rty;query:query_sty->query_rty;goals:goals_sty->goals_rty;evars:evars_sty->evars_rty;hints:hints_sty->hints_rty;status:status_sty->status_rty;search:search_sty->search_rty;get_options:get_options_sty->get_options_rty;set_options:set_options_sty->set_options_rty;mkcases:mkcases_sty->mkcases_rty;about:about_sty->about_rty;stop_worker:stop_worker_sty->stop_worker_rty;print_ast:print_ast_sty->print_ast_rty;annotate:annotate_sty->annotate_rty;proof_diff:proof_diff_sty->proof_diff_rty;db_cmd:db_cmd_sty->db_cmd_rty;db_upd_bpts:db_upd_bpts_sty->db_upd_bpts_rty;db_continue:db_continue_sty->db_continue_rty;db_stack:db_stack_sty->db_stack_rty;db_vars:db_vars_sty->db_vars_rty;db_configd:db_configd_sty->db_configd_rty;handle_exn:handle_exn_sty->handle_exn_rty;init:init_sty->init_rty;quit:quit_sty->quit_rty;(* for internal use (fake_id) only, do not use *)wait:wait_sty->wait_rty;(* Retrocompatibility stuff *)interp:interp_sty->interp_rty;subgoals:subgoals_sty->subgoals_rty;}