forked from cubicle-model-checker/cubicle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbwd.mli
80 lines (59 loc) · 2.66 KB
/
bwd.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
(**************************************************************************)
(* *)
(* Cubicle *)
(* *)
(* Copyright (C) 2011-2014 *)
(* *)
(* Sylvain Conchon and Alain Mebsout *)
(* Universite Paris-Sud 11 *)
(* *)
(* *)
(* This file is distributed under the terms of the Apache Software *)
(* License version 2.0 *)
(* *)
(**************************************************************************)
open Options
open Format
open Ast
(** Backward reachability with approximation
This algorithm of backward reachability performs approxmations guided by an
oracle. It is parameterized by a structure of priority queue to define a
search strategy.
*)
module type PriorityNodeQueue = sig
type t
val create : unit -> t
val pop : t -> Node.t
val push : Node.t -> t -> unit
val push_list : Node.t list -> t -> unit
val clear : t -> unit
val length : t -> int
val is_empty : t -> bool
end
type result =
| Safe of Node.t list * Node.t list
(** The system is safe and we return the set of visited nodes and the
inferred invariants *)
| Unsafe of Node.t * Node.t list
(** The system is unsafe and we return the faulty node and the full list of
candidate invariants that were considered *)
(** {2 Strategies } *)
module type Strategy = sig
val search : ?invariants:Node.t list -> ?candidates:Node.t list ->
t_system -> result
(** Backward reachability search on a system. The user can also provide
invariants that are true of the system to help the search. Candidate
invariants can also be provided, they will be proven as real invariants
if necessary. *)
end
module Make ( Q : PriorityNodeQueue ) : Strategy
(** Functor for creating a strategy given a priority queue *)
(** {3 Predefined Strategies } *)
module BFS : Strategy
module DFS : Strategy
module BFSH : Strategy
module DFSH : Strategy
module BFSA : Strategy
module DFSA : Strategy
module Selected : Strategy
(** Strategy selected by the options of the command line *)