Code Monkey home page Code Monkey logo

hoare-hask's Introduction

Tutorial implementation of Hoare logic in Haskell

This is the source code repository for my paper Tutorial implementation of Hoare logic in Haskell. In the src folder you will find:

  • Common.hs, PrettyPrinter.hs - Various utility functions
  • Gentzen.hs - Implementation of Propositional calculus
  • TNT.hs - Implementation of Typographical Number Theory
  • Hoare.hs - Implementation of Hoare logic (on top of Propositional calculus + Number theory)
  • Imp.hs - Implementation of a simple imperative programming language (the commands correspond to the rules of Hoare logic)

The folder paper contains the source code of the paper. The built paper can be downloaded from https://arxiv.org/abs/2101.11320.

See it in action on my mobile phone on this Tweet

Prerequisites

Make sure you have the Haskell Tool Stack installed, or Hugs.

Running the examples

Check the files in the examples folder - each implementation of the system has a corresponding example file.

For instance, to run the proof for the countToB program defined in the paper, execute the following commands:

  • stack repl examples/ExampleHoare.hs --ghci-options -iexamples --ghci-options -isrc
  • Once in the REPL mode, evaluate putStrLn $ pr proof

For hugs, while in the src folder, run hugs -F"cpphs-hugs --noline -D__HUGS__" ../examples/ExampleHoare.hs

Copyright 2021, Boro Sitnikovski. All rights reserved.

hoare-hask's People

Contributors

bor0 avatar

Watchers

 avatar  avatar  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.