Skip to content

Commit

Permalink
Merge branch 'master' into map-input-names
Browse files Browse the repository at this point in the history
  • Loading branch information
palinatolmach committed Aug 22, 2024
2 parents 2db7248 + 17f06d2 commit 0e44447
Show file tree
Hide file tree
Showing 54 changed files with 651 additions and 236 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apt-get update \
python3-dev \
python3-distutils \
python3-pip \
xxd \
zlib1g-dev

COPY --from=Z3 /usr/bin/z3 /usr/bin/z3
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ The following dependencies are needed either at build time or runtime:
* [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/)
* [python](https://www.python.org)
* [stack](https://docs.haskellstack.org/en/stable/README/)
* [xxd](https://github.com/vim/vim/blob/master/runtime/doc/xxd.man)
* [zlib](https://www.zlib.net/)
* [z3](https://github.com/Z3Prover/z3) (on some distributions libz3 is also
needed and packaged separately) Note that you need version 4.12.1 of Z3,
Expand Down
2 changes: 1 addition & 1 deletion deps/haskell-backend_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.58
v0.1.76
2 changes: 1 addition & 1 deletion deps/llvm-backend_release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.69
0.1.81
2 changes: 1 addition & 1 deletion deps/z3
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.12.1
4.13.0
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
description = "K Framework";
inputs = {
llvm-backend.url = "github:runtimeverification/llvm-backend/v0.1.69";
llvm-backend.url = "github:runtimeverification/llvm-backend/v0.1.81";
haskell-backend = {
url = "github:runtimeverification/haskell-backend/v0.1.58";
url = "github:runtimeverification/haskell-backend/v0.1.76";
inputs.rv-utils.follows = "llvm-backend/rv-utils";
inputs.nixpkgs.follows = "llvm-backend/nixpkgs";
};
Expand Down
2 changes: 1 addition & 1 deletion haskell-backend/src/main/native/haskell-backend
Submodule haskell-backend updated 92 files
+9 −0 booster/library/Booster/CLOptions.hs
+1 −14 booster/library/Booster/Definition/Base.hs
+2 −2 booster/library/Booster/Definition/Ceil.hs
+41 −190 booster/library/Booster/JsonRpc.hs
+9 −3 booster/library/Booster/JsonRpc/Utils.hs
+22 −5 booster/library/Booster/LLVM.hs
+117 −99 booster/library/Booster/Pattern/ApplyEquations.hs
+261 −0 booster/library/Booster/Pattern/Implies.hs
+2 −1 booster/library/Booster/Pattern/Match.hs
+75 −64 booster/library/Booster/Pattern/Rewrite.hs
+5 −1 booster/library/Booster/Pattern/Util.hs
+7 −3 booster/library/Booster/SMT/Base.hs
+206 −165 booster/library/Booster/SMT/Interface.hs
+3 −3 booster/library/Booster/SMT/LowLevelCodec.hs
+44 −29 booster/library/Booster/SMT/Runner.hs
+4 −4 booster/library/Booster/SMT/Translate.hs
+15 −0 booster/library/Booster/Syntax/Json/Externalise.hs
+83 −14 booster/library/Booster/Syntax/Json/Internalise.hs
+106 −269 booster/library/Booster/Syntax/ParsedKore/Internalise.hs
+25 −2 booster/library/Booster/Util.hs
+1 −1 booster/package.yaml
+5 −5 booster/test/internalisation/imp.k
+1,031 −1,266 booster/test/internalisation/imp.kore
+123 −115 booster/test/internalisation/imp.kore.report
+29,696 −19,988 booster/test/internalisation/test-totalSupply-definition.kore
+2,772 −2,216 booster/test/internalisation/test-totalSupply-definition.kore.report
+10 −2 booster/test/llvm-integration/LLVM.hs
+0 −0 booster/test/rpc-integration/resources/implies-issue-3941.haskell.kore
+1 −0 booster/test/rpc-integration/resources/implies-issue-3941.kompile
+69,195 −0 booster/test/rpc-integration/resources/implies-issue-3941.llvm.kore
+2 −1 booster/test/rpc-integration/resources/kompile-from-double-definition.sh
+263 −257 booster/test/rpc-integration/resources/module-addition.kore
+0 −9 ...ation/test-diamond/params-mutual-constraints-terminal-log-fallbacks-and-failed-and-successful-rewrites.json
+0 −8 ...test/rpc-integration/test-diamond/params-mutual-constraints-terminal-log-fallbacks-and-failed-rewrites.json
+0 −7 booster/test/rpc-integration/test-diamond/params-mutual-constraints-terminal-log-fallbacks.json
+0 −408 ...ion/test-diamond/response-mutual-constraints-terminal-log-fallbacks-and-failed-and-successful-rewrites.json
+0 −299 ...st/rpc-integration/test-diamond/response-mutual-constraints-terminal-log-fallbacks-and-failed-rewrites.json
+0 −290 booster/test/rpc-integration/test-diamond/response-mutual-constraints-terminal-log-fallbacks.json
+4 −0 booster/test/rpc-integration/test-implies-issue-3941/README.md
+3,969 −5 booster/test/rpc-integration/test-implies-issue-3941/response-001.booster-dev
+62 −0 booster/test/rpc-integration/test-implies/response-0->B.json
+0 −25 booster/test/rpc-integration/test-implies/response-0->T.booster-dev
+62 −0 booster/test/rpc-integration/test-implies/response-B->0.json
+11 −0 booster/test/rpc-integration/test-implies/response-T->0.booster-dev
+14 −0 booster/test/rpc-integration/test-implies/response-T->0.json
+32 −6 booster/test/rpc-integration/test-implies/response-X->0.booster-dev
+0 −25 booster/test/rpc-integration/test-implies/response-X->T.booster-dev
+8 −90 booster/test/rpc-integration/test-implies/response-fail-X->Y.booster-dev
+16 −1 booster/test/rpc-integration/test-implies/response-fail-X->Y.json
+1 −0 booster/test/rpc-integration/test-implies/state-0->B.send
+32 −0 booster/test/rpc-integration/test-implies/state-B->0.send
+32 −0 booster/test/rpc-integration/test-implies/state-T->0.send
+34 −39 booster/test/rpc-integration/test-implies2/README.md
+0 −530 booster/test/rpc-integration/test-implies2/response-antecedent-bottom.booster-dev
+0 −416 booster/test/rpc-integration/test-implies2/response-constant-subst.booster-dev
+0 −380 booster/test/rpc-integration/test-implies2/response-variable-subst.booster-dev
+0 −105 booster/test/rpc-integration/test-logTiming/response-c.json
+0 −1 booster/test/rpc-integration/test-logTiming/state-c.execute
+0 −32 booster/test/rpc-integration/test-logTiming/test.sh
+23 −114 booster/tools/booster/Proxy.hs
+4 −1 booster/tools/booster/Server.hs
+4 −18 booster/tools/booster/Stats.hs
+0 −1 booster/unit-tests/Test/Booster/Fixture.hs
+15 −35 booster/unit-tests/Test/Booster/Pattern/Rewrite.hs
+1 −1 booster/unit-tests/Test/Booster/SMT/LowLevel.hs
+3 −6 booster/unit-tests/Test/Booster/Syntax/Json/Internalise.hs
+1 −1 deps/k_release
+2 −0 dev-tools/kore-rpc-dev/Server.hs
+1 −1 dev-tools/package.yaml
+5 −1 dev-tools/pretty/Pretty.hs
+27 −46 docs/2022-07-18-JSON-RPC-Server-API.md
+4 −4 flake.lock
+1 −1 flake.nix
+1 −1 kore-rpc-types/kore-rpc-types.cabal
+0 −4 kore-rpc-types/src/Kore/JsonRpc/Types.hs
+3 −1 kore/app/share/GlobalMain.hs
+2 −1 kore/kore.cabal
+27 −58 kore/src/Kore/JsonRpc.hs
+23 −10 kore/src/Kore/Rewrite/SMT/Evaluator.hs
+12 −2 kore/src/Kore/Rewrite/SMT/Translate.hs
+10 −0 kore/src/Options/SMT.hs
+30 −0 kore/src/SMT/Utils.hs
+2 −1 kore/test/Test/Kore/Rewrite/SMT/Evaluator.hs
+1 −1 package/debian/changelog
+1 −1 package/version
+3 −2 scripts/performance-tests-kevm.sh
+2 −2 scripts/performance-tests-kontrol.sh
+0 −1 test/rpc-server/logTiming/definition.kore
+0 −3 test/rpc-server/logTiming/params.json
+0 −1 test/rpc-server/logTiming/response.golden
+0 −85 test/rpc-server/logTiming/state.json
+33 −79 test/rpc-server/runTests.py
1 change: 1 addition & 0 deletions install-build-deps
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ inst_Debian() {
pkg-config \
python3 \
python3-dev \
xxd \
z3 \
zlib1g-dev

Expand Down
2 changes: 1 addition & 1 deletion install-k
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e

K_VERSION=7.1.0
K_VERSION=7.1.117

if [ `id -u` -ne 0 ]; then
echo "$0: error: This script must be run as root."
Expand Down
1 change: 1 addition & 0 deletions k-distribution/include/kframework/builtin/domains.md
Original file line number Diff line number Diff line change
Expand Up @@ -3015,6 +3015,7 @@ than the input.

```k
syntax {Width1, Width2} MInt{Width1} ::= roundMInt(MInt{Width2}) [function, total, hook(MINT.round)]
syntax {Width1, Width2} MInt{Width1} ::= signExtendMInt(MInt{Width2}) [function, total, hook(MINT.sext)]
```

```k
Expand Down
7 changes: 7 additions & 0 deletions k-distribution/tests/regression-new/mint-llvm-3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DEF=test
EXT=test
TESTDIR=.
KOMPILE_BACKEND=llvm
KOMPILE_FLAGS=--syntax-module TEST

include ../../../include/kframework/ktest.mak
19 changes: 19 additions & 0 deletions k-distribution/tests/regression-new/mint-llvm-3/test.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module TEST
imports BOOL
imports MINT

syntax MInt{64}
syntax MInt{32}

syntax KItem ::= foo(MInt{64})

syntax MInt{64} ::= m64() [function]
rule m64() => 0p64
syntax MInt{32} ::= m32() [function]
rule m32() => 0p32

rule foo(X) => .K
requires (X +MInt m64()) <=uMInt (roundMInt(m32()) <<MInt 0p64)

rule true => foo(0p64)
endmodule
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ private static Sort lub(
s ->
mod.subsorts().lessThanEq(s, Sorts.KBott())
|| mod.subsorts().greaterThan(s, Sorts.K()));
if (expectedSort != null && !expectedSort.name().equals(SORTPARAM_NAME)) {
if (expectedSort != null
&& expectedSort.head().params() == 0
&& !expectedSort.name().equals(SORTPARAM_NAME)) {
bounds.removeIf(s -> !mod.subsorts().lessThanEq(s, expectedSort));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ private List<KVariable> closure(K k) {
List<KVariable> result = new ArrayList<>();
new GatherVarsVisitor(true, errors, vars, false).apply(k);
new ComputeUnboundVariables(true, true, errors, vars, result::add).apply(k);
return result;
return result.stream().distinct().collect(Collectors.toList());
}

private Production funProd(KLabel fun, K k, Sort arg, boolean total) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private void checkRule(Rule rule) {
checkNonExecutable(rule);
checkSimplification(rule);
checkSymbolic(rule);
checkSyntactic(rule);
}

private void checkProduction(Production prod) {
Expand Down Expand Up @@ -151,6 +152,14 @@ private void checkSymbolic(Rule rule) {
}
}

private void checkSyntactic(Rule rule) {
if (rule.att().contains(Att.SYNTACTIC()) && !rule.att().contains(Att.SIMPLIFICATION())) {
errors.add(
KEMException.compilerError(
"syntactic attribute is only supported on simplification rules."));
}
}

private void checkHookedSortConstructors(Production prod) {
if (prod.sort().equals(Sorts.KItem())) {
return;
Expand Down
6 changes: 3 additions & 3 deletions k-frontend/src/main/java/org/kframework/kil/UserList.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public class UserList extends ProductionItem {

public UserList(Sort sort, String separator) {
this.sort = sort;
this.separator = separator.trim();
this.separator = separator;
this.listType = ZERO_OR_MORE;
}

public UserList(Sort sort, String separator, String listType) {
this.sort = sort;
this.separator = separator.trim();
this.separator = separator;
this.listType = listType;
}

Expand Down Expand Up @@ -58,7 +58,7 @@ public String getSeparator() {
}

public void setSeparator(String separator) {
this.separator = separator.trim();
this.separator = separator;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,6 @@ public static Tuple3<Module, Module, Module> getCombinedGrammarImpl(
stream(mod.allSorts())
.filter(s -> (!isParserSort(s) || s.equals(Sorts.KItem()) || s.equals(Sorts.K())))
.toList();
for (SortHead sh : mutable(mod.definedInstantiations()).keySet()) {
for (Sort s : mutable(mod.definedInstantiations().apply(sh))) {
// syntax MInt{K} ::= MInt{6}
Production p1 =
Production(
Option.empty(), Seq(), Sort(s.name(), Sorts.K()), Seq(NonTerminal(s)), Att.empty());
prods.add(p1);
}
}
for (Production p : iterable(mod.productions())) {
if (p.params().nonEmpty()) {
if (p.params().contains(p.sort())) { // case 1
Expand Down Expand Up @@ -634,6 +625,17 @@ public static Tuple3<Module, Module, Module> getCombinedGrammarImpl(
}

disambProds = new HashSet<>(parseProds);

for (SortHead sh : mutable(mod.definedInstantiations()).keySet()) {
for (Sort s : mutable(mod.definedInstantiations().apply(sh))) {
// syntax MInt{K} ::= MInt{6}
Production p1 =
Production(
Option.empty(), Seq(), Sort(s.name(), Sorts.K()), Seq(NonTerminal(s)), Att.empty());
parseProds.add(p1);
}
}

if (mod.importedModuleNames().contains(PROGRAM_LISTS)) {
Set<Sentence> prods3 = new HashSet<>();
// if no start symbol has been defined in the configuration, then use K
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public Either<Set<KEMException>, Term> apply(Term term) {
return typeError(pr, expectedSort, inferred);
}
// well typed, so add a cast and return
return wrapTermWithCast((Constant) pr, inferred);
return wrapTermWithCast(pr, inferred);
}
// compute the instantiated production with its sort parameters
Production substituted = pr.production().substitute(inferencer.getArgs(pr));
Expand Down Expand Up @@ -275,12 +275,26 @@ public Either<Set<KEMException>, Term> apply(Term term) {
j++;
}
}
if (pr.production().params().nonEmpty() && hasParametricSort(pr.production())) {
return wrapTermWithCast(tc, substituted.sort());
}
return Right.apply(tc);
}
return Right.apply(pr);
}

private Either<Set<KEMException>, Term> wrapTermWithCast(Constant c, Sort declared) {
private boolean hasParametricSort(Production prod) {
if (prod.sort().head().params() != 0) {
return true;
}
if (stream(prod.nonterminals()).anyMatch(nt -> nt.sort().head().params() != 0)) {
return true;
}
return false;
}

private Either<Set<KEMException>, Term> wrapTermWithCast(
ProductionReference pr, Sort declared) {
if (castContext != CastContext.SEMANTIC) {
// There isn't an existing :Sort, so add one
Production cast =
Expand All @@ -289,9 +303,10 @@ private Either<Set<KEMException>, Term> wrapTermWithCast(Constant c, Sort declar
.productionsFor()
.apply(KLabel("#SemanticCastTo" + declared.toString()))
.head();
return Right.apply(TermCons.apply(ConsPStack.singleton(c), cast, c.location(), c.source()));
return Right.apply(
TermCons.apply(ConsPStack.singleton(pr), cast, pr.location(), pr.source()));
}
return Right.apply(c);
return Right.apply(pr);
}
}
}
2 changes: 2 additions & 0 deletions k-frontend/src/main/scala/org/kframework/attributes/Att.scala
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ object Att {
onlyon3[Module, Production, Rule],
KeyRange.WholePipeline
)
final val SYNTACTIC =
Key.builtin("syntactic", KeyParameter.Required, onlyon[Rule], KeyRange.WholePipeline)
final val TOKEN = Key.builtin(
"token",
KeyParameter.Forbidden,
Expand Down
2 changes: 1 addition & 1 deletion llvm-backend/src/main/native/llvm-backend
Submodule llvm-backend updated 116 files
2 changes: 1 addition & 1 deletion package/debian/kframework/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kframework (7.1.0) unstable; urgency=medium
kframework (7.1.117) unstable; urgency=medium

* Initial Release.

Expand Down
2 changes: 1 addition & 1 deletion package/debian/kframework/control.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: kframework
Section: devel
Priority: optional
Maintainer: Dwight Guth <dwight.guth@runtimeverification.com>
Build-Depends: clang-15 , cmake , debhelper (>=10) , flex , libboost-test-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libsecp256k1-dev , libunwind-dev , libyaml-dev , maven , openjdk-17-jdk , pkg-config , python3 , python3-dev , python3-distutils , python3-pip , zlib1g-dev
Build-Depends: clang-15 , cmake , debhelper (>=10) , flex , libboost-test-dev , libfmt-dev , libgmp-dev , libjemalloc-dev , libmpfr-dev , libsecp256k1-dev , libunwind-dev , libyaml-dev , maven , openjdk-17-jdk , pkg-config , python3 , python3-dev , python3-distutils , python3-pip , xxd , zlib1g-dev
Standards-Version: 3.9.6
Homepage: https://github.com/runtimeverification/k

Expand Down
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.0
7.1.117
3 changes: 3 additions & 0 deletions pyk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ __pycache__/

.kprove*
*.debug-log

.idea/
.DS_Store
4 changes: 2 additions & 2 deletions pyk/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
project = 'pyk'
author = 'Runtime Verification, Inc'
copyright = '2024, Runtime Verification, Inc'
version = '7.1.0'
release = '7.1.0'
version = '7.1.117'
release = '7.1.117'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion pyk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kframework"
version = "7.1.0"
version = "7.1.117"
description = ""
authors = [
"Runtime Verification, Inc. <contact@runtimeverification.com>",
Expand Down
2 changes: 1 addition & 1 deletion pyk/src/pyk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
from typing import Final


__version__: Final = '7.1.0'
__version__: Final = '7.1.117'
2 changes: 2 additions & 0 deletions pyk/src/pyk/cli/pyk.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ class ProveOptions(LoggingOptions, SpecOptions, SaveDirOptions):
kore_rpc_command: str | Iterable[str] | None
max_depth: int | None
max_iterations: int | None
assume_defined: bool
show_kcfg: bool

@staticmethod
Expand All @@ -331,6 +332,7 @@ def default() -> dict[str, Any]:
'kore_rpc_command': None,
'max_depth': None,
'max_iterations': None,
'assume_defined': False,
'show_kcfg': False,
}

Expand Down
Loading

0 comments on commit 0e44447

Please sign in to comment.