Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
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
frama-c
Commits
2d9eb07a
Commit
2d9eb07a
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[wp] protect scripts crawling
parent
e7370136
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/wp/ProverScript.ml
+34
-24
34 additions, 24 deletions
src/plugins/wp/ProverScript.ml
with
34 additions
and
24 deletions
src/plugins/wp/ProverScript.ml
+
34
−
24
View file @
2d9eb07a
...
...
@@ -312,6 +312,20 @@ and autofork env ~depth fork =
else
(
Env
.
validate
env
;
Task
.
return
true
)
(* -------------------------------------------------------------------------- *)
(* --- Apply Script Tactic --- *)
(* -------------------------------------------------------------------------- *)
let
apply
env
node
jtactic
subscripts
=
match
jfork
(
Env
.
tree
env
)
?
node
jtactic
with
|
None
->
failwith
"Selector not found"
|
Some
fork
->
let
_
,
children
=
ProofEngine
.
commit
fork
in
reconcile
children
subscripts
;
(*TODO: saveback forgiven script ? *)
List
.
filter
(
fun
(
_
,
node
)
->
not
(
ProofEngine
.
proved
node
))
children
(* -------------------------------------------------------------------------- *)
(* --- Script Crawling --- *)
(* -------------------------------------------------------------------------- *)
...
...
@@ -348,30 +362,26 @@ let rec crawl env on_child node = function
|
Tactic
(
_
,
jtactic
,
subscripts
)
::
alternative
->
begin
match
jfork
(
Env
.
tree
env
)
?
node
jtactic
with
|
None
->
Wp_parameters
.
warning
"Script Error: on goal %a@
\n
\
can not apply '%s'@
\n
\
@[<hov 2>Params: %a@]@
\n
\
@[<hov 2>Select: %a@]@."
WpPropId
.
pretty
(
Env
.
goal
env
node
)
.
po_pid
jtactic
.
tactic
Json
.
pp
jtactic
.
params
Json
.
pp
jtactic
.
select
;
crawl
env
on_child
node
alternative
|
Some
fork
->
(*TODO: saveback forgiven script *)
let
_
,
children
=
ProofEngine
.
commit
fork
in
reconcile
children
subscripts
;
let
residual
=
List
.
filter
(
fun
(
_
,
node
)
->
not
(
ProofEngine
.
proved
node
))
children
in
if
residual
=
[]
then
Env
.
validate
env
else
List
.
iter
(
fun
(
_
,
n
)
->
on_child
n
)
children
;
Task
.
return
()
try
let
residual
=
apply
env
node
jtactic
subscripts
in
if
residual
=
[]
then
Env
.
validate
env
else
List
.
iter
(
fun
(
_
,
n
)
->
on_child
n
)
residual
;
Task
.
return
()
with
exn
when
Wp_parameters
.
protect
exn
->
Wp_parameters
.
warning
"Script Error: on goal %a@
\n
\
can not apply '%s'@
\n
\
exception %S@
\n
\
@[<hov 2>Params: %a@]@
\n
\
@[<hov 2>Select: %a@]@."
WpPropId
.
pretty
(
Env
.
goal
env
node
)
.
po_pid
jtactic
.
tactic
(
Printexc
.
to_string
exn
)
Json
.
pp
jtactic
.
params
Json
.
pp
jtactic
.
select
;
crawl
env
on_child
node
alternative
end
(* -------------------------------------------------------------------------- *)
...
...
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