Skip to content

Commit 91dd7e5

Browse files
committed
SMV: remove legacy grammar rules
This removes the parser rules related to the following legacy constructs: * EXTERN * INC, DEC, ADD, SUB * complex identifiers that contain round ( ... ) parentheses * switch None of these are recognised by NuSMV.
1 parent d25b571 commit 91dd7e5

File tree

5 files changed

+4
-57
lines changed

5 files changed

+4
-57
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# EBMC 6.0
2+
3+
* SMV: removed legacy keywords EXTERN and switch
4+
15
# EBMC 5.9
26

37
* Verilog: fix for four-valued | and &

regression/smv/smv/smv1.desc

Lines changed: 0 additions & 8 deletions
This file was deleted.

regression/smv/smv/smv1.smv

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/smvlang/parser.y

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,6 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &location, YYSTYPE &module_n
257257
%token min_Token "min"
258258

259259
/* Not in the NuSMV manual */
260-
%token EXTERN_Token "EXTERN"
261-
%token switch_Token "switch"
262260
%token notin_Token "notin"
263261
%token R_Token "R"
264262

@@ -280,12 +278,7 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &location, YYSTYPE &module_n
280278
%token NOTEQUAL_Token "!="
281279
%token LTLT_Token "<<"
282280
%token GTGT_Token ">>"
283-
284-
%token INC_Token
285-
%token DEC_Token
286281
%token BECOMES_Token ":="
287-
%token ADD_Token
288-
%token SUB_Token
289282

290283
%token IDENTIFIER_Token "identifier"
291284
%token QIDENTIFIER_Token "quoted identifier"
@@ -360,9 +353,6 @@ module_element:
360353
| ltl_specification
361354
| compute_specification
362355
| isa_declaration
363-
/* not in the NuSMV manual */
364-
| EXTERN_Token extern_var semi_opt
365-
| EXTERN_Token
366356
;
367357

368358
var_declaration:
@@ -523,9 +513,6 @@ ltl_specification:
523513
}
524514
;
525515

526-
extern_var : variable_identifier EQUAL_Token STRING_Token
527-
;
528-
529516
var_list : var_decl
530517
| var_list var_decl
531518
;
@@ -740,11 +727,6 @@ basic_expr : constant
740727
// This rule is part of "complex_identifier" in the NuSMV manual.
741728
init($$, ID_smv_self);
742729
}
743-
| basic_expr '(' simple_expr ')'
744-
{
745-
// Not in the NuSMV grammar.
746-
binary($$, $1, ID_index, $3);
747-
}
748730
| '(' formula ')' { $$=$2; }
749731
| NOT_Token basic_expr { init($$, ID_not); mto($$, $2); }
750732
| "abs" '(' basic_expr ')' { unary($$, ID_smv_abs, $3); }
@@ -791,12 +773,6 @@ basic_expr : constant
791773
{ init($$, ID_if); mto($$, $1); mto($$, $3); mto($$, $5); }
792774
| case_Token cases esac_Token { $$=$2; }
793775
| next_Token '(' basic_expr ')' { init($$, ID_smv_next); mto($$, $3); }
794-
/* Not in NuSMV manual */
795-
| INC_Token '(' basic_expr ')' { init($$, "inc"); mto($$, $3); }
796-
| DEC_Token '(' basic_expr ')' { init($$, "dec"); mto($$, $3); }
797-
| ADD_Token '(' basic_expr ',' basic_expr ')' { j_binary($$, $3, ID_plus, $5); }
798-
| SUB_Token '(' basic_expr ',' basic_expr ')' { init($$, ID_minus); mto($$, $3); mto($$, $5); }
799-
| switch_Token '(' variable_identifier ')' '{' switches '}' { init($$, ID_switch); mto($$, $3); mto($$, $6); }
800776
/* CTL */
801777
| AX_Token basic_expr { init($$, ID_AX); mto($$, $2); }
802778
| AF_Token basic_expr { init($$, ID_AF); mto($$, $2); }
@@ -908,11 +884,6 @@ complex_identifier:
908884
{
909885
binary($$, $1, ID_index, $3);
910886
}
911-
| complex_identifier '(' basic_expr ')'
912-
{
913-
// Not in the NuSMV grammar.
914-
binary($$, $1, ID_index, $3);
915-
}
916887
;
917888

918889
cases :
@@ -925,16 +896,6 @@ case : formula ':' formula ';'
925896
{ binary($$, $1, ID_case, $3); }
926897
;
927898

928-
switches :
929-
{ init($$, "switches"); }
930-
| switches switch
931-
{ $$=$1; mto($$, $2); }
932-
;
933-
934-
switch : NUMBER_Token ':' basic_expr ';'
935-
{ init($$, ID_switch); mto($$, $1); mto($$, $3); }
936-
;
937-
938899
%%
939900

940901
int yysmverror(const std::string &error)

src/smvlang/scanner.l

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,6 @@ void newlocation(YYSTYPE &x)
168168
"min" token(min_Token);
169169

170170
/* Not in the NuSMV manual */
171-
"EXTERN" token(EXTERN_Token);
172-
"switch" token(switch_Token);
173171
"notin" token(notin_Token);
174172
"R" token(R_Token);
175173

0 commit comments

Comments
 (0)