Skip to content

Commit b93b299

Browse files
authored
Merge pull request #1503 from diffblue/smv-cleanout
SMV: remove legacy grammar rules
2 parents 50fb7c4 + 859a748 commit b93b299

7 files changed

Lines changed: 2 additions & 66 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# EBMC 6.0
22
* VCD traces now written into separate files per property
33

4+
* SMV: removed legacy keywords EXTERN and switch
5+
46
# EBMC 5.11
57

68
* SystemVerilog: $unit::

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
@@ -999,9 +999,6 @@ expr2smvt::resultt expr2smvt::convert_rec(const exprt &src)
999999
else if(src.id() == ID_smv_setin)
10001000
return convert_binary(to_smv_setin_expr(src), "in", precedencet::IN);
10011001

1002-
else if(src.id() == ID_smv_setnotin)
1003-
return convert_binary(to_binary_expr(src), "notin", precedencet::IN);
1004-
10051002
else if(src.id() == ID_smv_union)
10061003
return convert_binary(to_smv_union_expr(src), "union", precedencet::UNION);
10071004

src/smvlang/parser.y

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &location, YYSTYPE &module_n
256256
%token min_Token "min"
257257

258258
/* Not in the NuSMV manual */
259-
%token EXTERN_Token "EXTERN"
260-
%token switch_Token "switch"
261-
%token notin_Token "notin"
262259
%token R_Token "R"
263260

264261
%token DOTDOT_Token ".."
@@ -279,12 +276,7 @@ static smv_parse_treet::modulet &new_module(YYSTYPE &location, YYSTYPE &module_n
279276
%token NOTEQUAL_Token "!="
280277
%token LTLT_Token "<<"
281278
%token GTGT_Token ">>"
282-
283-
%token INC_Token
284-
%token DEC_Token
285279
%token BECOMES_Token ":="
286-
%token ADD_Token
287-
%token SUB_Token
288280

289281
%token IDENTIFIER_Token "identifier"
290282
%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
;
@@ -741,11 +727,6 @@ basic_expr : constant
741727
// This rule is part of "complex_identifier" in the NuSMV manual.
742728
init($$, ID_smv_self);
743729
}
744-
| basic_expr '(' simple_expr ')'
745-
{
746-
// Not in the NuSMV grammar.
747-
binary($$, $1, ID_index, $3);
748-
}
749730
| '(' formula ')' { $$=$2; }
750731
| NOT_Token basic_expr { init($$, ID_not); mto($$, $2); }
751732
| "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); }
@@ -912,11 +887,6 @@ complex_identifier:
912887
{
913888
binary($$, $1, ID_index, $3);
914889
}
915-
| complex_identifier '(' basic_expr ')'
916-
{
917-
// Not in the NuSMV grammar.
918-
binary($$, $1, ID_index, $3);
919-
}
920890
;
921891

922892
cases :
@@ -929,16 +899,6 @@ case : formula ':' formula ';'
929899
{ binary($$, $1, ID_case, $3); }
930900
;
931901

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

944904
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
@@ -1245,10 +1245,6 @@ void smv_typecheckt::typecheck_expr_node(exprt &expr, modet mode)
12451245
{
12461246
expr.type() = bool_typet{};
12471247
}
1248-
else if(expr.id() == ID_smv_setnotin)
1249-
{
1250-
expr.type()=bool_typet();
1251-
}
12521248
else if(expr.id() == ID_unary_minus)
12531249
{
12541250
auto &uminus_expr = to_unary_minus_expr(expr);

0 commit comments

Comments
 (0)