|
3 | 3 | the manifest.json files. Prominent checks include: |
4 | 4 | * .tla files containing pluscal or proofs are marked as such |
5 | 5 | * .tla files importing community modules have those modules listed |
6 | | - * .cfg files with certain features are marked as such |
7 | 6 | * Human-written fields are not empty |
8 | 7 | """ |
9 | 8 |
|
@@ -76,34 +75,6 @@ def get_module_features(examples_root, path, parser, queries): |
76 | 75 | tree, _, _ = tla_utils.parse_module(examples_root, parser, path) |
77 | 76 | return get_tree_features(tree, queries) |
78 | 77 |
|
79 | | -# Regexes mapping to features for models |
80 | | -model_features = { |
81 | | - re.compile('^PROPERTY', re.MULTILINE) : 'liveness', |
82 | | - re.compile('^PROPERTIES', re.MULTILINE): 'liveness', |
83 | | - re.compile('^SYMMETRY', re.MULTILINE): 'symmetry', |
84 | | - re.compile('^ALIAS', re.MULTILINE): 'alias', |
85 | | - re.compile('^VIEW', re.MULTILINE): 'view', |
86 | | - re.compile('^CONSTRAINT', re.MULTILINE): 'state constraint', |
87 | | - re.compile('^CONSTRAINTS', re.MULTILINE): 'state constraint', |
88 | | - re.compile('^CHECK_DEADLOCK\\s+FALSE', re.MULTILINE) : 'ignore deadlock' |
89 | | -} |
90 | | - |
91 | | -def get_model_features(examples_root, path): |
92 | | - """ |
93 | | - Finds features present in the given .cfg model file. |
94 | | - This will be a best-effort regex search until a tree-sitter grammar is |
95 | | - created for .cfg files. |
96 | | - """ |
97 | | - path = tla_utils.from_cwd(examples_root, path) |
98 | | - features = [] |
99 | | - model_text = None |
100 | | - with open(path, 'rt') as model_file: |
101 | | - model_text = model_file.read() |
102 | | - for regex, feature in model_features.items(): |
103 | | - if regex.search(model_text): |
104 | | - features.append(feature) |
105 | | - return set(features) |
106 | | - |
107 | 78 | # All the standard modules available when using TLC |
108 | 79 | tlc_modules = { |
109 | 80 | 'Bags', |
@@ -216,14 +187,6 @@ def check_features(parser, queries, manifest, examples_root): |
216 | 187 | + f'expected {list(expected_imports)}, actual {list(actual_imports)}' |
217 | 188 | ) |
218 | 189 | for model in module['models']: |
219 | | - expected_features = get_model_features(examples_root, model['path']) |
220 | | - actual_features = set(model['features']) |
221 | | - if expected_features != actual_features: |
222 | | - success = False |
223 | | - logging.error( |
224 | | - f'Model {model["path"]} has incorrect features in manifest; ' |
225 | | - + f'expected {list(expected_features)}, actual {list(actual_features)}' |
226 | | - ) |
227 | 190 | if tla_utils.has_state_count(model) and not tla_utils.is_state_count_valid(model): |
228 | 191 | success = False |
229 | 192 | logging.error( |
|
0 commit comments