Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
93768735
Commit
93768735
authored
Feb 11, 2015
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atetmpt to fix bug in execute
parent
2491615d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
examples/bts/execute.mlw
examples/bts/execute.mlw
+15
-0
src/whyml/mlw_interp.ml
src/whyml/mlw_interp.ml
+20
-4
No files found.
examples/bts/execute.mlw
0 → 100644
View file @
93768735
module Test
use import ref.Ref
let foo () =
let (a1, a2) = (ref 0, ref 0) in
()
(*
why3 execute execute.mlw Test.foo
*)
end
src/whyml/mlw_interp.ml
View file @
93768735
...
...
@@ -517,19 +517,35 @@ let rec to_program_value_rec env regions s ity ls vl =
(* absurd, it would be a pure type *)
assert
false
let
rec
get_regions
acc
ity
=
match
ity
.
ity_node
with
|
Ityvar
_
->
assert
false
|
Ityapp
(
_
,
ty
,
rl
)
->
List
.
map
(
get_reg
env
)
rl
|
Itypur
(
ts
,
tl
)
->
eprintf
"@[<hov 2>error while fetching regions from value %a@ of type %a@]@."
print_value
v
Mlw_pretty
.
print_vty
ty
;
assert
false
let
to_program_value
env
s
ty
v
=
match
ty
,
v
with
|
VTarrow
_
,
_
->
s
,
v
|
VTvalue
ity
,
Vapp
(
ls
,
vl
)
->
if
ity_immutable
ity
then
s
,
v
else
begin
(* ls must be a constructor of a record with mutable fields *)
let
regions
=
let
regions
=
[]
in
(*
match ity.ity_node with
| Ityapp(_,_,rl) ->
List
.
map
(
get_reg
env
)
rl
|
_
->
assert
false
List.map (get_reg env) rl
| Ityvar _ -> assert false
| Itypur(ts,tl) ->
eprintf "@[<hov 2>error while fetching regions from value %a@ of type %a@]@."
print_value v Mlw_pretty.print_vty ty;
assert false
in
*)
let
s
,
regions
,
v
=
to_program_value_rec
env
regions
s
ity
ls
vl
in
match
regions
with
|
[]
->
s
,
v
...
...
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