Skip to content

Commit dc25f34

Browse files
lemmyClaude Sonnet 4.5
andcommitted
Add community modules path argument to proof checking script
Updated the check_proofs.py script to include a new optional argument for specifying the path to extracted community modules. This allows for better integration of community modules during proof validation. Additionally, modified the CI workflow to create and unzip the community modules directory before running the proof checks. Co-authored-by: Claude Sonnet 4.5 <sonnet@anthropic.com> Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
1 parent b1bbfd5 commit dc25f34

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/scripts/check_proofs.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212

1313
parser = ArgumentParser(description='Validate all proofs in all modules with TLAPM.')
1414
parser.add_argument('--tlapm_path', help='Path to TLAPM install dir; should have bin and lib subdirs', required=False, default = 'deps/tlapm')
15+
parser.add_argument('--community_modules_path', help='Path to extracted community modules directory', required=False, default='')
1516
parser.add_argument('--examples_root', help='Root directory of the tlaplus/examples repository', required=False, default='.')
1617
parser.add_argument('--skip', nargs='+', help='Space-separated list of .tla modules to skip checking', required=False, default=[])
1718
parser.add_argument('--only', nargs='+', help='If provided, only check proofs in this space-separated list', required=False, default=[])
1819
parser.add_argument('--verbose', help='Set logging output level to debug', action='store_true')
1920
args = parser.parse_args()
2021

2122
tlapm_path = normpath(args.tlapm_path)
23+
community_modules_path = normpath(args.community_modules_path) if args.community_modules_path else ''
2224
examples_root = args.examples_root
2325
manifest = tla_utils.load_all_manifests(examples_root)
2426
skip_modules = args.skip
@@ -50,12 +52,15 @@
5052
full_module_path = tla_utils.from_cwd(examples_root, module_path)
5153
module_dir = dirname(full_module_path)
5254
try:
55+
tlapm_args = [
56+
tlapm_path, full_module_path,
57+
'-I', module_dir,
58+
'--stretch', '5'
59+
]
60+
if community_modules_path:
61+
tlapm_args.extend(['-I', community_modules_path])
5362
tlapm_result = subprocess.run(
54-
[
55-
tlapm_path, full_module_path,
56-
'-I', module_dir,
57-
'--stretch', '5'
58-
],
63+
tlapm_args,
5964
stdout = subprocess.PIPE,
6065
stderr = subprocess.STDOUT,
6166
text = True

.github/workflows/CI.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,12 @@ jobs:
135135
- name: Check proofs
136136
if: matrix.os != 'windows-latest' && !matrix.unicode
137137
run: |
138-
python $SCRIPT_DIR/check_proofs.py \
139-
--tlapm_path $DEPS_DIR/tlapm \
138+
# Extract community modules for TLAPM
139+
mkdir -p $DEPS_DIR/community/modules
140+
unzip -q -o $DEPS_DIR/community/modules.jar -d $DEPS_DIR/community/modules
141+
python $SCRIPT_DIR/check_proofs.py \
142+
--tlapm_path $DEPS_DIR/tlapm \
143+
--community_modules_path $DEPS_DIR/community/modules \
140144
--examples_root .
141145
- name: Smoke-test manifest generation script
142146
run: |

0 commit comments

Comments
 (0)