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
264d6732
Commit
264d6732
authored
4 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
Avoid to index subgoals when not needed.
parent
712afe63
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
engine.ml
+28
-13
28 additions, 13 deletions
engine.ml
with
28 additions
and
13 deletions
engine.ml
+
28
−
13
View file @
264d6732
...
@@ -18,8 +18,9 @@ type task = {
...
@@ -18,8 +18,9 @@ type task = {
(* Original goal name. *)
(* Original goal name. *)
goalname
:
string
;
goalname
:
string
;
(* Subgoal identifier.
(* Subgoal identifier.
Typically a goal is translated to multiple subgoals by a solver. *)
Typically a goal is translated to multiple subgoals by a solver.
subgoal
:
int
;
[None] means the goal has no subgoals. *)
subgoal
:
int
option
;
(* The formula to verify. *)
(* The formula to verify. *)
formula
:
string
;
formula
:
string
;
(* Verification result.
(* Verification result.
...
@@ -70,6 +71,20 @@ let check_compatibility solver model =
...
@@ -70,6 +71,20 @@ let check_compatibility solver model =
let
tasks_of_property
solver
{
axioms
;
goals
}
=
let
tasks_of_property
solver
{
axioms
;
goals
}
=
let
module
S
=
(
val
solver
:
Solver
.
S
)
in
let
module
S
=
(
val
solver
:
Solver
.
S
)
in
let
make_task
goalname
subgoal
formula
=
let
id
=
Format
.
sprintf
"%s%s"
goalname
(
Option
.
value_map
subgoal
~
default
:
""
~
f
:
(
fun
idx
->
Format
.
sprintf
".%d"
idx
))
in
{
id
;
goalname
;
subgoal
;
formula
=
Format
.
asprintf
"%a"
S
.
pretty
formula
;
result
=
None
;
}
in
let
hypothesis
=
let
hypothesis
=
match
axioms
with
match
axioms
with
|
[]
->
|
[]
->
...
@@ -86,14 +101,9 @@ let tasks_of_property solver { axioms; goals } =
...
@@ -86,14 +101,9 @@ let tasks_of_property solver { axioms; goals } =
~
f
:
(
fun
{
name
;
formula
;
}
->
~
f
:
(
fun
{
name
;
formula
;
}
->
let
elts
=
S
.(
repr
(
translate
~
hypothesis
~
goal
:
formula
))
in
let
elts
=
S
.(
repr
(
translate
~
hypothesis
~
goal
:
formula
))
in
let
tasks
=
let
tasks
=
List
.
mapi
if
List
.
length
elts
=
1
elts
then
[
make_task
name
None
(
List
.
hd_exn
elts
)
]
~
f
:
(
fun
idx
elt
->
else
List
.
mapi
elts
~
f
:
(
fun
idx
elt
->
make_task
name
(
Some
idx
)
elt
)
{
id
=
Format
.
sprintf
"%s.%d"
name
idx
;
goalname
=
name
;
subgoal
=
idx
;
formula
=
Format
.
asprintf
"%a"
S
.
pretty
elt
;
result
=
None
;
})
in
in
Hashtbl
.
set
table
~
key
:
name
~
data
:
tasks
);
Hashtbl
.
set
table
~
key
:
name
~
data
:
tasks
);
table
table
...
@@ -174,8 +184,13 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
...
@@ -174,8 +184,13 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
tasks
tasks
~
f
:
(
fun
task
->
~
f
:
(
fun
task
->
Logs
.
app
(
fun
m
->
Logs
.
app
(
fun
m
->
m
"Verifying goal `%s', subgoal %d (%s)."
m
"Verifying goal `%s'%s."
task
.
goalname
task
.
subgoal
task
.
id
);
task
.
goalname
(
Option
.
value_map
task
.
subgoal
~
default
:
""
~
f
:
(
fun
subgoal
->
Format
.
sprintf
", subgoal %d (%s)"
subgoal
task
.
id
)));
let
res_exec_task
=
let
res_exec_task
=
(* Build the required command-line. *)
(* Build the required command-line. *)
build_command
~
raw_options
solver
config
model
task
build_command
~
raw_options
solver
config
model
task
...
@@ -190,7 +205,7 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
...
@@ -190,7 +205,7 @@ let exec_tasks ~raw_options solver config model tasks_htbl =
else
begin
else
begin
(* Extract and pretty-print verification result. *)
(* Extract and pretty-print verification result. *)
let
result
=
extract_result
solver
~
log
~
output
in
let
result
=
extract_result
solver
~
log
~
output
in
Logs
.
app
(
fun
m
->
m
"Result %s: %a."
Logs
.
app
(
fun
m
->
m
"Result
of `
%s
'
: %a."
task
.
id
Solver
.
Result
.
pretty
result
);
task
.
id
Solver
.
Result
.
pretty
result
);
Sys
.
remove
output
;
Sys
.
remove
output
;
if
Solver
.
Result
.
equal
result
Solver
.
Result
.
Failure
if
Solver
.
Result
.
equal
result
Solver
.
Result
.
Failure
...
...
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