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
3a593054
Commit
3a593054
authored
1 year ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[verification] Factor out code for building the prover command.
parent
293ef4db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/verification.ml
+15
-12
15 additions, 12 deletions
src/verification.ml
with
15 additions
and
12 deletions
src/verification.ml
+
15
−
12
View file @
3a593054
...
@@ -149,10 +149,19 @@ let answer_aimos limit config env config_prover dataset task =
...
@@ -149,10 +149,19 @@ let answer_aimos limit config env config_prover dataset task =
let
additional_info
=
Generic
None
in
let
additional_info
=
Generic
None
in
(
answer
,
additional_info
)
(
answer
,
additional_info
)
let
nnet_or_onnx
=
Re__Core
.(
compile
(
str
"%{nnet-onnx}"
))
let
re_
nnet_or_onnx
=
Re__Core
.(
compile
(
str
"%{nnet-onnx}"
))
let
config
_re
=
Re__Core
.(
compile
(
str
"%{config}"
))
let
re_
config
=
Re__Core
.(
compile
(
str
"%{config}"
))
let
config_site
=
List
.
hd_exn
Dirs
.
Sites
.
config
let
config_site
=
List
.
hd_exn
Dirs
.
Sites
.
config
let
build_command
config_prover
~
nn_filename
=
let
command
=
Whyconf
.
get_complete_command
~
with_steps
:
false
config_prover
in
let
command
=
Re__Core
.
replace_string
re_nnet_or_onnx
~
by
:
(
Unix
.
realpath
nn_filename
)
command
in
Re__Core
.
replace_string
re_config
~
by
:
config_site
command
let
call_prover_on_task
limit
config
command
driver
task
=
let
call_prover_on_task
limit
config
command
driver
task
=
let
prover_call
=
let
prover_call
=
Driver
.
prove_task_prepared
~
command
~
config
~
limit
driver
task
Driver
.
prove_task_prepared
~
command
~
config
~
limit
driver
task
...
@@ -193,10 +202,8 @@ let answer_dataset limit config env prover config_prover driver dataset task =
...
@@ -193,10 +202,8 @@ let answer_dataset limit config env prover config_prover driver dataset task =
Dataset
.
tasks_of_nn_csv_predicate
env
dataset_predicate
Dataset
.
tasks_of_nn_csv_predicate
env
dataset_predicate
|>
List
.
map
~
f
:
(
Driver
.
prepare_task
driver
)
|>
List
.
map
~
f
:
(
Driver
.
prepare_task
driver
)
in
in
let
command
=
Whyconf
.
get_complete_command
~
with_steps
:
false
config_prover
in
let
command
=
let
command
=
let
nn_file
=
Unix
.
realpath
dataset_predicate
.
model
.
filename
in
build_command
config_prover
~
nn_filename
:
dataset_predicate
.
model
.
filename
Re__Core
.
replace_string
nnet_or_onnx
~
by
:
nn_file
command
in
in
let
dataset_answers
=
let
dataset_answers
=
match
prover
with
match
prover
with
...
@@ -231,9 +238,9 @@ let answer_generic limit config prover config_prover driver ~proof_strategy task
...
@@ -231,9 +238,9 @@ let answer_generic limit config prover config_prover driver ~proof_strategy task
let
answers
=
let
answers
=
List
.
concat_map
tasks
~
f
:
(
fun
task
->
List
.
concat_map
tasks
~
f
:
(
fun
task
->
let
task
=
Driver
.
prepare_task
driver
task
in
let
task
=
Driver
.
prepare_task
driver
task
in
let
nn_file
=
let
nn_file
name
=
match
Task
.
on_meta_excl
Utils
.
meta_nn_filename
task
with
match
Task
.
on_meta_excl
Utils
.
meta_nn_filename
task
with
|
Some
[
MAstr
nn_file
]
->
Unix
.
realpath
nn_file
|
Some
[
MAstr
nn_file
name
]
->
nn_file
name
|
Some
_
->
assert
false
(* By construction of the meta. *)
|
Some
_
->
assert
false
(* By construction of the meta. *)
|
None
->
invalid_arg
"No neural network model found in task"
|
None
->
invalid_arg
"No neural network model found in task"
in
in
...
@@ -245,11 +252,7 @@ let answer_generic limit config prover config_prover driver ~proof_strategy task
...
@@ -245,11 +252,7 @@ let answer_generic limit config prover config_prover driver ~proof_strategy task
|
Pyrat
|
Nnenum
|
ABCrown
->
Trans
.
apply
Split
.
split_premises
task
|
Pyrat
|
Nnenum
|
ABCrown
->
Trans
.
apply
Split
.
split_premises
task
|
_
->
[
task
]
|
_
->
[
task
]
in
in
let
command
=
let
command
=
build_command
config_prover
~
nn_filename
in
Whyconf
.
get_complete_command
~
with_steps
:
false
config_prover
in
let
command
=
Re__Core
.
replace_string
nnet_or_onnx
~
by
:
nn_file
command
in
let
command
=
Re__Core
.
replace_string
config_re
~
by
:
config_site
command
in
List
.
map
tasks
~
f
:
(
call_prover_on_task
limit
config
command
driver
))
List
.
map
tasks
~
f
:
(
call_prover_on_task
limit
config
command
driver
))
in
in
let
prover_answer
=
combine_prover_answers
answers
in
let
prover_answer
=
combine_prover_answers
answers
in
...
...
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