Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proof hint generation flag #3821

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
out.hint
22 changes: 22 additions & 0 deletions k-distribution/tests/regression-new/proof-instrumentation/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DEF=test
KOMPILE_BACKEND=llvm
KOMPILE_FLAGS+=--gen-glr-bison-parser --llvm-proof-hint-instrumentation
LLVM_KRUN_FLAGS=-d ./test-kompiled --proof-hints

check: out.hint
head -c4 out.hint | diff - <(echo -n 'HINT')

out.hint: test.kore
rm -f $@
$(LLVM_KRUN) $(LLVM_KRUN_FLAGS) \
-c PGM $< Foo korefile -o $@

test.kore: test.in kompile
./test-kompiled/parser_PGM $< > $@

include ../../../include/kframework/ktest.mak

clean:
rm -rf out.hint test.kore $(KOMPILED_DIR) .depend-tmp .depend .kompile-* .krun-* .kprove-* kore-exec.tar.gz

update-results: CHECK=> test.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo()
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) K Team. All Rights Reserved.
module TEST-SYNTAX
syntax Foo ::= foo() | bar()
endmodule

module TEST
imports TEST-SYNTAX
rule foo() => bar()
endmodule
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ private void llvmKompile(String type, String executable) {
args.add(files.resolveKompiled("dt").getCanonicalPath());
args.add(type);

if (options.enableProofHints) {
args.add("--proof-hint-instrumentation");
}

// Arguments after this point are passed on to Clang.
args.add("--");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,10 @@ public List<String> convert(String str) {
descriptionKey = "file",
hidden = true)
public String llvmKompileOutput = null;

@Parameter(
names = "--llvm-proof-hint-instrumentation",
description = "Emit proof hint instrumentation code into the generated interpreter",
hidden = true)
public boolean enableProofHints;
}