Skip to content

Commit ac9b0ec

Browse files
committed
kontrol/{utils,foundry}: make sure to build modules that can be included at prove time
1 parent 1484483 commit ac9b0ec

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/kontrol/foundry.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,9 @@ def load_lemmas(self, lemmas_id: str | None) -> KFlatModule | None:
559559
lemmas_path = Path(lemmas_file)
560560
if not lemmas_path.is_file():
561561
raise ValueError(f'Supplied lemmas path is not a file: {lemmas_path}')
562-
modules = self.kevm.parse_modules(lemmas_path, module_name=lemmas_name)
562+
modules = self.kevm.parse_modules(
563+
lemmas_path, module_name=lemmas_name, include_dirs=(kdist.get('kontrol.foundry'),)
564+
)
563565
lemmas_module = single(module for module in modules.modules if module.name == lemmas_name)
564566
non_rule_sentences = [sent for sent in lemmas_module.sentences if not isinstance(sent, KRule)]
565567
if non_rule_sentences:

src/kontrol/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ def append_to_file(file_path: Path, content: str) -> None:
146146

147147

148148
def empty_lemmas_file_contents() -> str:
149-
return """requires "foundry.md"
149+
return """module KONTROL-LEMMAS
150150
151-
module KONTROL-LEMMAS
151+
imports FOUNDRY-MAIN
152152
153153
// Your lemmas go here
154154
// Not sure what to do next? Try checking the documentation for writing lemmas: https://docs.runtimeverification.com/kontrol/guides/advancing-proofs/kevm-lemmas

0 commit comments

Comments
 (0)