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
7f439124
Commit
7f439124
authored
3 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[PyRAT] Avoid task split and use pyrat full capability to handle logical operators.
parent
06b3af48
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/printers/pyrat.ml
+20
-16
20 additions, 16 deletions
src/printers/pyrat.ml
src/verification.ml
+3
-1
3 additions, 1 deletion
src/verification.ml
with
23 additions
and
17 deletions
src/printers/pyrat.ml
+
20
−
16
View file @
7f439124
...
@@ -24,9 +24,10 @@ let number_format =
...
@@ -24,9 +24,10 @@ let number_format =
Why3
.
Number
.
frac_real_support
=
`Unsupported
(
fun
_
_
->
assert
false
);
Why3
.
Number
.
frac_real_support
=
`Unsupported
(
fun
_
_
->
assert
false
);
}
}
let
rec
print_term
info
fmt
t
=
let
rec
print_
base_
term
info
fmt
t
=
let
open
Why3
in
let
open
Why3
in
match
t
.
Term
.
t_node
with
match
t
.
Term
.
t_node
with
|
Tbinop
((
Tand
|
Tor
)
,
_
,
_
)
->
assert
false
|
Tbinop
((
Timplies
|
Tiff
)
,
_
,
_
)
|
Tbinop
((
Timplies
|
Tiff
)
,
_
,
_
)
|
Tnot
_
|
Ttrue
|
Tfalse
|
Tvar
_
|
Tlet
_
|
Tif
_
|
Tcase
_
|
Tquant
_
|
Tnot
_
|
Ttrue
|
Tfalse
|
Tvar
_
|
Tlet
_
|
Tif
_
|
Tcase
_
|
Tquant
_
|
Teps
_
->
|
Teps
_
->
...
@@ -34,17 +35,13 @@ let rec print_term info fmt t =
...
@@ -34,17 +35,13 @@ let rec print_term info fmt t =
|
Tconst
c
->
Constant
.(
print
number_format
unsupported_escape
)
fmt
c
|
Tconst
c
->
Constant
.(
print
number_format
unsupported_escape
)
fmt
c
|
Tapp
(
ls
,
l
)
->
(
|
Tapp
(
ls
,
l
)
->
(
match
Printer
.
query_syntax
info
.
info_syn
ls
.
ls_name
with
match
Printer
.
query_syntax
info
.
info_syn
ls
.
ls_name
with
|
Some
s
->
Printer
.
syntax_arguments
s
(
print_term
info
)
fmt
l
|
Some
s
->
Printer
.
syntax_arguments
s
(
print_
base_
term
info
)
fmt
l
|
None
->
(
|
None
->
(
match
(
Term
.
Hls
.
find_opt
info
.
variables
ls
,
l
)
with
match
(
Term
.
Hls
.
find_opt
info
.
variables
ls
,
l
)
with
|
Some
s
,
[]
->
Fmt
.
string
fmt
s
|
Some
s
,
[]
->
Fmt
.
string
fmt
s
|
_
->
Printer
.
unsupportedTerm
t
"Unknown variable(s)"
))
|
_
->
Printer
.
unsupportedTerm
t
"Unknown variable(s)"
))
|
Tbinop
(
Tand
,
_
,
_
)
->
Printer
.
unsupportedTerm
t
"Unexpected conjunction not at top-level"
|
Tbinop
(
Tor
,
t1
,
t2
)
->
Fmt
.
pf
fmt
"%a or %a"
(
print_term
info
)
t1
(
print_term
info
)
t2
let
rec
print_t
op_level_term
info
fmt
t
=
let
rec
print_t
erm
?
(
nested
=
false
)
info
fmt
t
=
let
open
Why3
in
let
open
Why3
in
(* Don't print things we don't know. *)
(* Don't print things we don't know. *)
let
t_is_known
=
let
t_is_known
=
...
@@ -55,15 +52,22 @@ let rec print_top_level_term info fmt t =
...
@@ -55,15 +52,22 @@ let rec print_top_level_term info fmt t =
in
in
match
t
.
Term
.
t_node
with
match
t
.
Term
.
t_node
with
|
Tquant
_
->
()
|
Tquant
_
->
()
|
Tbinop
(
Tand
,
t1
,
t2
)
->
|
Tbinop
((
(
Tand
|
Tor
)
as
lop
)
,
t1
,
t2
)
->
if
t_is_known
t1
&&
t_is_known
t2
if
t_is_known
t1
&&
t_is_known
t2
then
then
Fmt
.
pf
fmt
"%a%a"
let
nested
=
true
in
(
print_top_level_term
info
)
let
psx
,
lop
,
pdx
=
t1
match
lop
with
(
print_top_level_term
info
)
|
Tand
->
(
""
,
"and"
,
""
)
t2
|
Tor
->
(
"("
,
"or"
,
")"
)
|
_
->
if
t_is_known
t
then
Fmt
.
pf
fmt
"%a@."
(
print_term
info
)
t
|
_
->
assert
false
in
Fmt
.
pf
fmt
"%s%a %s %a%s"
psx
(
print_term
~
nested
info
)
t1
lop
(
print_term
~
nested
info
)
t2
pdx
|
_
->
if
t_is_known
t
then
Fmt
.
pf
fmt
"%a%(%)"
(
print_base_term
info
)
t
(
if
nested
then
""
else
"@."
)
let
print_decl
info
fmt
d
=
let
print_decl
info
fmt
d
=
let
open
Why3
in
let
open
Why3
in
...
@@ -74,8 +78,8 @@ let print_decl info fmt d =
...
@@ -74,8 +78,8 @@ let print_decl info fmt d =
|
Dlogic
_
->
()
|
Dlogic
_
->
()
|
Dind
_
->
()
|
Dind
_
->
()
|
Dprop
(
Decl
.
Plemma
,
_
,
_
)
->
assert
false
|
Dprop
(
Decl
.
Plemma
,
_
,
_
)
->
assert
false
|
Dprop
(
Decl
.
Paxiom
,
_
,
f
)
->
print_
top_level_
term
info
fmt
f
|
Dprop
(
Decl
.
Paxiom
,
_
,
f
)
->
print_term
info
fmt
f
|
Dprop
(
Decl
.
Pgoal
,
_
,
f
)
->
print_
top_level_
term
info
fmt
f
|
Dprop
(
Decl
.
Pgoal
,
_
,
f
)
->
print_term
info
fmt
f
let
rec
print_tdecl
info
fmt
task
=
let
rec
print_tdecl
info
fmt
task
=
let
open
Why3
in
let
open
Why3
in
...
...
This diff is collapsed.
Click to expand it.
src/verification.ml
+
3
−
1
View file @
7f439124
...
@@ -42,7 +42,9 @@ let call_prover ~limit (prover : Why3.Whyconf.config_prover) driver task =
...
@@ -42,7 +42,9 @@ let call_prover ~limit (prover : Why3.Whyconf.config_prover) driver task =
let
task_prepared
=
Driver
.
prepare_task
driver
task
in
let
task_prepared
=
Driver
.
prepare_task
driver
task
in
let
tasks
=
let
tasks
=
(* We make [tasks] as a list (ie, conjunction) of disjunctions. *)
(* We make [tasks] as a list (ie, conjunction) of disjunctions. *)
Trans
.
apply
Split_goal
.
split_goal_full
task_prepared
if
String
.
equal
prover
.
prover
.
prover_name
"Marabou"
then
Trans
.
apply
Split_goal
.
split_goal_full
task_prepared
else
[
task_prepared
]
in
in
let
command
=
Whyconf
.
get_complete_command
~
with_steps
:
false
prover
in
let
command
=
Whyconf
.
get_complete_command
~
with_steps
:
false
prover
in
let
nn_file
=
let
nn_file
=
...
...
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