Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Why3
why3
Commits
6368b28c
Commit
6368b28c
authored
Apr 21, 2020
by
Benedikt Becker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tune mlw_printer
parent
3af6b8c9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
243 additions
and
235 deletions
+243
-235
bench/bench
bench/bench
+2
-10
bench/test_mlw_printer
bench/test_mlw_printer
+4
-1
examples/use_api/oracles/test-api-mlw_tree.stdout
examples/use_api/oracles/test-api-mlw_tree.stdout
+7
-7
src/parser/mlw_printer.ml
src/parser/mlw_printer.ml
+230
-217
No files found.
bench/bench
View file @
6368b28c
...
...
@@ -298,16 +298,8 @@ list_stuff () {
test_mlw_printer
()
{
python3
-m
sexpdata
||
return
bench/test_mlw_printer
"bench/valid/booleans.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/complex_arg_1.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/complex_arg_2.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/division.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/exns.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/oldify.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/recfun.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/see.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/type_invariant.mlw"
||
exit
1
bench/test_mlw_printer
"bench/valid/wpcalls.mlw"
||
exit
1
bench/test_mlw_printer bench/valid/
*
.mlw
bench/test_mlw_printer bench/typing/good/
*
.mlw
}
echo
"=== Checking stdlib ==="
...
...
bench/test_mlw_printer
View file @
6368b28c
...
...
@@ -53,11 +53,14 @@ def trace(path, sexp, sexp1):
def
test
(
filename
):
sexp0
=
read
(
filename
)
sexp1
=
print_and_read
(
filename
)
try
:
sexp1
=
print_and_read
(
filename
)
assert_equal
([],
sexp0
,
sexp1
)
print
(
"OK:"
,
filename
)
return
True
except
AssertionError
:
print
(
"CANT REPARSE:"
,
filename
)
return
False
except
NotEqual
as
e
:
print
(
"FAILED:"
,
filename
)
# sexpdata.dump(trace(e.path, sexp0, e.sexp1), sys.stdout)
...
...
examples/use_api/oracles/test-api-mlw_tree.stdout
View file @
6368b28c
...
...
@@ -8,9 +8,9 @@ module M2
use int.Int
let f (x : int)
requires {
(
x = 6
)
}
ensures {
(
result = 42
)
} =
(
Int.(*) x 7
)
requires {
x = 6
}
ensures { result = 42 } =
Int.(*) x 7
end
module M3
...
...
@@ -18,8 +18,8 @@ module M3
use ref.Ref
let f (_ : ())
ensures {
(
Int.(>=) result 0
)
} =
(
let x =
(
Ref.ref 42
)
in Ref.(!) x
)
ensures { Int.(>=) result 0 } =
let x = Ref.ref 42 in Ref.(!) x
end
module M4
...
...
@@ -27,9 +27,9 @@ module M4
use array.Array
let f (a : Array.array int)
requires {
(
Int.(>=) (Array.length a) 1
)
}
requires {
Int.(>=) (Array.length a) 1
}
returns { _ -> (Array.([]) a 0) = 42 } =
(
Array.([]<-) a 0 42
)
Array.([]<-) a 0 42
end
Tasks are:
Task 1: theory Task
...
...
src/parser/mlw_printer.ml
View file @
6368b28c
This diff is collapsed.
Click to expand it.
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