Skip to content

Commit 4414f33

Browse files
authored
Removed model (.cfg) file features from manifests (#182)
These unnecessary duplicate information readily found in .cfg files README.md updated with instructions for searching .cfg files for these features instead of manifest files. This change is meant to facilitate ease of contribution to this repository. Signed-off-by: Andrew Helwer <ahelwer@pm.me>
1 parent 11c7cd8 commit 4414f33

81 files changed

Lines changed: 6 additions & 531 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/check_manifest_features.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
the manifest.json files. Prominent checks include:
44
* .tla files containing pluscal or proofs are marked as such
55
* .tla files importing community modules have those modules listed
6-
* .cfg files with certain features are marked as such
76
* Human-written fields are not empty
87
"""
98

@@ -76,34 +75,6 @@ def get_module_features(examples_root, path, parser, queries):
7675
tree, _, _ = tla_utils.parse_module(examples_root, parser, path)
7776
return get_tree_features(tree, queries)
7877

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-
10778
# All the standard modules available when using TLC
10879
tlc_modules = {
10980
'Bags',
@@ -216,14 +187,6 @@ def check_features(parser, queries, manifest, examples_root):
216187
+ f'expected {list(expected_imports)}, actual {list(actual_imports)}'
217188
)
218189
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-
)
227190
if tla_utils.has_state_count(model) and not tla_utils.is_state_count_valid(model):
228191
success = False
229192
logging.error(

.github/scripts/check_small_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def check_model(module, model, expected_runtime):
4949
community_jar_path,
5050
model['mode'],
5151
module['features'],
52-
model['features'],
5352
enable_assertions,
5453
hard_timeout_in_seconds
5554
)

.github/scripts/generate_manifest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def generate_new_manifest(examples_root, spec_path, spec_name, parser, queries):
9292
'runtime': 'unknown',
9393
'size': 'unknown',
9494
'mode': 'exhaustive search',
95-
'features': sorted(list(get_model_features(examples_root, cfg_path))),
9695
'result': 'unknown'
9796
}
9897
for cfg_path in sorted(get_cfg_files(examples_root, tla_path))

.github/scripts/record_model_state_space.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ def check_model(module, model):
4545
community_jar_path,
4646
model['mode'],
4747
module['features'],
48-
model['features'],
4948
enable_assertions,
5049
hard_timeout_in_seconds
5150
)

.github/scripts/smoke_test_large_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def check_model(module, model):
4646
community_jar_path,
4747
model['mode'],
4848
module['features'],
49-
model['features'],
5049
enable_assertions,
5150
smoke_test_timeout_in_seconds
5251
)

.github/scripts/tla_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def get_run_mode(mode):
115115
else:
116116
raise NotImplementedError(f'Undefined model-check mode {mode}')
117117

118-
def get_tlc_feature_flags(module_features, model_features):
118+
def get_tlc_feature_flags(module_features):
119119
"""
120120
Selectively enables experimental TLC features according to needs.
121121
"""
@@ -133,7 +133,6 @@ def check_model(
133133
community_jar_path,
134134
mode,
135135
module_features,
136-
model_features,
137136
enable_assertions,
138137
hard_timeout_in_seconds
139138
):
@@ -172,7 +171,7 @@ def check_model(
172171
community_jar_path,
173172
tlapm_lib_path
174173
]),
175-
] + get_tlc_feature_flags(module_features, model_features)
174+
] + get_tlc_feature_flags(module_features)
176175
tlc_parameters = [
177176
module_path,
178177
'-config', model_path,

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Space contraints limit the information displayed in the table; detailed spec met
1818
You can search these files for examples exhibiting a number of features, either using the GitHub repository search or locally with the command `ls specifications/*/manifest.json | xargs grep -l $keyword`, where `$keyword` can be a value like:
1919
- `pluscal`, `proof`, or `action composition` (the `\cdot` operator)
2020
- Specs intended for trace generation (`generate`), `simulate`, or checked symbolically with Apalache (`symbolic`)
21-
- Models (`.cfg` files) using the `symmetry`, `view`, `alias`, `state constraint`, or `ignore deadlock` features
2221
- Models failing in interesting ways, like `deadlock failure`, `safety failure`, `liveness failure`, or `assumption failure`
2322

23+
It is also helpful to consult model files using specific TLC features.
24+
For this, run `ls specifications/*/*.cfg | xargs grep -l $keyword`, where `$keyword` can be a feature like `SYMMETRY`, `VIEW`, `ALIAS`, `CONSTRAINT`, or `DEADLOCK`.
25+
2426
## Validated Examples Included Here
2527
Here is a list of specs included in this repository which are validated by the CI, with links to the relevant directory and flags for various features:
2628
| Name | Author(s) | Beginner | TLAPS Proof | PlusCal | TLC Model | Apalache |

manifest-schema.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"items": {
4141
"type": "object",
4242
"additionalProperties": false,
43-
"required": ["path", "runtime", "size", "mode", "features", "result"],
43+
"required": ["path", "runtime", "size", "mode", "result"],
4444
"properties": {
4545
"path": {"type": "string"},
4646
"runtime": {
@@ -73,10 +73,6 @@
7373
}
7474
]
7575
},
76-
"features": {
77-
"type": "array",
78-
"items": {"enum": ["liveness", "symmetry", "view", "alias", "state constraint", "ignore deadlock"]}
79-
},
8076
"result": {"enum": ["success", "assumption failure", "deadlock failure", "safety failure", "liveness failure", "unknown"]}
8177
}
8278
}

specifications/Bakery-Boulangerie/manifest.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
"runtime": "00:00:10",
4141
"size": "small",
4242
"mode": "exhaustive search",
43-
"features": [
44-
"ignore deadlock"
45-
],
4643
"result": "success",
4744
"distinctStates": 655200,
4845
"totalStates": 3403584,
@@ -61,9 +58,6 @@
6158
"runtime": "00:01:00",
6259
"size": "medium",
6360
"mode": "exhaustive search",
64-
"features": [
65-
"state constraint"
66-
],
6761
"result": "success"
6862
}
6963
]

specifications/CarTalkPuzzle/manifest.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"runtime": "00:00:01",
3636
"size": "small",
3737
"mode": "exhaustive search",
38-
"features": [],
3938
"result": "success",
4039
"distinctStates": 0,
4140
"totalStates": 0,
@@ -61,7 +60,6 @@
6160
"runtime": "00:00:05",
6261
"size": "small",
6362
"mode": "exhaustive search",
64-
"features": [],
6563
"result": "success",
6664
"distinctStates": 0,
6765
"totalStates": 0,
@@ -87,7 +85,6 @@
8785
"runtime": "unknown",
8886
"size": "large",
8987
"mode": "exhaustive search",
90-
"features": [],
9188
"result": "unknown"
9289
}
9390
]

0 commit comments

Comments
 (0)