Module PdgIndex.Signature


module Signature: sig .. end
What we call a Signature a mapping between keys that represent either a function input or output, and some information.


type t_in_key =
| InCtrl (*input control point*)
| InNum of int (*parameters numbered from 1*)
| InImpl of Locations.Zone.t (*key for implicit inputs. Used in function signatures only*)
key for input elements

type t_out_key =
| OutRet (*key for the output corresponding to the return*)
| OutLoc of Locations.Zone.t (*key for output locations. used in call signatures only*)

type t_key =
| In of t_in_key
| Out of t_out_key
a key represents either an input or an output of a function.

type 'a t = {
   in_ctrl : 'a option;
   in_params : (int * 'a) list; (*implicit inputs : Maybe we should use Lmap_bitwise.Make_bitwise ? but that would make things a lot more complicated... :-?*)
   in_implicits : (Locations.Zone.t * 'a) list;
   out_ret : 'a option;
   outputs : (Locations.Zone.t * 'a) list;
}
type of a signature where 'a is the type of the information that we * want to store for each input/output.
module Str_descr: sig .. end
val empty : 'a t
build a new, empty signature
val in_key : int -> t_key
val in_impl_key : Locations.Zone.t -> t_key
val in_top_key : t_key
val in_ctrl_key : t_key
val out_ret_key : t_key
val out_key : Locations.Zone.t -> t_key
val mk_undef_in_key : Locations.Zone.t -> t_in_key
val out_loc : 'a * 'b -> 'b
val copy : 'a -> 'a
val cmp_in_key : t_in_key -> t_in_key -> int
InCtrl < InNum < InImpl
val cmp_out_key : t_out_key -> t_out_key -> int
OutRet < OutLoc
val equal_out_key : t_out_key -> t_out_key -> bool
val equal_key : t_key -> t_key -> bool
val add_in_list : ('a * 'b) list -> 'a -> 'b -> ('b -> 'b -> 'b) -> ('a * 'b) list
add a mapping between num and info in lst. if we already have something for num, use function merge
val add_loc : (Locations.Zone.t * 'a) list ->
Locations.Zone.t -> 'a -> ('a -> 'a -> 'a) -> (Locations.Zone.t * 'a) list
val add_replace : bool -> 'a -> 'b -> 'b
val add_input : 'a t ->
int -> 'a -> replace:bool -> 'a t
val add_impl_input : 'a t ->
Locations.Zone.t -> 'a -> replace:bool -> 'a t
val add_output : 'a t ->
Locations.Zone.t -> 'a -> replace:bool -> 'a t
val add_in_ctrl : 'a t -> 'a -> replace:bool -> 'a t
val add_in_top : 'a t -> 'a -> replace:bool -> 'a t
val add_out_ret : 'a t -> 'a -> replace:bool -> 'a t
val add_info : 'a t ->
t_key -> 'a -> replace:bool -> 'a t
val find_input : 'a t -> int -> 'a
val find_output : 'a t -> Locations.Zone.t -> 'a
val find_out_ret : 'a t -> 'a
val find_in_ctrl : 'a t -> 'a
val find_implicit_input : 'a t -> Locations.Zone.t -> 'a
try to find an exact match with loc. we shouldn't try to find a zone that we don't have...
val find_in_top : 'a t -> 'a
val find_in_info : 'a t -> t_in_key -> 'a
val find_out_info : 'a t -> t_out_key -> 'a
val find_info : 'a t -> t_key -> 'a
val fold_outputs : ('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_all_outputs : ('a -> t_out_key * 'b -> 'a) ->
'a -> 'b t -> 'a
val fold_num_inputs : ('a -> int * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_impl_inputs : ('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_matching_impl_inputs : Locations.Zone.t ->
('a -> Locations.Zone.t * 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_all_inputs : ('a -> t_in_key * 'b -> 'a) ->
'a -> 'b t -> 'a
val fold : ('a -> t_key * 'b -> 'a) ->
'a -> 'b t -> 'a
val merge : 'a t ->
'a t -> ('a -> 'a -> 'a) -> 'a t
val pretty_in_key : Format.formatter -> t_in_key -> unit
val pretty_out_key : Format.formatter -> t_out_key -> unit
val pretty_key : Format.formatter -> t_key -> unit
val pretty : (Format.formatter -> 'a -> unit) ->
Format.formatter -> 'a t -> unit