Gil_syntax.Pred
GIL Predicates
type t = {
pred_name : string;
Name of the predicate
*)pred_source_path : string option;
pred_internal : bool;
pred_num_params : int;
Number of parameters
*)pred_params : (string * Gillian.Gil_syntax.Type.t option) list;
Parameter names and (optional) types
*)pred_ins : int list;
Ins
*)pred_definitions : ((string * string list) option * Gillian.Gil_syntax.Asrt.t)
list;
Predicate definitions
*)pred_facts : Gillian.Gil_syntax.Formula.t list;
Facts that hold for every definition
*)pred_guard : Gillian.Gil_syntax.Asrt.t option;
Cost for unfolding the predicate
*)pred_pure : bool;
Is the predicate pure?
*)pred_abstract : bool;
Is the predicate abstract?
*)pred_nounfold : bool;
Should the predicate be unfolded?
*)pred_normalised : bool;
Has the predicate been previously normalised?
*)}
val init : t list -> (string, t) Utils.Prelude.Hashtbl.t
Populates a Hashtbl from the given predicate list
val ins_and_outs : t -> Utils.Containers.SI.t * Utils.Containers.SI.t
Returns the sets of in- and out-parameters of a predicate
val in_params : t -> string list
Returns the names of in-parameters
val in_args : t -> 'a list -> 'a list
Returns the in-parameters given all parameters
val out_params : t -> string list
Returns the names of in-parameters
val out_args : t -> 'a list -> 'a list
Returns the out-parameters given all parameters
val pp : Stdlib.Format.formatter -> t -> unit
Pretty-printer
val check_pvars : (string, t) Utils.Prelude.Hashtbl.t -> unit
Sanity check on program variables inside normalised predicates
val explicit_param_types : (string, t) Utils.Prelude.Hashtbl.t -> t -> t
Infers parameter types and makes them explicit in the assertions
val combine_ins_outs : t -> 'a list -> 'a list -> 'a list
Combines a list of ins and a list of outs putting them in the right order according to a given predicate.
val iter_ins_outs :
t ->
('a -> unit) ->
('b -> unit) ->
('a list * 'b list) ->
unit
iter_ins_outs p f_ins f_outs (ins, outs)
will iterate, applying f_ins
on the ins
and f_outs
on the outs
, in the order specified
val pp_ins_outs :
t ->
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> 'b -> unit) ->
Stdlib.Format.formatter ->
('a list * 'b list) ->
unit
Prints the ins and outs in the right order
val get : (string, t) Utils.Prelude.Hashtbl.t -> string -> t
Retrieves a predicate definition by name
val close_token_name : t -> string
Given a guarded predicate, return the name of its close token. Fails if the predicate isn't guarded.
val close_token_call : t -> Gillian.Gil_syntax.Asrt.t
Given a guarded predicate, return a "call" to its close token. The arguments given are PVars with the same name as the ins of the predicate.