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

[kprove] intermediate claim modules not included in output of --emit-json-spec #2574

Closed
ehildenb opened this issue Apr 30, 2022 · 1 comment · Fixed by #2738
Closed

[kprove] intermediate claim modules not included in output of --emit-json-spec #2574

ehildenb opened this issue Apr 30, 2022 · 1 comment · Fixed by #2738
Assignees

Comments

@ehildenb
Copy link
Member

ehildenb commented Apr 30, 2022

Given the following K definition:

module TEST
    imports BOOL
    imports INT
    configuration <k> $PGM:Int </k>
    rule <k> 1 => 2 ... </k>
endmodule

module SOME-OTHER
    imports TEST
endmodule

module TEST-INTERMEDIATE
    imports TEST
    claim <k> 3 => 4 ... </k>
endmodule

module TEST-SPEC
    imports TEST-INTERMEDIATE 
    claim <k> 4 => 5 ... </k>
endmodule

You can run the following commands:

$ kompile --backend haskell test.k --main-module TEST --syntax-module TEST

$ kprovex test.k --spec-module TEST-SPEC --dry-run --emit-json-spec spec.json
kore-exec /home/dev/src/k/./test-kompiled/definition.kore --module TEST --prove /home/dev/src/k/./.kprove-2022-04-30-04-50-34-081-d9e7acef-013b-41e2-ad32-6a0bb24d4dad/spec.kore --spec-module TEST-SPEC --output /home/dev/src/k/./.kprove-2022-04-30-04-50-34-081-d9e7acef-013b-41e2-ad32-6a0bb24d4dad/result.kore

$ cat spec.json | jq .
{
  "format": "KAST",
  "version": 1,
  "term": {
    "node": "KFlatModule",
    "name": "TEST-SPEC",
    "imports": [
      {
        "node": "KImport",
        "name": "TEST-INTERMEDIATE",
        "isPublic": true
      }
    ],
    "localSentences": [
      {
        "node": "KClaim",
        "body": {
          "node": "KApply",
          "label": "<generatedTop>",
          "variable": false,
          "arity": 2,
          "args": [
            {
              "node": "KApply",
              "label": "<k>",
              "variable": false,
              "arity": 1,
              "args": [
                {
                  "node": "KSequence",
                  "arity": 2,
                  "items": [
                    {
                      "node": "KRewrite",
                      "lhs": {
                        "node": "KToken",
                        "sort": "Int",
                        "token": "4"
                      },
                      "rhs": {
                        "node": "KToken",
                        "sort": "Int",
                        "token": "5"
                      },
                      "att": ""
                    },
                    {
                      "node": "KVariable",
                      "name": "_DotVar1",
                      "originalName": "_DotVar1"
                    }
                  ]
                }
              ]
            },
            {
              "node": "KVariable",
              "name": "_DotVar0",
              "originalName": "_DotVar0"
            }
          ]
        },
        "requires": {
          "node": "KToken",
          "sort": "Bool",
          "token": "true"
        },
        "ensures": {
          "node": "KToken",
          "sort": "Bool",
          "token": "true"
        },
        "att": {
          "node": "KAtt",
          "att": {
            "org.kframework.attributes.Location": "Location(24,11,24,30)",
            "org.kframework.attributes.Source": "Source(/home/dev/src/k/test.k)",
            "org.kframework.definition.Production": "syntax #RuleContent ::= #RuleBody [klabel(#ruleNoConditions), symbol]"
          }
        }
      }
    ],
    "att": {
      "node": "KAtt",
      "att": {
        "org.kframework.attributes.Location": "Location(21,1,26,10)",
        "org.kframework.attributes.Source": "Source(/home/dev/src/k/test.k)"
      }
    }
  }
}

The key here is that we see only one claim (the one from module TEST-SPEC), but not the claim from the included module TEST-INTERMEDIATE. This is because we are only outputting a single module in JSON. I propose we instead output every module imported by the --spec-module but not already included in the --main-module, that we there is enough information to reconstruct an entire definition.

This is annoying for the summarizer, because it means that we can only have one module full of claims at a time.

@ehildenb ehildenb changed the title [kprovex] intermediate claim modules not included in output of --emit-json-spec [kprove] intermediate claim modules not included in output of --emit-json-spec Jul 19, 2022
@ehildenb
Copy link
Member Author

This is now blocking the Foundry verification project.

@radumereuta radumereuta linked a pull request Jul 20, 2022 that will close this issue
@radumereuta radumereuta self-assigned this Jul 20, 2022
h0nzZik pushed a commit to h0nzZik/k that referenced this issue Nov 24, 2022
…untimeverification#1939)

* haskell-backend/src/main/native/haskell-backend: 39a42a5a - Validate function definitions (runtimeverification#2168)

* haskell-backend/src/main/native/haskell-backend: 97336086 - Issue 2100 follow up (runtimeverification#2574)

* haskell-backend/src/main/native/haskell-backend: 5dcac768 - Update dependency: deps/k_release (runtimeverification#2576)

* haskell-backend/src/main/native/haskell-backend: b16b0417 - NormalizedAc.concreteElements, InternalMap, InternalSet: use HashMap and HashSet (runtimeverification#2543)

* haskell-backend/src/main/native/haskell-backend: 7330ab77 - Update regression tests (runtimeverification#2575)

* haskell-backend/src/main/native/haskell-backend: fc0ae5f7 - Make SideCondition.assumeDefined total (runtimeverification#2577)

* haskell-backend/src/main/native/haskell-backend: 37120f76 - Update dependency: deps/k_release (runtimeverification#2579)

* haskell-backend/src/main/native/haskell-backend: ab0d48cb - Docker build update (runtimeverification#2578)

* haskell-backend/src/main/native/haskell-backend: 314b81b6 - Remove outdated guidance for developers (#2563)

* haskell-backend/src/main/native/haskell-backend: b199d525 - Revert function validation (runtimeverification#2582)

* haskell-backend/src/main/native/haskell-backend: cb2c54e8 - Update dependency: deps/k_release (runtimeverification#2583)

* haskell-backend/src/main/native/haskell-backend: 486dfd5d - kore-repl: call `warnIfLowProductivity` before throwing `ExitSuccess` or `ExitFailure` (runtimeverification#2581)

* haskell-backend/src/main/native/haskell-backend: b0e48e43 - Trim source paths in regression tests (runtimeverification#2588)

* haskell-backend/src/main/native/haskell-backend: 9686e3ca - Remove support for C semantics (#2598)

* haskell-backend/src/main/native/haskell-backend: e439a425 - remove-import-groups.sh: Handle files without terminal newlines (runtimeverification#2590)

* haskell-backend/src/main/native/haskell-backend: f77318a5 - Fix unparsing built-ins (runtimeverification#2540)

* haskell-backend/src/main/native/haskell-backend: 1fede2ca - Use Makefile for generating regression tests (runtimeverification#2580)

* haskell-backend/src/main/native/haskell-backend: 0362ccec - Update dependency: deps/k_release (runtimeverification#2600)

* haskell-backend/src/main/native/haskell-backend: 8cf981da - Validate functions (runtimeverification#2585)

* haskell-backend/src/main/native/haskell-backend: 9ef9184f - kore-0.45.0.0 (runtimeverification#2609)

* haskell-backend/src/main/native/haskell-backend: 6c84752c - Distribute \next over \or in simplifier (runtimeverification#2608)

* haskell-backend/src/main/native/haskell-backend: 8d69854d - Add location information to `WarnIfLowProductivity` (runtimeverification#2594)

* haskell-backend/src/main/native/haskell-backend: d976c2d1 - kore-repl: add session commands when generating a bug report (runtimeverification#2614)

* haskell-backend/src/main/native/haskell-backend: 81cf49ce - Keep Key attributes in KeyAttributes (runtimeverification#2603)

* haskell-backend/src/main/native/haskell-backend: 9099b483 - Implement hooks string2base and base2string over 2 <= base <= 36 (runtimeverification#2618)

* haskell-backend/src/main/native/haskell-backend: ba52e5fc - Update dependency: deps/k_release (runtimeverification#2613)

* haskell-backend/src/main/native/haskell-backend: 7eaef393 - Update dependency: deps/k_release (runtimeverification#2622)

* haskell-backend/src/main/native/haskell-backend: 3cb69096 - Overhaul pattern smart constructors (runtimeverification#2615)

* haskell-backend/src/main/native/haskell-backend: 601f0cb5 - Move Attribute.Pattern to TermLike (runtimeverification#2607)

* haskell-backend/src/main/native/haskell-backend: b39f7e86 - prelude.kore: Fix function equations for LLVM backend (runtimeverification#2629)

* map-symbolic-tests-haskell/assignment-11-spec.k.out: Update results

Co-authored-by: Thomas Tuegel <thomas.tuegel@runtimeverification.com>
Co-authored-by: Thomas Tuegel <ttuegel@mailbox.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants