KPlutus - K Semantics of Plutus-Core
Dependencies
- Install needed K dependencies: https://github.com/kframework/k
- Update submodules:
git submodule update --init --recursive
- Make dependencies:
make deps RELEASE=true
Building
- Build everything:
make build -j8
- Build LLVM backend:
make build-llvm -j8
- Build Haskell backend:
make build-haskell -j8
- Build just KPlutus runner and includes:
make build-kplutus -j8
A note about Crypto++
Due to a bug in the ubuntu bionic and focal packages for crypto++ that affects us here, we build a static library for it from source.
If you're certain that you have a crypto++ package installed that doesn't have this bug, you can run the make commands with NOBUILD_CRYPTOPP=true
Testing
-
Conformance tests:
make conformance-test
Runs all tests where an input program is executed by thekplc run
command. The output is compared against the reference implementation as well as a previous run ofkplc run
-
Simple hand-written tests:
make test-simple
These contain small tests that have been written during the development of the semantics. -
Examples generated by the uplc program:
make test-uplc-examples
The uplc program contains several small examples. These are slightly larger programs than files in simple tests. The uplc program is a part of the plutus repository https://github.com/input-output-hk/plutus -
Examples benchmark examples:
test-benchmark-validation-examples
This contains many examples derived from the plutus-apps directory. These represent are more realistic plutus programs. The tests from this directory were extracted from https://github.com/input-output-hk/plutus/tree/master/plutus-benchmark/validation/data -
Examples generated by the nofib-exe program: test-nofib-exe-examples nofib-exe is a program that generates large programs that can serve as performance tests. This program is a part of the plutus repository.
-
Update test results:
make update-results
Update all test results. Note: this requires having the uplc program installed in the machine's PATH.