Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
why3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nils Fitinghoff
why3
Commits
973d4e3a
Commit
973d4e3a
authored
Jul 11, 2018
by
Sylvain Dailler
Browse files
Options
Downloads
Patches
Plain Diff
Attribute model_func does not exist
parent
0da5f41e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/printer/cntexmp_printer.ml
+1
-56
1 addition, 56 deletions
src/printer/cntexmp_printer.ml
with
1 addition
and
56 deletions
src/printer/cntexmp_printer.ml
+
1
−
56
View file @
973d4e3a
...
...
@@ -77,49 +77,6 @@ let add_model_element (el: term) info_model =
let
info_model
=
S
.
remove
el
info_model
in
S
.
add
el
info_model
(*
let add_old attr_str =
try
let pos = Str.search_forward (Str.regexp "@") attr_str 0 in
let after = String.sub attr_str pos ((String.length attr_str)-pos) in
if after = "@init" then
(String.sub attr_str 0 pos) ^ "@old"
else attr_str
with Not_found -> attr_str ^ "@old"
let model_trace_for_postcondition ~attrs (info: vc_term_info) =
(* Modifies the model_trace attribute of a term in the postcondition:
- if term corresponds to the initial value of a function
parameter, model_trace attribute will have postfix @old
- if term corresponds to the return value of a function,
add model_trace attribute in a form function_name@result
*)
try
let trace_attr = get_model_trace_attr ~attrs in
let attr_str = add_old trace_attr.attr_string in
if attr_str = trace_attr.attr_string then
attrs
else
let other_attrs = Sattr.remove trace_attr attrs in
Sattr.add
(Ident.create_attribute attr_str)
other_attrs
with Not_found ->
(* no model_trace attribute => the term represents the return value *)
Sattr.add
(Ident.create_model_trace_attr
((Opt.get_def "" info.vc_func_name) ^ "@result"))
attrs
*)
let
get_fun_name
name
=
let
splitted
=
Strings
.
bounded_split
'
:
'
name
2
in
match
splitted
with
|
_
::
[
second
]
->
second
|
_
->
""
let
check_enter_vc_term
t
in_goal
vc_term_info
=
(* Check whether the term that triggers VC is entered.
If it is entered, extract the location of the term and if the VC is
...
...
@@ -128,19 +85,7 @@ let check_enter_vc_term t in_goal vc_term_info =
*)
if
in_goal
&&
Sattr
.
mem
Ident
.
model_vc_attr
t
.
t_attrs
then
begin
vc_term_info
.
vc_inside
<-
true
;
vc_term_info
.
vc_loc
<-
t
.
t_loc
;
try
(* Attribute "model_func" => the VC is postcondition or precondition *)
(* Extract the function name from "model_func" attribute *)
let
fun_attr
=
Sattr
.
choose
(
Sattr
.
filter
(
fun
a
->
Strings
.
has_prefix
"model_func:"
a
.
attr_string
)
t
.
t_attrs
)
in
vc_term_info
.
vc_func_name
<-
Some
(
get_fun_name
fun_attr
.
attr_string
);
with
Not_found
->
(* No "model_func" => the VC is not postcondition or precondition *)
()
vc_term_info
.
vc_loc
<-
t
.
t_loc
end
let
check_exit_vc_term
t
in_goal
info
=
...
...
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