Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
71f1dc62
Commit
71f1dc62
authored
Nov 25, 2015
by
Martin Clochard
Browse files
Add by/so to Why3 keywords
parent
4e039176
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/parser/lexer.mll
View file @
71f1dc62
...
...
@@ -26,6 +26,7 @@
[
"as"
,
AS
;
"axiom"
,
AXIOM
;
"by"
,
BY
;
"clone"
,
CLONE
;
"coinductive"
,
COINDUCTIVE
;
"constant"
,
CONSTANT
;
...
...
@@ -50,6 +51,7 @@
"not"
,
NOT
;
"predicate"
,
PREDICATE
;
"prop"
,
PROP
;
"so"
,
SO
;
"then"
,
THEN
;
"theory"
,
THEORY
;
"true"
,
TRUE
;
...
...
src/parser/parser.mly
View file @
71f1dc62
...
...
@@ -158,11 +158,11 @@ end
(* keywords *)
%
token
AS
AXIOM
CLONE
COINDUCTIVE
CONSTANT
%
token
AS
AXIOM
BY
CLONE
COINDUCTIVE
CONSTANT
%
token
ELSE
END
EPSILON
EXISTS
EXPORT
FALSE
FORALL
FUNCTION
%
token
GOAL
IF
IMPORT
IN
INDUCTIVE
LEMMA
%
token
LET
MATCH
META
NAMESPACE
NOT
PROP
PREDICATE
%
token
THEN
THEORY
TRUE
TYPE
USE
WITH
%
token
SO
THEN
THEORY
TRUE
TYPE
USE
WITH
(* program keywords *)
...
...
@@ -201,6 +201,7 @@ end
%
nonassoc
COLON
%
right
ARROW
LRARROW
%
right
BY
SO
%
right
OR
BARBAR
%
right
AND
AMPAMP
%
nonassoc
NOT
...
...
@@ -624,6 +625,8 @@ triggers:
|
BARBAR
{
Tor_asym
}
|
AND
{
Tand
}
|
AMPAMP
{
Tand_asym
}
|
BY
{
Tby
}
|
SO
{
Tso
}
quant
:
|
FORALL
{
Tforall
}
...
...
src/parser/ptree.ml
View file @
71f1dc62
...
...
@@ -27,7 +27,7 @@ type quant =
|
Tforall
|
Texists
|
Tlambda
type
binop
=
|
Tand
|
Tand_asym
|
Tor
|
Tor_asym
|
Timplies
|
Tiff
|
Tand
|
Tand_asym
|
Tor
|
Tor_asym
|
Timplies
|
Tiff
|
Tby
|
Tso
type
unop
=
|
Tnot
...
...
src/parser/typing.ml
View file @
71f1dc62
...
...
@@ -311,14 +311,21 @@ let rec dterm uc gvars denv {term_desc = desc; term_loc = loc} =
|
Ptree
.
Tbinop
(
e1
,
op
,
e2
)
->
let
e1
=
dterm
uc
gvars
denv
e1
in
let
e2
=
dterm
uc
gvars
denv
e2
in
let
op
=
match
op
with
|
Ptree
.
Tand
->
DTand
|
Ptree
.
Tand_asym
->
DTand_asym
|
Ptree
.
Tor
->
DTor
|
Ptree
.
Tor_asym
->
DTor_asym
|
Ptree
.
Timplies
->
DTimplies
|
Ptree
.
Tiff
->
DTiff
in
DTbinop
(
op
,
e1
,
e2
)
let
k
op
=
DTbinop
(
op
,
e1
,
e2
)
in
let
et
()
=
let
loc
=
e1
.
dt_loc
in
let
top
=
Dterm
.
dterm
?
loc
DTtrue
in
Dterm
.
dterm
?
loc
(
DTbinop
(
DTor_asym
,
e1
,
top
))
in
begin
match
op
with
|
Ptree
.
Tand
->
k
DTand
|
Ptree
.
Tand_asym
->
k
DTand_asym
|
Ptree
.
Tor
->
k
DTor
|
Ptree
.
Tor_asym
->
k
DTor_asym
|
Ptree
.
Timplies
->
k
DTimplies
|
Ptree
.
Tiff
->
k
DTiff
|
Ptree
.
Tby
->
DTbinop
(
DTimplies
,
et
()
,
e2
)
|
Ptree
.
Tso
->
DTbinop
(
DTand
,
e2
,
et
()
)
end
|
Ptree
.
Tquant
(
q
,
uqu
,
trl
,
e1
)
->
let
qvl
=
List
.
map
(
quant_var
uc
)
uqu
in
let
denv
=
denv_add_quant
denv
qvl
in
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment