Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
caisar
Commits
a4fbc543
Commit
a4fbc543
authored
4 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
Consider raw options as a string list rather than a mere string.
parent
29d7c577
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
main.ml
+3
-2
3 additions, 2 deletions
main.ml
solver.ml
+27
-29
27 additions, 29 deletions
solver.ml
solver.mli
+2
-2
2 additions, 2 deletions
solver.mli
with
32 additions
and
33 deletions
main.ml
+
3
−
2
View file @
a4fbc543
...
...
@@ -67,7 +67,7 @@ let verify cmd raw_options config_file model property solver () =
Model
.
build
~
filename
:
model
>>=
fun
model
->
Property
.
build
~
filename
:
property
>>=
fun
property
->
Solver
.
get_config
solver
~
file
:
config_file
>>=
fun
config
->
Solver
.
exec
?
raw_options
config
model
property
Solver
.
exec
~
raw_options
config
model
property
in
match
do_verify
()
with
|
Ok
()
->
Logs
.
app
(
fun
m
->
m
"Done."
)
...
...
@@ -144,7 +144,8 @@ let verify_cmd =
in
let
solver_raw_options
=
let
doc
=
"Additional options provided to the solver."
in
Arg
.(
value
&
opt
(
some
string
)
None
&
info
[
"raw"
;
"raw-options"
]
~
doc
)
Arg
.(
value
&
opt
(
list
~
sep
:
'
'
string
)
[]
&
info
[
"raw"
;
"raw-options"
]
~
doc
)
in
let
config_filename
=
let
doc
=
"$(b,FILE) to read the configuration from."
in
...
...
This diff is collapsed.
Click to expand it.
solver.ml
+
27
−
29
View file @
a4fbc543
...
...
@@ -286,7 +286,7 @@ let check_compatibility config model =
|
_
->
Ok
()
let
build_command
?
raw_options
confg_solver
property
model
=
let
build_command
~
raw_options
confg_solver
property
model
=
let
module
Filename
=
Caml
.
Filename
in
let
open
Result
in
let
solver
=
confg_solver
.
solver
in
...
...
@@ -307,46 +307,44 @@ let build_command ?raw_options confg_solver property model =
(* Build actual command-line. *)
try
let
cmd
=
let
raw_options
=
Option
.
to_list
raw_options
in
let
exe
=
confg_solver
.
exe
in
match
solver
with
|
Pyrat
->
let
verbose
=
match
Logs
.
level
()
with
|
None
|
Some
(
App
|
Error
|
Warning
)
->
false
|
Some
(
Info
|
Debug
)
->
true
in
Filename
.
quote_command
exe
(
model
.
Model
.
filename
::
prop
::
if
verbose
then
"--verbose"
::
raw_options
else
raw_options
)
|
Marabou
->
let
verbosity_level
=
match
Logs
.
level
()
with
|
None
|
Some
(
App
|
Error
|
Warning
)
->
0
|
Some
Info
->
1
|
Some
Debug
->
2
in
Filename
.
quote_command
exe
(
"--property"
::
prop
::
"--input"
::
model
.
Model
.
filename
::
"--verbosity"
::
Int
.
to_string
verbosity_level
::
raw_options
)
let
args
=
match
solver
with
|
Pyrat
->
let
verbose
=
match
Logs
.
level
()
with
|
None
|
Some
(
App
|
Error
|
Warning
)
->
false
|
Some
(
Info
|
Debug
)
->
true
in
model
.
Model
.
filename
::
prop
::
if
verbose
then
"--verbose"
::
raw_options
else
raw_options
|
Marabou
->
let
verbosity_level
=
match
Logs
.
level
()
with
|
None
|
Some
(
App
|
Error
|
Warning
)
->
0
|
Some
Info
->
1
|
Some
Debug
->
2
in
"--property"
::
prop
::
"--input"
::
model
.
Model
.
filename
::
"--verbosity"
::
Int
.
to_string
verbosity_level
::
raw_options
in
Filename
.
quote_command
exe
args
in
Ok
(
prop
,
cmd
)
with
Failure
e
->
Error
(
Format
.
sprintf
"Unexpected failure@ `%s'."
e
)
let
exec
?
raw_options
config
model
property
=
let
exec
~
raw_options
config
model
property
=
let
open
Result
in
(* Check solver availability. *)
check_availability
config
>>=
fun
()
->
(* Check solver and model compatibility. *)
check_compatibility
config
model
>>=
fun
()
->
(* Build the required command-line. *)
build_command
?
raw_options
config
property
model
>>=
fun
(
tmp
,
cmd
)
->
build_command
~
raw_options
config
property
model
>>=
fun
(
tmp
,
cmd
)
->
(* Execute the command. *)
begin
try
...
...
This diff is collapsed.
Click to expand it.
solver.mli
+
2
−
2
View file @
a4fbc543
...
...
@@ -23,9 +23,9 @@ type config
the given [file]. *)
val
get_config
:
file
:
string
->
solver
->
(
config
,
string
)
Result
.
t
(** [exec
?
raw_options config model property] runs a solver wrt the given
(** [exec
~
raw_options config model property] runs a solver wrt the given
[config] on [property] for [model] with the provided [raw_options], if any.
*)
val
exec
:
?
raw_options
:
string
->
raw_options
:
string
list
->
config
->
Model
.
t
->
Property
.
t
->
(
unit
,
string
)
Result
.
t
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment