example: Calling aesop (partial)

This commit is contained in:
Leni Aniva 2024-05-17 20:45:29 -07:00
parent 82eb649a51
commit fceb0c1a20
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
7 changed files with 67 additions and 0 deletions

3
examples/Example/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/build
/lakefile.olean
/lake-packages/*

View File

@ -0,0 +1 @@
import Aesop

View File

@ -0,0 +1,23 @@
{"version": 7,
"packagesDir": ".lake/packages",
"packages":
[{"url": "https://github.com/leanprover/std4",
"type": "git",
"subDir": null,
"rev": "3025cb124492b423070f20cf0a70636f757d117f",
"name": "std",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop.git",
"type": "git",
"subDir": null,
"rev": "0a21a48c286c4a4703c0be6ad2045f601f31b1d0",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.8.0-rc1",
"inherited": false,
"configFile": "lakefile.lean"}],
"name": "Example",
"lakeDir": ".lake"}

View File

@ -0,0 +1,11 @@
import Lake
open Lake DSL
require aesop from git
"https://github.com/leanprover-community/aesop.git" @ "v4.8.0-rc1"
package «Example» where
-- add package configuration options here
lean_lib «Example» where
-- add library configuration options here

View File

@ -0,0 +1 @@
leanprover/lean4:v4.8.0-rc1

14
examples/README.md Normal file
View File

@ -0,0 +1,14 @@
# Usage Example
This example showcases how to bind library dependencies and execute the `Aesop`
tactic in Lean. First build the example project:
``` sh
pushd Example
lake build
popd
```
This would generate compiled `.olean` files. Then run the example
``` sh
python3 aesop.py
```

14
examples/aesop.py Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env python3
import subprocess
from pathlib import Path
from pantograph.server import Server
def get_lean_path():
cwd = Path(__file__).parent.resolve() / 'Example'
p = subprocess.check_output(['lake', 'env', 'printenv', 'LEAN_PATH'], cwd=cwd)
return p
if __name__ == '__main__':
lean_path = get_lean_path()
print(lean_path)