1 (********************************************************************)
3 (* The Why3 Verification Platform / The Why3 Development Team *)
4 (* Copyright 2010-2023 -- Inria - CNRS - Paris-Saclay University *)
6 (* This software is distributed under the terms of the GNU Lesser *)
7 (* General Public License version 2.1, with the special exception *)
8 (* on linking described in file LICENSE. *)
10 (********************************************************************)
14 type ident
= Ptree.ident
16 type label
= Ptree.ident
18 type loop_clause
= Invariant
| Variant
21 cfg_instr_desc
: cfg_instr_desc
;
22 cfg_instr_loc
: Loc.position
;
26 cfg_term_desc
: cfg_term_desc
;
27 cfg_term_loc
: Loc.position
;
31 | CFGinvariant
of (loop_clause
* ident
option * Ptree.term
* int option ref) list
32 (** possibly named invariants *)
33 | CFGexpr
of Ptree.expr
34 (** any other regular WhyML expressions *)
38 (** goto a label "goto L" *)
39 | CFGswitch
of Ptree.expr
* switch_branch list
40 (** pattern-matching *)
41 | CFGreturn
of Ptree.expr
42 (** return from a cfg *)
46 and switch_branch
= Ptree.pattern
* cfg_term
47 (** pattern -> regular WhyML expression ; goto ident *)
49 and block
= (cfg_instr list
* cfg_term
)
53 cf_args
: Ptree.binder list
;
56 cf_pat
: Ptree.pattern
;
58 cf_attrs
: Ptree.attr list
;
59 cf_locals
: (bool * ident
* Ptree.pty
* Ptree.expr
option) list
;
61 cf_blocks
: (label
* block
) list
;
65 | Dmlw_decl
of Ptree.decl
66 | Dletcfg
of cfg_fundef
67 | Dreccfg
of cfg_fundef list
68 | Dscope
of Loc.position
* bool * ident
* cfg_decl list
70 type cfg_file
= (ident
* cfg_decl list
) list
71 (** a list of modules containing lists of declarations *)