Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rybla/lh-tactics-test
https://github.com/rybla/lh-tactics-test
Last synced: about 7 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/rybla/lh-tactics-test
- Owner: rybla
- License: bsd-3-clause
- Created: 2022-05-04T18:31:39.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-26T13:23:02.000Z (about 2 years ago)
- Last Synced: 2024-04-24T03:14:10.679Z (7 months ago)
- Language: TeX
- Size: 9.5 MB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# lh-tactics-test
Replication package for Haskell'22 paper "Liquid Proof Macros".
## Documentation
For now, please see our paper _[Liquid Proof Macros][liquid-proof-macros]_ and
the examples in `props-done/` for details on how to use `lh-tactics`.## Installation
To clonse `lh-tactics-test` and install `lh-tactics`:
```sh
# clone the `lh-tatics-test` repository,
# which includes `lh-tactics as a submodule
git clone https://github.com/Riib11/lh-tactics-test.git
cd lh-tactics-test/
git submodule update --init# build and install `lh-tactics` library and executable
cd lh-tactics/
sh build-install
```## Running one of our tests
The following example shows how to run the `lh-tactics` tool on one of the
examples included in the set of examples used in the evaluation mentioned in
_[Liquid Proof Macros][liquid-proof-macros]_ Inside `lh-tactics-test/`, run the
following commands:```sh
# copy the file that contains the example into `src/TIP/`
cp props-done/Prop1.hs src/TIP/# run the `lh-tactics` tool on `Prop1`
stack clean
lh-tactics src/TIP/Prop1.hs:prop1_proof
```
This will output some debugging and logging information, and modify the file
`src/TIP/Prop1.hs` in place. Give it a few seconds to complete (it will give you
feedback as it runs). You can have the file open in a modern text editor such as
VSCode in order to watch the proof term being generated.**IMPORTANT**: Building `lh-tactics-test` straightforwardly with `stack build`
will not run `liquid-haskell` (you can see it is commented out in
`package.yaml`) because of some complications in how `lh-tactics` works. To
actually run liquid haskell while building, you must use```sh
stack build --ghc-options="-fplugin=LiquidHaskell"
```To run other examples, `cp` the right file from `props-done/` into `src/TIP/`.
## Running your own test
Make a new `stack` package, let's call it `test-package`.
```sh
stack new test-package
cd test-package/
```
Include the following in the package's dependencies:
```
dependencies:
- liquidhaskell == 0.8.10.7
- liquid-base == 4.15.0.0
- template-haskell == 2.17.0.0
- lh-tactics
```
Say you want to use `lh-tactics` in a module `Test`. Then the file `Test.hs`
should have the following structure, where `proof` is a definition that uses
proof macros:
```hs
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}{-@ LIQUID "--reflection" @-}
{-@ LIQUID "--ple-local" @-}module Test where
import Language.Haskell.TH.Syntax
import Proof
import Tactic.Core.Quote--- ...
{-@ automatic-instances proof @-}
{-@
proof :: ... -- refined type signature
-@}
[tactic|
proof :: ... -- type signature
proof = ... -- tactics
|]
```Then run `lh-tactics` like so in `test-package/`
```sh
stack clean
lh-tactics src/Test.hs:proof
```
This will give you some feedback, including syntax errors and the like. Then
finally, to verify your proof, run the following:
```sh
stack build --ghc-options="-fplugin=LiquidHaskell"
```
If `lh-tactics` succeeded, it should have commented out your original proof
macro usage and put a generated proof term directly underneath it.## Data
The evaluation in _[Liquid Proof Macros][liquid-proof-macros]_ was based on the
data available in `data/`. In particular:
- `data/easy-inductives.md` shows which properties (from `props-done`) were
successfully proven, and which of those only required "easy" proofs (via proof
macros)
- `data/line-diffs.md` shows the differences in line counts between each
property's file before/after running `lh-tactics`, and additional line
count diffs for before/after running the liquid proof macros pruning procedure## Resources
- _[Liquid Proof Macros][liquid-proof-macros]_
[liquid-proof-macros]: https://www.conference-publishing.com/download.php?Event=ICFPWS22HASKELLMAIN&Paper=e31f37ddb4671b0283a52fa225590e&Version=final