https://github.com/totbwf/tactic-haskell
Tactic Metaprogramming in Haskell
https://github.com/totbwf/tactic-haskell
haskell metaprogramming tactics
Last synced: 10 months ago
JSON representation
Tactic Metaprogramming in Haskell
- Host: GitHub
- URL: https://github.com/totbwf/tactic-haskell
- Owner: TOTBWF
- License: bsd-3-clause
- Created: 2018-09-19T23:43:32.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-07T06:12:24.000Z (over 6 years ago)
- Last Synced: 2025-03-28T14:21:42.948Z (10 months ago)
- Topics: haskell, metaprogramming, tactics
- Language: Haskell
- Size: 150 KB
- Stars: 56
- Watchers: 6
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# tactic-haskell
Tactic Metaprogramming as a library! This project aims to bring the proof automation
capabilities of Coq and others to Haskell.
Here's some examples:
```haskell
tactic "pair" [t| forall a b. a -> b -> (a,b)|] $ do
forall
intros_
split
assumption
```
```haskell
tactic "&" [t| forall a b. a -> (a -> b) -> b |] $ do
forall
intro "x"
intro "f"
apply "f"
exact "x"
```
```haskell
tactic "foo" [t| forall a b c. a -> (a -> b) -> (b -> c) -> (a,c)|] $ do
auto 5
```
``` haskell
tactic "either" [t| forall a b c. (a -> c) -> (b -> c) -> Either a b -> c |] $ auto 5
```
``` haskell
tactic "myFold" [t| forall a b. (a -> b -> b) -> b -> [a] -> b |] $ auto 5
```
```haskell
data Nat = Z | S Nat deriving (Show)
tactic "plus" [t| Nat -> Nat -> Nat |] $ do
intros ["n", "m"]
induction "n" <@>
[ exact "m"
, do
apply 'S
exact "ind"
]
```
For more examples, see the `samples/` directory.
## TODOs
- Add support for type classes.
- Allow `auto` to use at top-level bindings/imported functions.
- Tidy up the output of `induction`
- Create a GHCI wrapper that allows usage from the command line/as an editor tool
## Disclaimer
This is very much a work in progress! `tactic-haskell` makes
no promises about anything at this stage. It could work perfectly, or it could decide to burn down your house.
Also, even though `auto` is good at it's job, it isn't perfect, make sure to check the output by
using `debugTactic`.