Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
59
Issues
59
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
973d4e3a
Commit
973d4e3a
authored
Jul 11, 2018
by
Sylvain Dailler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attribute model_func does not exist
parent
0da5f41e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
56 deletions
+1
-56
cntexmp_printer.ml
src/printer/cntexmp_printer.ml
+1
-56
No files found.
src/printer/cntexmp_printer.ml
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
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment