-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds
is_available
flag to know which solvers are installed
- Loading branch information
Showing
13 changed files
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1065,4 +1065,6 @@ module Fresh = struct | |
end | ||
end | ||
let is_available = true | ||
include Fresh.Make () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -349,6 +349,8 @@ module Nop = struct | |
end | ||
end | ||
|
||
let is_available = false | ||
|
||
include Make () | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,45 @@ | ||
(* TODO: put this in some other more appropriate module? *) | ||
type solver_type = | ||
| Z3_solver | ||
| Cvc5_solver | ||
| Colibri2_solver | ||
| Bitwuzla_solver | ||
| Colibri2_solver | ||
| Cvc5_solver | ||
|
||
let mappings_of_solver : solver_type -> (module Mappings_intf.S_with_fresh) = | ||
function | ||
| Z3_solver -> (module Z3_mappings) | ||
| Cvc5_solver -> (module Cvc5_mappings) | ||
| Colibri2_solver -> (module Colibri2_mappings) | ||
| Bitwuzla_solver -> (module Bitwuzla_mappings) | ||
| Colibri2_solver -> (module Colibri2_mappings) | ||
| Cvc5_solver -> (module Cvc5_mappings) | ||
|
||
let solver_type_of_string (s : string) : | ||
(solver_type, [> `Msg of string ]) result = | ||
match String.map Char.lowercase_ascii s with | ||
| "z3" -> Ok Z3_solver | ||
| "colibri2" -> Ok Colibri2_solver | ||
| "bitwuzla" -> Ok Bitwuzla_solver | ||
| "colibri2" -> Ok Colibri2_solver | ||
| "cvc5" -> Ok Cvc5_solver | ||
| s -> Error (`Msg (Format.sprintf "unknown solver %s" s)) | ||
|
||
let is_available : solver_type -> bool = function | ||
| Z3_solver -> Z3_mappings.is_available | ||
| Bitwuzla_solver -> Bitwuzla_mappings.is_available | ||
| Colibri2_solver -> Colibri2_mappings.is_available | ||
| Cvc5_solver -> Cvc5_mappings.is_available | ||
|
||
(** List of all available solvers *) | ||
let available_solvers : solver_type list = | ||
List.filter is_available | ||
[ Z3_solver; Bitwuzla_solver; Colibri2_solver; Cvc5_solver ] | ||
|
||
(** Returns first available solver or errors when none exist *) | ||
let solver : ((module Mappings_intf.S_with_fresh), [> `Msg of string ]) result = | ||
match available_solvers with | ||
| [] -> Error (`Msg "no available solver") | ||
| solver :: _ -> Ok (mappings_of_solver solver) | ||
|
||
let pp_solver_type fmt = function | ||
| Z3_solver -> Format.fprintf fmt "Z3" | ||
| Cvc5_solver -> Format.fprintf fmt "CVC5" | ||
| Colibri2_solver -> Format.fprintf fmt "Colibri2" | ||
| Bitwuzla_solver -> Format.fprintf fmt "Bitwuzla" | ||
| Colibri2_solver -> Format.fprintf fmt "Colibri2" | ||
| Cvc5_solver -> Format.fprintf fmt "cvc5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -816,4 +816,6 @@ module Fresh = struct | |
end | ||
end | ||
|
||
let is_available = true | ||
|
||
include Fresh.Make () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,6 +472,8 @@ module M = struct | |
end | ||
end | ||
|
||
let is_available = true | ||
|
||
include Make () | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters