Git Product home page Git Product logo

isabella232 / haskell-backend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from runtimeverification/haskell-backend

0.0 0.0 0.0 77.61 MB

The symbolic execution engine powering the K Framework

License: BSD 3-Clause "New" or "Revised" License

Haskell 95.65% Makefile 0.39% Shell 0.42% Python 0.64% Dockerfile 0.04% Nix 2.11% Roff 0.05% SMT 0.01% JavaScript 0.02% HTML 0.07% Lex 0.24% Yacc 0.38%

haskell-backend's Introduction

The Kore Language

Kore is the "core" part of the K framework.

What is Kore all about?

In short, we need a formal semantics of K. In K, users can define formal syntax and semantics of programming languages as K definitions, and automatically obtain parsers, interpreters, compilers, and various verification tools for their languages. Therefore K is a language-independent framework.

Thanks to years of research in matching logic and reachability logic, we know that all K does can be nicely formalized as logic reasoning in matching logic. To give K a formal semantics, we only need to formally specify the underlying matching logic theories with which K does reasoning. In practice, these underlying theories are complex and often infinite, and it is tricky to specify infinite theories without a carefully designed formal specification language. And Kore is such a language.

Structure of this project

The docs directory contains a collection of documents that describe the mathematical foundation of Kore and a BNF grammar that defines the syntax of Kore language. See /docs/introduction.md for an overview of the components of Kore.

The kore project is an implementation in Haskell of a Kore parser and symbolic execution engine, for use with the K Framework as a backend.

Building

Besides git, you will need stack or cabal to build kore.

stack build kore
# or
cabal build kore

If using cabal, version 3.0 or later is recommended.

Using make:

make all # builds all binaries

macOS

Currently, LLVM 13 from Homebrew installs an incompatible version of install_name_tool, which breaks the Haskell backend build on macOS. To resolve this, uninstall llvm and install llvm@12 from Homebrew, then build from scratch.

Apple Silicon

If you are building the project on an Apple Silicon machine, a temporary workaround is necessary to install a new enough version of GHC with support for ARM64 Darwin. To do so, follow the instructions in this comment. The command-line flags for stack should then be specified everywhere an execution of stack is required. For make invocations in this project, set the environment variable STACK_BUILD_OPTS=--compiler ghc-8.10.7 --system-ghc.

When stack and ghc merge their full support for ARM64 Darwin in future releases, it should be possible to remove this workaround.

Developing

Developers will require all the dependencies listed above, in addition to the requirements and recommendations below.

Required dependencies

For integration testing, we require:

Instead of installing the frontend, you can use our Dockerfile to run the integration tests inside a container. Use docker.sh to run commands inside the container:

./docker/build.sh  # run once when dependencies change
./docker/run.sh make all  # build the backend
./docker/run.sh make test  # run all tests
./docker/run.sh make -C test/imp test  # run all tests in test/imp

Recommended dependencies

For setting up a development environment, we recommend:

  • direnv to make the project's tools available in shells and editors.
  • haskell-language-server, a language server for Haskell that is compatible with most editors. See instructions below to run a language server.
  • hlint for compliance with project guidelines.
  • entr and fd for running ./entr.sh to keep important files up-to-date.

We recommend to keep ./entr.sh running in the background to keep important files (such as package descriptions) up-to-date, especially if the developer is using Cabal.

Running a language server

To run a language server, developers will need to activate the appropriate hie.yaml file:

ln -s hie-stack.yaml hie.yaml  # for Stack
# or
ln -s hie-cabal.yaml hie.yaml  # for Cabal
# or
ln -s hie-bios.yaml hie.yaml  # if all else fails

The project's dependencies must be installed before starting the language server:

stack build --test --bench --only-dependencies
# or
cabal build --enable-tests --enable-benchmarks --only-dependencies kore

Developing with Nix

We provide a shell.nix expression with a suitable development environment and a binary cache at runtimeverification.cachix.org. The development environment is intended to be used with nix-shell and cabal.

When the .cabal package description file changes, run:

# Requires Nix to be installed.
./nix/rematerialize.sh

This script is also run by an automatic workflow.

We provide a test.nix for running integration tests:

nix-build test.nix  # run all integration tests
nix-build test.nix --argstr test imp  # run the integration tests in test/imp
nix-shell test.nix  # enter a shell where we can run tests manually

haskell-backend's People

Contributors

15joeybloom avatar ana-pantilie avatar andreiburdusa avatar baidi96 avatar baltoli avatar bmmoore avatar cos avatar daejunpark avatar dfilaretti avatar dopamane avatar dwightguth avatar ehildenb avatar emarzion avatar eviefp avatar grosu avatar jktkops avatar marick avatar mcalancea avatar mirceas avatar msaxena2 avatar nishantjr avatar phillipharr1s avatar radumereuta avatar raoulschaffranek avatar rv-jenkins avatar tomtomjhj avatar traiansf avatar ttuegel avatar virgil-serbanuta avatar yzhang90 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.