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
121
Issues
121
List
Boards
Labels
Service Desk
Milestones
Merge Requests
17
Merge Requests
17
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
bb165cfe
Commit
bb165cfe
authored
Jun 05, 2018
by
Andrei Paskevich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parser: rename [_.._] to [..] for consistency with other bracket ops
parent
2b61be07
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1466 additions
and
1474 deletions
+1466
-1474
doc/qualid.bnf
doc/qualid.bnf
+1
-1
doc/term1.bnf
doc/term1.bnf
+1
-1
src/core/pretty.ml
src/core/pretty.ml
+4
-4
src/driver/driver_lexer.mll
src/driver/driver_lexer.mll
+2
-0
src/driver/driver_parser.mly
src/driver/driver_parser.mly
+4
-1
src/mlw/expr.ml
src/mlw/expr.ml
+5
-5
src/mlw/pmodule.ml
src/mlw/pmodule.ml
+1
-1
src/parser/handcrafted.messages
src/parser/handcrafted.messages
+1443
-1456
src/parser/parser.mly
src/parser/parser.mly
+4
-4
stdlib/seq.mlw
stdlib/seq.mlw
+1
-1
No files found.
doc/qualid.bnf
View file @
bb165cfe
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
| "[]" ; collection access
| "[]" ; collection access
| "[<-]" ; collection update
| "[<-]" ; collection update
| "[]<-" ; in-place collection update
| "[]<-" ; in-place collection update
| "[
_.._]"
; collection slice
| "[
..]"
; collection slice
| "[_..]" ; right-open slice
| "[_..]" ; right-open slice
| "[.._]" ; left-open slice %
| "[.._]" ; left-open slice %
\end{syntax}
\end{syntax}
doc/term1.bnf
View file @
bb165cfe
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
| "[]" ; collection access
| "[]" ; collection access
| "[<-]" ; collection update
| "[<-]" ; collection update
| "[]<-" ; in-place update
| "[]<-" ; in-place update
| "[
_.._]"
; collection slice
| "[
..]"
; collection slice
| "[_..]" ; right-open slice
| "[_..]" ; right-open slice
| "[.._]" ; left-open slice %
| "[.._]" ; left-open slice %
\end{syntax}
\end{syntax}
src/core/pretty.ml
View file @
bb165cfe
...
@@ -158,9 +158,9 @@ let print_ts fmt ts =
...
@@ -158,9 +158,9 @@ let print_ts fmt ts =
let
print_ls
fmt
({
ls_name
=
{
id_string
=
nm
}}
as
ls
)
=
let
print_ls
fmt
({
ls_name
=
{
id_string
=
nm
}}
as
ls
)
=
if
nm
=
"mixfix []"
then
pp_print_string
fmt
"([])"
else
if
nm
=
"mixfix []"
then
pp_print_string
fmt
"([])"
else
if
nm
=
"mixfix [<-]"
then
pp_print_string
fmt
"([<-])"
else
if
nm
=
"mixfix [<-]"
then
pp_print_string
fmt
"([<-])"
else
if
nm
=
"mixfix [..]"
then
pp_print_string
fmt
"([..])"
else
if
nm
=
"mixfix [_..]"
then
pp_print_string
fmt
"([_..])"
else
if
nm
=
"mixfix [_..]"
then
pp_print_string
fmt
"([_..])"
else
if
nm
=
"mixfix [.._]"
then
pp_print_string
fmt
"([.._])"
else
if
nm
=
"mixfix [.._]"
then
pp_print_string
fmt
"([.._])"
else
if
nm
=
"mixfix [_.._]"
then
pp_print_string
fmt
"([_.._])"
else
let
s
=
id_unique
iprinter
ls
.
ls_name
in
let
s
=
id_unique
iprinter
ls
.
ls_name
in
match
extract_op
s
with
match
extract_op
s
with
|
Some
s
->
fprintf
fmt
"(%s)"
(
escape_op
s
)
|
Some
s
->
fprintf
fmt
"(%s)"
(
escape_op
s
)
...
@@ -291,15 +291,15 @@ and print_app pri ls fmt tl =
...
@@ -291,15 +291,15 @@ and print_app pri ls fmt tl =
|
_
,
[
t1
;
t2
;
t3
]
when
ls
.
ls_name
.
id_string
=
"mixfix [<-]"
->
|
_
,
[
t1
;
t2
;
t3
]
when
ls
.
ls_name
.
id_string
=
"mixfix [<-]"
->
fprintf
fmt
(
protect_on
(
pri
>
7
)
"@[%a@,[%a <-@ %a]@]"
)
fprintf
fmt
(
protect_on
(
pri
>
7
)
"@[%a@,[%a <-@ %a]@]"
)
(
print_lterm
7
)
t1
(
print_lterm
6
)
t2
(
print_lterm
6
)
t3
(
print_lterm
7
)
t1
(
print_lterm
6
)
t2
(
print_lterm
6
)
t3
|
_
,
[
t1
;
t2
;
t3
]
when
ls
.
ls_name
.
id_string
=
"mixfix [..]"
->
fprintf
fmt
(
protect_on
(
pri
>
7
)
"%a[%a..%a]"
)
(
print_lterm
7
)
t1
(
print_lterm
6
)
t2
(
print_lterm
6
)
t3
|
_
,
[
t1
;
t2
]
when
ls
.
ls_name
.
id_string
=
"mixfix [_..]"
->
|
_
,
[
t1
;
t2
]
when
ls
.
ls_name
.
id_string
=
"mixfix [_..]"
->
fprintf
fmt
(
protect_on
(
pri
>
7
)
"%a[%a..]"
)
fprintf
fmt
(
protect_on
(
pri
>
7
)
"%a[%a..]"
)
(
print_lterm
7
)
t1
print_term
t2
(
print_lterm
7
)
t1
print_term
t2
|
_
,
[
t1
;
t2
]
when
ls
.
ls_name
.
id_string
=
"mixfix [.._]"
->
|
_
,
[
t1
;
t2
]
when
ls
.
ls_name
.
id_string
=
"mixfix [.._]"
->
fprintf
fmt
(
protect_on
(
pri
>
7
)
"%a[..%a]"
)
fprintf
fmt
(
protect_on
(
pri
>
7
)
"%a[..%a]"
)
(
print_lterm
7
)
t1
print_term
t2
(
print_lterm
7
)
t1
print_term
t2
|
_
,
[
t1
;
t2
;
t3
]
when
ls
.
ls_name
.
id_string
=
"mixfix [_.._]"
->
fprintf
fmt
(
protect_on
(
pri
>
7
)
"%a[%a..%a]"
)
(
print_lterm
7
)
t1
(
print_lterm
6
)
t2
(
print_lterm
6
)
t3
|
_
,
tl
->
|
_
,
tl
->
fprintf
fmt
(
protect_on
(
pri
>
6
)
"@[%a@ %a@]"
)
fprintf
fmt
(
protect_on
(
pri
>
6
)
"@[%a@ %a@]"
)
print_ls
ls
(
print_list
space
(
print_lterm
7
))
tl
print_ls
ls
(
print_list
space
(
print_lterm
7
))
tl
...
...
src/driver/driver_lexer.mll
View file @
bb165cfe
...
@@ -89,6 +89,8 @@ rule token = parse
...
@@ -89,6 +89,8 @@ rule token = parse
{
RIGHTPAR
}
{
RIGHTPAR
}
|
"."
|
"."
{
DOT
}
{
DOT
}
|
".."
{
DOTDOT
}
|
","
|
","
{
COMMA
}
{
COMMA
}
|
"'"
|
"'"
...
...
src/driver/driver_parser.mly
View file @
bb165cfe
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
%
token
THEORY
END
SYNTAX
REMOVE
META
PRELUDE
PRINTER
MODEL_PARSER
OVERRIDING
%
token
THEORY
END
SYNTAX
REMOVE
META
PRELUDE
PRINTER
MODEL_PARSER
OVERRIDING
%
token
VALID
INVALID
UNKNOWN
FAIL
%
token
VALID
INVALID
UNKNOWN
FAIL
%
token
TIMEOUT
OUTOFMEMORY
STEPLIMITEXCEEDED
TIME
STEPS
%
token
TIMEOUT
OUTOFMEMORY
STEPLIMITEXCEEDED
TIME
STEPS
%
token
UNDERSCORE
LEFTPAR
RIGHTPAR
DOT
QUOTE
EOF
%
token
UNDERSCORE
LEFTPAR
RIGHTPAR
DOT
DOTDOT
QUOTE
EOF
%
token
BLACKLIST
%
token
BLACKLIST
%
token
MODULE
EXCEPTION
VAL
CONVERTER
LITERAL
%
token
MODULE
EXCEPTION
VAL
CONVERTER
LITERAL
%
token
FUNCTION
PREDICATE
TYPE
PROP
ALL
FILENAME
TRANSFORM
PLUGIN
%
token
FUNCTION
PREDICATE
TYPE
PROP
ALL
FILENAME
TRANSFORM
PLUGIN
...
@@ -141,6 +141,9 @@ operator:
...
@@ -141,6 +141,9 @@ operator:
|
LEFTSQ
RIGHTSQ
{
Ident
.
mixfix
"[]"
}
|
LEFTSQ
RIGHTSQ
{
Ident
.
mixfix
"[]"
}
|
LEFTSQ
LARROW
RIGHTSQ
{
Ident
.
mixfix
"[<-]"
}
|
LEFTSQ
LARROW
RIGHTSQ
{
Ident
.
mixfix
"[<-]"
}
|
LEFTSQ
RIGHTSQ
LARROW
{
Ident
.
mixfix
"[]<-"
}
|
LEFTSQ
RIGHTSQ
LARROW
{
Ident
.
mixfix
"[]<-"
}
|
LEFTSQ
DOTDOT
RIGHTSQ
{
Ident
.
mixfix
"[..]"
}
|
LEFTSQ
UNDERSCORE
DOTDOT
RIGHTSQ
{
Ident
.
mixfix
"[_..]"
}
|
LEFTSQ
DOTDOT
UNDERSCORE
RIGHTSQ
{
Ident
.
mixfix
"[.._]"
}
(* Types *)
(* Types *)
...
...
src/mlw/expr.ml
View file @
bb165cfe
...
@@ -1184,9 +1184,9 @@ let print_rs fmt ({rs_name = {id_string = nm}} as s) =
...
@@ -1184,9 +1184,9 @@ let print_rs fmt ({rs_name = {id_string = nm}} as s) =
if
nm
=
Ident
.
mixfix
"[]"
then
pp_print_string
fmt
"([])"
else
if
nm
=
Ident
.
mixfix
"[]"
then
pp_print_string
fmt
"([])"
else
if
nm
=
Ident
.
mixfix
"[]<-"
then
pp_print_string
fmt
"([]<-)"
else
if
nm
=
Ident
.
mixfix
"[]<-"
then
pp_print_string
fmt
"([]<-)"
else
if
nm
=
Ident
.
mixfix
"[<-]"
then
pp_print_string
fmt
"([<-])"
else
if
nm
=
Ident
.
mixfix
"[<-]"
then
pp_print_string
fmt
"([<-])"
else
if
nm
=
Ident
.
mixfix
"[..]"
then
pp_print_string
fmt
"([..])"
else
if
nm
=
Ident
.
mixfix
"[_..]"
then
pp_print_string
fmt
"([_..])"
else
if
nm
=
Ident
.
mixfix
"[_..]"
then
pp_print_string
fmt
"([_..])"
else
if
nm
=
Ident
.
mixfix
"[.._]"
then
pp_print_string
fmt
"([.._])"
else
if
nm
=
Ident
.
mixfix
"[.._]"
then
pp_print_string
fmt
"([.._])"
else
if
nm
=
Ident
.
mixfix
"[_.._]"
then
pp_print_string
fmt
"([_.._])"
else
match
extract_op
s
.
rs_name
,
s
.
rs_logic
with
match
extract_op
s
.
rs_name
,
s
.
rs_logic
with
|
Some
x
,
_
->
|
Some
x
,
_
->
fprintf
fmt
"(%s%s%s)"
fprintf
fmt
"(%s%s%s)"
...
@@ -1265,13 +1265,13 @@ let print_capp pri ({rs_name = id} as s) fmt vl =
...
@@ -1265,13 +1265,13 @@ let print_capp pri ({rs_name = id} as s) fmt vl =
|
_
,
[
t1
;
t2
;
t3
]
when
id
.
id_string
=
"mixfix []<-"
->
|
_
,
[
t1
;
t2
;
t3
]
when
id
.
id_string
=
"mixfix []<-"
->
fprintf
fmt
(
protect_on
(
pri
>
0
)
"%a[%a] <- %a"
)
fprintf
fmt
(
protect_on
(
pri
>
0
)
"%a[%a] <- %a"
)
print_pv
t1
print_pv
t2
print_pv
t3
print_pv
t1
print_pv
t2
print_pv
t3
|
_
,
[
t1
;
t2
;
t3
]
when
id
.
id_string
=
"mixfix [..]"
->
fprintf
fmt
(
protect_on
(
pri
>
6
)
"%a[%a..%a]"
)
print_pv
t1
print_pv
t2
print_pv
t3
|
_
,
[
t1
;
t2
]
when
id
.
id_string
=
"mixfix [_..]"
->
|
_
,
[
t1
;
t2
]
when
id
.
id_string
=
"mixfix [_..]"
->
fprintf
fmt
(
protect_on
(
pri
>
6
)
"%a[%a..]"
)
print_pv
t1
print_pv
t2
fprintf
fmt
(
protect_on
(
pri
>
6
)
"%a[%a..]"
)
print_pv
t1
print_pv
t2
|
_
,
[
t1
;
t2
]
when
id
.
id_string
=
"mixfix [.._]"
->
|
_
,
[
t1
;
t2
]
when
id
.
id_string
=
"mixfix [.._]"
->
fprintf
fmt
(
protect_on
(
pri
>
6
)
"%a[..%a]"
)
print_pv
t1
print_pv
t2
fprintf
fmt
(
protect_on
(
pri
>
6
)
"%a[..%a]"
)
print_pv
t1
print_pv
t2
|
_
,
[
t1
;
t2
;
t3
]
when
id
.
id_string
=
"mixfix [_.._]"
->
fprintf
fmt
(
protect_on
(
pri
>
6
)
"%a[%a..%a]"
)
print_pv
t1
print_pv
t2
print_pv
t3
|
_
,
tl
->
|
_
,
tl
->
fprintf
fmt
(
protect_on
(
pri
>
5
)
"@[<hov 1>%a@ %a@]"
)
fprintf
fmt
(
protect_on
(
pri
>
5
)
"@[<hov 1>%a@ %a@]"
)
print_rs
s
(
Pp
.
print_list
Pp
.
space
print_pv
)
tl
print_rs
s
(
Pp
.
print_list
Pp
.
space
print_pv
)
tl
...
@@ -1284,9 +1284,9 @@ let print_cpur pri ({ls_name = id} as s) fmt vl =
...
@@ -1284,9 +1284,9 @@ let print_cpur pri ({ls_name = id} as s) fmt vl =
|
_
,
[
_
;
_
]
when
id
.
id_string
=
"mixfix []"
->
Some
"[]"
|
_
,
[
_
;
_
]
when
id
.
id_string
=
"mixfix []"
->
Some
"[]"
|
_
,
[
_
;
_
;
_
]
when
id
.
id_string
=
"mixfix [<-]"
->
Some
"[<-]"
|
_
,
[
_
;
_
;
_
]
when
id
.
id_string
=
"mixfix [<-]"
->
Some
"[<-]"
|
_
,
[
_
;
_
;
_
]
when
id
.
id_string
=
"mixfix []<-"
->
Some
"[]<-"
|
_
,
[
_
;
_
;
_
]
when
id
.
id_string
=
"mixfix []<-"
->
Some
"[]<-"
|
_
,
[
_
;
_
;
_
]
when
id
.
id_string
=
"mixfix [..]"
->
Some
"[..]"
|
_
,
[
_
;
_
]
when
id
.
id_string
=
"mixfix [_..]"
->
Some
"[_..]"
|
_
,
[
_
;
_
]
when
id
.
id_string
=
"mixfix [_..]"
->
Some
"[_..]"
|
_
,
[
_
;
_
]
when
id
.
id_string
=
"mixfix [.._]"
->
Some
"[.._]"
|
_
,
[
_
;
_
]
when
id
.
id_string
=
"mixfix [.._]"
->
Some
"[.._]"
|
_
,
[
_
;
_
;
_
]
when
id
.
id_string
=
"mixfix [_.._]"
->
Some
"[_.._]"
|
_
->
None
in
|
_
->
None
in
match
op
,
vl
with
match
op
,
vl
with
|
None
,
[]
->
|
None
,
[]
->
...
...
src/mlw/pmodule.ml
View file @
bb165cfe
...
@@ -1215,9 +1215,9 @@ let get_rs_name nm =
...
@@ -1215,9 +1215,9 @@ let get_rs_name nm =
if
nm
=
"mixfix []"
then
"([])"
else
if
nm
=
"mixfix []"
then
"([])"
else
if
nm
=
"mixfix []<-"
then
"([]<-)"
else
if
nm
=
"mixfix []<-"
then
"([]<-)"
else
if
nm
=
"mixfix [<-]"
then
"([<-])"
else
if
nm
=
"mixfix [<-]"
then
"([<-])"
else
if
nm
=
"mixfix [..]"
then
"([..])"
else
if
nm
=
"mixfix [_..]"
then
"([_..])"
else
if
nm
=
"mixfix [_..]"
then
"([_..])"
else
if
nm
=
"mixfix [.._]"
then
"([.._])"
else
if
nm
=
"mixfix [.._]"
then
"([.._])"
else
if
nm
=
"mixfix [_.._]"
then
"([_.._])"
else
try
"("
^
Strings
.
remove_prefix
"infix "
nm
^
")"
with
Not_found
->
try
"("
^
Strings
.
remove_prefix
"infix "
nm
^
")"
with
Not_found
->
try
"("
^
Strings
.
remove_prefix
"prefix "
nm
^
"_)"
with
Not_found
->
try
"("
^
Strings
.
remove_prefix
"prefix "
nm
^
"_)"
with
Not_found
->
nm
nm
...
...
src/parser/handcrafted.messages
View file @
bb165cfe
This diff is collapsed.
Click to expand it.
src/parser/parser.mly
View file @
bb165cfe
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
let
get_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[]"
)
s
e
)
let
get_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[]"
)
s
e
)
let
set_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[<-]"
)
s
e
)
let
set_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[<-]"
)
s
e
)
let
sub_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[
_.._
]"
)
s
e
)
let
sub_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[
..
]"
)
s
e
)
let
above_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[_..]"
)
s
e
)
let
above_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[_..]"
)
s
e
)
let
below_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[.._]"
)
s
e
)
let
below_op
s
e
=
Qident
(
mk_id
(
Ident
.
mixfix
"[.._]"
)
s
e
)
...
@@ -1183,9 +1183,9 @@ lident_op:
...
@@ -1183,9 +1183,9 @@ lident_op:
|
LEFTSQ
RIGHTSQ
{
Ident
.
mixfix
"[]"
}
|
LEFTSQ
RIGHTSQ
{
Ident
.
mixfix
"[]"
}
|
LEFTSQ
LARROW
RIGHTSQ
{
Ident
.
mixfix
"[<-]"
}
|
LEFTSQ
LARROW
RIGHTSQ
{
Ident
.
mixfix
"[<-]"
}
|
LEFTSQ
RIGHTSQ
LARROW
{
Ident
.
mixfix
"[]<-"
}
|
LEFTSQ
RIGHTSQ
LARROW
{
Ident
.
mixfix
"[]<-"
}
|
LEFTSQ
UNDERSCORE
DOTDOT
UNDERSCORE
RIGHTSQ
{
Ident
.
mixfix
"[_.._
]"
}
|
LEFTSQ
DOTDOT
RIGHTSQ
{
Ident
.
mixfix
"[..
]"
}
|
LEFTSQ
DOTDOT
UNDERSCORE
RIGHTSQ
{
Ident
.
mixfix
"[.._
]"
}
|
LEFTSQ
UNDERSCORE
DOTDOT
RIGHTSQ
{
Ident
.
mixfix
"[_..
]"
}
|
LEFTSQ
UNDERSCORE
DOTDOT
RIGHTSQ
{
Ident
.
mixfix
"[_..
]"
}
|
LEFTSQ
DOTDOT
UNDERSCORE
RIGHTSQ
{
Ident
.
mixfix
"[.._
]"
}
op_symbol
:
op_symbol
:
|
OP1
{
$
1
}
|
OP1
{
$
1
}
...
...
stdlib/seq.mlw
View file @
bb165cfe
...
@@ -91,7 +91,7 @@ module Seq
...
@@ -91,7 +91,7 @@ module Seq
(** [s[i..j]] is the sub-sequence of [s] from element [i] included
(** [s[i..j]] is the sub-sequence of [s] from element [i] included
to element [j] excluded *)
to element [j] excluded *)
let function ([
_.._
]) (s:seq 'a) (i:int) (j:int) : seq 'a
let function ([
..
]) (s:seq 'a) (i:int) (j:int) : seq 'a
requires { 0 <= i <= j <= length s }
requires { 0 <= i <= j <= length s }
ensures { length result = j - i }
ensures { length result = j - i }
ensures { forall k. 0 <= k < j - i -> result[k] = s[i + k] }
ensures { forall k. 0 <= k < j - i -> result[k] = s[i + k] }
...
...
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