Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
2ced9de6
Commit
2ced9de6
authored
10 months ago
by
Loïc Correnson
Committed by
Virgile Prevosto
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[kernel] fix module name parsing
parent
60588ff3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/kernel_internals/parsing/logic_parser.mly
+12
-8
12 additions, 8 deletions
src/kernel_internals/parsing/logic_parser.mly
tests/spec/module.i
+6
-6
6 additions, 6 deletions
tests/spec/module.i
tests/spec/oracle/module.res.oracle
+6
-7
6 additions, 7 deletions
tests/spec/oracle/module.res.oracle
with
24 additions
and
21 deletions
src/kernel_internals/parsing/logic_parser.mly
+
12
−
8
View file @
2ced9de6
...
...
@@ -1681,10 +1681,14 @@ logic_def:
{
LDaxiomatic
(
$
2
,$
4
)
}
|
MODULE
push_module_identifier
LBRACE
logic_decls
RBRACE
{
pop_module_types
()
;
LDmodule
(
$
2
,$
4
)
}
|
IMPORT
drv
=
module_driver
mId
=
LONGIDENT
SEMICOLON
{
LDimport
(
drv
,
mId
,
None
)
}
|
IMPORT
drv
=
module_driver
mId
=
LONGIDENT
AS
asId
=
identifier
SEMICOLON
{
LDimport
(
drv
,
mId
,
Some
asId
)
}
|
IMPORT
mId
=
module_name
SEMICOLON
{
LDimport
(
None
,
mId
,
None
)
}
|
IMPORT
mId
=
module_name
AS
id
=
identifier
SEMICOLON
{
LDimport
(
None
,
mId
,
Some
id
)
}
|
IMPORT
drv
=
identifier
COLON
mId
=
module_name
SEMICOLON
{
LDimport
(
Some
drv
,
mId
,
None
)
}
|
IMPORT
drv
=
identifier
COLON
mId
=
module_name
AS
id
=
identifier
SEMICOLON
{
LDimport
(
Some
drv
,
mId
,
Some
id
)
}
|
TYPE
poly_id_type_add_typename
EQUAL
typedef
SEMICOLON
{
let
(
id
,
tvars
)
=
$
2
in
exit_type_variables_scope
()
;
...
...
@@ -1692,13 +1696,13 @@ logic_def:
}
;
module_
driver
:
|
identifier
_or_typename_full
COMMA
{
Some
$
1
}
|
{
None
}
module_
name
:
|
identifier
{
$
1
}
|
LONGIDENT
{
$
1
}
;
push_module_identifier
:
|
LONGIDENT
{
Stack
.
push
$
1
module_stack
;
$
1
}
|
module_name
{
Stack
.
push
$
1
module_stack
;
$
1
}
;
deprecated_logic_decl
:
...
...
This diff is collapsed.
Click to expand it.
tests/spec/module.i
+
6
−
6
View file @
2ced9de6
...
...
@@ -3,19 +3,19 @@
*/
/*@
module
f
oo
::Bar
{
module
F
oo {
type t;
logic t e;
logic t op(t x, t y);
logic t opN(t x, integer n) = n >= 0 ? op(x, opN(x,n-1)) : e;
}
module foo::
Jazz
{
import
f
oo
::Bar
\as X;
module foo::
bar
{
import
F
oo \as X;
logic t inv(X::t x);
logic t opN(t x, integer n) = n >= 0 ? X::opN(x,n) : X::opN(inv(x),-n);
}
import
f
oo
::Bar
\as A;
import foo::
Jazz
\as B;
lemma AbsOp: \forall
f
oo::
Bar::
t x, integer n;
import
F
oo \as A;
import foo::
bar
\as B;
lemma AbsOp: \forall
F
oo::t x, integer n;
B::opN(x,\abs(n)) == A::opN(x,\abs(n));
*/
This diff is collapsed.
Click to expand it.
tests/spec/oracle/module.res.oracle
+
6
−
7
View file @
2ced9de6
[kernel] Parsing module.i (no preprocessing)
/* Generated by Frama-C */
/*@
module
f
oo
::Bar
{
module
F
oo {
type t;
logic t e;
...
...
@@ -13,17 +13,16 @@ module foo::Bar {
}
*/
/*@
module foo::
Jazz
{
logic
f
oo::
Bar::
t inv(
f
oo::
Bar::
t x) ;
module foo::
bar
{
logic
F
oo::t inv(
F
oo::t x) ;
logic
f
oo::
Bar::
t opN(
f
oo::
Bar::
t x, ℤ n) =
n ≥ 0?
f
oo::
Bar::
opN(x, n):
f
oo::
Bar::
opN(inv(x), -n);
logic
F
oo::t opN(
F
oo::t x, ℤ n) =
n ≥ 0?
F
oo::opN(x, n):
F
oo::opN(inv(x), -n);
}
*/
/*@
lemma AbsOp:
∀ foo::Bar::t x, ℤ n;
foo::Jazz::opN(x, \abs(n)) ≡ foo::Bar::opN(x, \abs(n));
∀ Foo::t x, ℤ n; foo::bar::opN(x, \abs(n)) ≡ Foo::opN(x, \abs(n));
*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment