Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

pgm_types.mli 3.33 KB
Newer Older
1 2 3 4 5 6 7 8 9

open Why
open Util
open Ident
open Ty
open Theory
open Term
open Decl

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
(* mutable type symbols *)

type mtsymbol = private {
  mt_name  : ident;
  mt_args  : tvsymbol list;
  mt_model : ty option;
  mt_abstr : tysymbol;
}

val create_mtsymbol : preid -> tvsymbol list -> ty option -> mtsymbol

val mt_equal : mtsymbol -> mtsymbol -> bool

exception NotMutable

val get_mtsymbol : tysymbol -> mtsymbol
  (** raises [NotMutable] if [ts] is not a mutable type *)

28 29
val ts_arrow : tysymbol
    
30
(* program types *)
31
module rec T : sig
32

33
  type pre = Term.fmla
34

35 36 37 38
  type post_fmla = Term.vsymbol (* result *) * Term.fmla
  type exn_post_fmla = Term.vsymbol (* result *) option * Term.fmla
      
  type esymbol = lsymbol
39

40 41 42 43 44
  type post = post_fmla * (esymbol * exn_post_fmla) list
      
  type type_v = private
  | Tpure    of ty
  | Tarrow   of pvsymbol list * type_c
45

46 47 48 49 50 51
  and type_c = { 
    c_result_type : type_v;
    c_effect      : E.t;
    c_pre         : pre;
    c_post        : post; 
  }
52

53 54 55 56 57 58
  and pvsymbol = private {
    pv_name : ident;
    pv_tv   : type_v;
    pv_ty   : ty;      (* as a logic type, for typing purposes only *)
    pv_vs   : vsymbol; (* for use in the logic *)
  }
59

60 61
  val tpure  : ty -> type_v
  val tarrow : pvsymbol list -> type_c -> type_v
62

63
  val create_pvsymbol : preid -> ?vs:vsymbol -> type_v -> pvsymbol
64

65
  (* program symbols *)
66

67 68 69 70 71 72 73 74
  type psymbol = private {
    p_name : ident;
    p_tv   : type_v;
    p_ty   : ty;      (* as a logic type, for typing purposes only *)
    p_ls   : lsymbol; (* for use in the logic *) 
  }
      
  val create_psymbol : preid -> type_v -> psymbol
75

76
  val p_equal : psymbol -> psymbol -> bool
77

78
  (* program types -> logic types *)
79

80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
  val purify : ty -> ty
  val purify_type_v : ?logic:bool -> type_v -> ty
    (** when [logic] is [true], mutable types are turned into their models *)
    
  (* operations on program types *)
    
  val apply_type_v_var : type_v -> pvsymbol -> type_c
  val apply_type_v_sym : type_v -> psymbol  -> type_c
    
  val occur_type_v : R.t -> type_v -> bool
    
  val v_result : ty -> vsymbol
  val exn_v_result : Why.Term.lsymbol -> Why.Term.vsymbol option
    
  val post_map : (fmla -> fmla) -> post -> post
    
  val subst1 : vsymbol -> term -> term Mvs.t
    
  val eq_type_v : type_v -> type_v -> bool
99

100
  (* pretty-printers *)
101

102 103 104
  val print_type_v : Format.formatter -> type_v -> unit
  val print_type_c : Format.formatter -> type_c -> unit
  val print_post   : Format.formatter -> post   -> unit
105

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
end 

and Mpv :  sig include Map.S with type key = T.pvsymbol end

(* references *)
and R : sig

  type t = 
    | Rlocal  of T.pvsymbol
    | Rglobal of T.psymbol

  val type_of : t -> ty

  val name_of : t -> ident

end 
and Sref : sig include Set.S with type elt = R.t end
and Mref : sig include Map.S with type key = R.t end
and Sexn : sig include Set.S with type elt = T.esymbol end

(* effects *)
and E : sig
128

129 130 131 132 133
  type t = private {
    reads  : Sref.t;
    writes : Sref.t;
    raises : Sexn.t;
  }
134

135
  val empty : t
136

137 138 139
  val add_read  : R.t -> t -> t
  val add_write : R.t -> t -> t
  val add_raise : T.esymbol -> t -> t
140

141 142
  val remove_reference : R.t -> t -> t    
  val filter : (R.t -> bool) -> t -> t
143

144
  val remove_raise : T.esymbol -> t -> t
145

146
  val union : t -> t -> t
147

148 149 150 151 152
  val equal : t -> t -> bool
    
  val no_side_effect : t -> bool
    
  val subst : R.t Mpv.t -> t -> t
153

154
  val occur : R.t -> t -> bool
155

156
end 
157 158