Frama-C API - Tactical
Tactics Entry Points
Tactical
Tactical Selection
type process = Conditions.sequent -> (string * Conditions.sequent) listtype selection = | Empty| Clause of clause| Inside of clause * Lang.F.term| Compose of compose| Multi of selection list
and compose = private | Cint of Frama_c_kernel.Z.t| Range of int * int| Code of Lang.F.term * string * selection list
val int : int -> selectionval cint : Frama_c_kernel.Z.t -> selectionval range : int -> int -> selectionval get_int : selection -> int optionval get_bool : selection -> bool optionval head : clause -> Lang.F.predval is_empty : selection -> boolval selected : selection -> Lang.F.termval subclause : clause -> Lang.F.pred -> boolWhen subclause clause p, we have clause = Step H and H -> p, or clause = Goal G and p -> G.
val pp_clause : Stdlib.Format.formatter -> clause -> unitDebug only
val pp_selection : Stdlib.Format.formatter -> selection -> unitDebug only
Tactical Parameters
module Fmap : sig ... endTactical Parameter Editors
type 'a finder = string -> 'a namedval ident : 'a field -> stringval default : 'a field -> 'aval pident : parameter -> stringval checkbox : id:string -> title:string -> descr:string -> ?default:bool -> unit -> bool field * parameterUnless specified, default is false.
val spinner : id:string -> title:string -> descr:string -> ?default:int -> ?vmin:int -> ?vmax:int -> ?vstep:int -> unit -> int field * parameterUnless specified, default is vmin or 0 or vmax, whichever fits. Range must be non-empty, and default shall fit in.
val selector : id:string -> title:string -> descr:string -> ?default:'a -> options:'a named list -> ?equal:('a -> 'a -> bool) -> unit -> 'a field * parameterUnless specified, default is head option. Default equality is (=). Options must be non-empty.
val composer : id:string -> title:string -> descr:string -> ?default:selection -> ?filter:(Lang.F.term -> bool) -> unit -> selection field * parameterUnless specified, default is Empty selection.
val search : id:string -> title:string -> descr:string -> browse:'a browser -> find:'a finder -> unit -> 'a named option field * parameterSearch field.
browse s nis the lookup function, used in the GUI only. Shall returns at mostnresults applying to selections.find nis used at script replay, and shall retrieve the selected item'sidlater on.
class type feedback = object ... endTactical Utilities
val at : selection -> int optionval insert : ?at:int -> (string * Lang.F.pred) list -> processval replace : at:int -> (string * Conditions.condition) list -> processval replace_single : at:int -> (string * Conditions.condition) -> Conditions.sequent -> string * Conditions.sequentval replace_step : at:int -> Conditions.condition list -> processval split : (string * Lang.F.pred) list -> processval rewrite : ?at:int -> (string * Lang.F.pred * Lang.F.term * Lang.F.term) list -> processFor each pattern (descr,guard,src,tgt) replace src with tgt under condition guard, inserted in position at.
val condition : string -> Lang.F.pred -> process -> processApply process, but only after proving some condition
Tactical Plug-in
class type tactical = object ... endComposer Factory
class type composer = object ... endGlobal Registry
type t = tacticalval register : tactical -> unitval iter : (tactical -> unit) -> unitval lookup : id:string -> tacticaltype computer = Lang.F.term list -> Lang.F.termval add_computer : string -> computer -> unitval add_composer : composer -> unitval iter_composer : (composer -> unit) -> unit