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
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
Charles Southerland
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 =
...
@@ -312,6 +312,20 @@ and autofork env ~depth fork =
else
else
(
Env
.
validate
env
;
Task
.
return
true
)
(
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 --- *)
(* --- Script Crawling --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
...
@@ -348,30 +362,26 @@ let rec crawl env on_child node = function
...
@@ -348,30 +362,26 @@ let rec crawl env on_child node = function
|
Tactic
(
_
,
jtactic
,
subscripts
)
::
alternative
->
|
Tactic
(
_
,
jtactic
,
subscripts
)
::
alternative
->
begin
begin
match
jfork
(
Env
.
tree
env
)
?
node
jtactic
with
try
|
None
->
let
residual
=
apply
env
node
jtactic
subscripts
in
Wp_parameters
.
warning
if
residual
=
[]
then
"Script Error: on goal %a@
\n
\
Env
.
validate
env
can not apply '%s'@
\n
\
else
@[<hov 2>Params: %a@]@
\n
\
List
.
iter
(
fun
(
_
,
n
)
->
on_child
n
)
residual
;
@[<hov 2>Select: %a@]@."
Task
.
return
()
WpPropId
.
pretty
(
Env
.
goal
env
node
)
.
po_pid
with
exn
when
Wp_parameters
.
protect
exn
->
jtactic
.
tactic
Wp_parameters
.
warning
Json
.
pp
jtactic
.
params
"Script Error: on goal %a@
\n
\
Json
.
pp
jtactic
.
select
;
can not apply '%s'@
\n
\
crawl
env
on_child
node
alternative
exception %S@
\n
\
|
Some
fork
->
@[<hov 2>Params: %a@]@
\n
\
(*TODO: saveback forgiven script *)
@[<hov 2>Select: %a@]@."
let
_
,
children
=
ProofEngine
.
commit
fork
in
WpPropId
.
pretty
(
Env
.
goal
env
node
)
.
po_pid
reconcile
children
subscripts
;
jtactic
.
tactic
let
residual
=
List
.
filter
(
Printexc
.
to_string
exn
)
(
fun
(
_
,
node
)
->
not
(
ProofEngine
.
proved
node
))
Json
.
pp
jtactic
.
params
children
in
Json
.
pp
jtactic
.
select
;
if
residual
=
[]
then
crawl
env
on_child
node
alternative
Env
.
validate
env
else
List
.
iter
(
fun
(
_
,
n
)
->
on_child
n
)
children
;
Task
.
return
()
end
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