Skip to content

Commit 3966965

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

File tree

7 files changed

+4
-66
lines changed

7 files changed

+4
-66
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/expr2smv.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,6 @@ expr2smvt::resultt expr2smvt::convert_rec(const exprt &src)
782782
else if(src.id() == ID_smv_setin)
783783
return convert_binary(to_binary_expr(src), "in", precedencet::IN);
784784

785-
else if(src.id() == ID_smv_setnotin)
786-
return convert_binary(to_binary_expr(src), "notin", precedencet::IN);
787-
788785
else if(src.id() == ID_smv_union)
789786
return convert_binary(to_binary_expr(src), "union", precedencet::UNION);
790787

src/smvlang/parser.y

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +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"
262-
%token notin_Token "notin"
263260
%token R_Token "R"
264261

265262
%token DOTDOT_Token ".."
@@ -280,12 +277,7 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &location, YYSTYPE &module_n
280277
%token NOTEQUAL_Token "!="
281278
%token LTLT_Token "<<"
282279
%token GTGT_Token ">>"
283-
284-
%token INC_Token
285-
%token DEC_Token
286280
%token BECOMES_Token ":="
287-
%token ADD_Token
288-
%token SUB_Token
289281

290282
%token IDENTIFIER_Token "identifier"
291283
%token QIDENTIFIER_Token "quoted identifier"
@@ -360,9 +352,6 @@ module_element:
360352
| ltl_specification
361353
| compute_specification
362354
| isa_declaration
363-
/* not in the NuSMV manual */
364-
| EXTERN_Token extern_var semi_opt
365-
| EXTERN_Token
366355
;
367356

368357
var_declaration:
@@ -523,9 +512,6 @@ ltl_specification:
523512
}
524513
;
525514

526-
extern_var : variable_identifier EQUAL_Token STRING_Token
527-
;
528-
529515
var_list : var_decl
530516
| var_list var_decl
531517
;
@@ -742,11 +728,6 @@ basic_expr : constant
742728
// This rule is part of "complex_identifier" in the NuSMV manual.
743729
init($$, ID_smv_self);
744730
}
745-
| basic_expr '(' simple_expr ')'
746-
{
747-
// Not in the NuSMV grammar.
748-
binary($$, $1, ID_index, $3);
749-
}
750731
| '(' formula ')' { $$=$2; }
751732
| NOT_Token basic_expr { init($$, ID_not); mto($$, $2); }
752733
| "abs" '(' basic_expr ')' { unary($$, ID_smv_abs, $3); }
@@ -793,12 +774,6 @@ basic_expr : constant
793774
{ init($$, ID_if); mto($$, $1); mto($$, $3); mto($$, $5); }
794775
| case_Token cases esac_Token { $$=$2; }
795776
| next_Token '(' basic_expr ')' { init($$, ID_smv_next); mto($$, $3); }
796-
/* Not in NuSMV manual */
797-
| INC_Token '(' basic_expr ')' { init($$, "inc"); mto($$, $3); }
798-
| DEC_Token '(' basic_expr ')' { init($$, "dec"); mto($$, $3); }
799-
| ADD_Token '(' basic_expr ',' basic_expr ')' { j_binary($$, $3, ID_plus, $5); }
800-
| SUB_Token '(' basic_expr ',' basic_expr ')' { init($$, ID_minus); mto($$, $3); mto($$, $5); }
801-
| switch_Token '(' variable_identifier ')' '{' switches '}' { init($$, ID_switch); mto($$, $3); mto($$, $6); }
802777
/* CTL */
803778
| AX_Token basic_expr { init($$, ID_AX); mto($$, $2); }
804779
| AF_Token basic_expr { init($$, ID_AF); mto($$, $2); }
@@ -910,11 +885,6 @@ complex_identifier:
910885
{
911886
binary($$, $1, ID_index, $3);
912887
}
913-
| complex_identifier '(' basic_expr ')'
914-
{
915-
// Not in the NuSMV grammar.
916-
binary($$, $1, ID_index, $3);
917-
}
918888
;
919889

920890
cases :
@@ -927,16 +897,6 @@ case : formula ':' formula ';'
927897
{ binary($$, $1, ID_case, $3); }
928898
;
929899

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

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

src/smvlang/scanner.l

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +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);
173-
"notin" token(notin_Token);
174171
"R" token(R_Token);
175172

176173
[\$A-Za-z_][A-Za-z0-9_\$#-]* {

src/smvlang/smv_typecheck.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,10 +1115,6 @@ void smv_typecheckt::typecheck_expr_rec(exprt &expr, modet mode, bool next)
11151115

11161116
expr.type() = bool_typet();
11171117
}
1118-
else if(expr.id() == ID_smv_setnotin)
1119-
{
1120-
expr.type()=bool_typet();
1121-
}
11221118
else if(expr.id() == ID_unary_minus)
11231119
{
11241120
auto &uminus_expr = to_unary_minus_expr(expr);

0 commit comments

Comments
 (0)