source: Deliverables/D2.2/8051-indexed-labels-branch/src/common/costLabel.mli @ 1297

Last change on this file since 1297 was 1297, checked in by tranquil, 8 years ago

changed representation of indexings to a nameless one implemented with arrays

File size: 1.7 KB
Line 
1
2(** This module provides functions to manipulate and create indexed cost
3    labels. *)
4               
5(** [Atom] provides functions for cost atoms, the root of indexed costs *)
6module Atom : sig
7        include StringSig.S
8end
9
10(** Simple expressions corresponding to loop tranformations.
11    TODO: leave it abstract or not? *)
12type sexpr
13
14val sexpr_id : sexpr
15
16(* trying a nameless approach *)
17type index = int
18
19type indexing = sexpr array
20
21(** [id_indexing n] generates an identity indexing nested in [n] loops *) 
22val id_indexing : int -> indexing
23
24(** [compose_index i s l] applies the transformation [i] |--> [s] to [l] *) 
25val compose_index : index -> sexpr -> indexing -> unit
26
27(** [compose_index l m] applies all the transformations in  [l] to [m] *)
28val compose_indexing : indexing -> indexing -> unit
29
30module IndexingSet : Set.S with type elt = indexing
31
32type t = {
33        name : Atom.t;
34        i : indexing
35}
36
37(** [string_of_cost_label pref t] converts an indexed label to a
38    string suitable for a label name in source
39                [string_of_cost_label ~pretty:true t] prints a more readable form *)
40val string_of_cost_label : ?pretty : bool -> t -> string
41
42(** [fresh i u] creates a fresh label using [u] as name universe, inside
43    the indexing [i] (which represents the nested loops containing the label) *)
44val fresh : indexing -> Atom.Gen.universe -> t
45
46module Set : Set.S with type elt = t
47module Map : Map.S with type key = t
48
49(** [indexings_of a s] produces the set of indexings of an atom [a] occurring
50    in the set of indexed labels [s]. *)
51val indexings_of : Atom.t -> Set.t -> IndexingSet.t
52
53(** [constant_map d x] produces a finite map which associates
54    [x] to every element of the set [d]. *)
55val constant_map : Set.t -> 'a -> 'a Map.t
56
Note: See TracBrowser for help on using the repository browser.