Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
e3a0f67
Improve Lambda typing rules for constants and quantifiers (#187)
joscoh Nov 12, 2025
0c34e82
Python AST to Boogie (#199)
andrewmwells-amazon Nov 13, 2025
7d997e1
Add small-step semantics for statements (#200)
atomb Nov 13, 2025
d2c3ac3
Add CI for Python Analysis (#204)
andrewmwells-amazon Nov 14, 2025
e62cfbd
Add inductive types to Lambda (#167)
joscoh Nov 14, 2025
87669bf
Add primitive tests that compare concrete evaluation and SMT encoding…
aqjune-aws Nov 14, 2025
af0e286
Basic regex patterns to Strata.Boogie encoding (#206)
shigoel Nov 15, 2025
204b051
Cleanup Python dialect; add support byte literal constants. (#209)
joehendrix Nov 15, 2025
f803baa
Expand Lambda's basic functions to support arbitrary types rather tha…
aqjune-aws Nov 17, 2025
2dd0b5e
Add support to ByteArray to #strata_gen (#215)
joehendrix Nov 17, 2025
293160c
Prove termination for `isCanonicalValue` (#214)
joscoh Nov 17, 2025
cb6453d
Decl vars based on AST (#219)
andrewmwells-amazon Nov 18, 2025
8811a4c
A few more expected output files for Boogie tests (#174)
atomb Nov 18, 2025
e86fa03
Add `LContext` and operators to typing rules (#203)
joscoh Nov 18, 2025
cfaf6a6
Feat: Metadata in Lambda.LExpr (#220)
MikaelMayer Nov 21, 2025
f83d2e4
Test CBMC in CI (#222)
andrewmwells-amazon Nov 21, 2025
fbab27c
Handle function declarations in Python -> Boogie (#210)
andrewmwells-amazon Nov 21, 2025
cd1a6bd
Add small-step semantics of Lambda (#223)
aqjune-aws Nov 24, 2025
008a3af
Report proof obligation locations from StrataVerify (#189)
atomb Nov 25, 2025
1ca9c81
Refactor beq proofs to reduce duplication (#233)
joscoh Nov 25, 2025
d07a64d
Fix counting of whitespace only DDM syntax nodes (#230)
joehendrix Nov 25, 2025
f6c77ed
Kiro steering files (#208)
atomb Nov 25, 2025
3dfca7e
Implement procedure inlining, factor out boilerplate code in CallElim…
aqjune-aws Nov 25, 2025
58d4ae0
Add support for standard input (#229)
vjjocius Nov 25, 2025
a47df62
Improve elab-time performance of Lean terms generated by DDM. (#221)
joehendrix Dec 1, 2025
7d87684
Refactor SemanticEval to receive only one SemanticStore (#213)
aqjune-aws Dec 1, 2025
dc17f40
Models for relevant regular expression operations (#218)
shigoel Dec 2, 2025
574e765
Andrewmwells/pyanalyze tests (#249)
andrewmwells-amazon Dec 2, 2025
7b6a572
Add datatypes to `LContext` (#238)
joscoh Dec 3, 2025
6f9330c
Update pyTranslate and pyAnalyze to use compile time Python dialect (…
joehendrix Dec 4, 2025
248c22c
feat: Create generators for well-typed LExprs. (#258)
codyroux Dec 4, 2025
e1c5e2b
Add all executables to default targets (#237)
vjjocius Dec 5, 2025
f9be351
pyanalyze burndown (#252)
andrewmwells-amazon Dec 5, 2025
6a647e4
Change `Imperative.Stmt` to remove `Block` mutual recursion (#216)
joscoh Dec 5, 2025
f3bf3a5
Add Laurel grammar and transformation
keyboardDrummer Dec 9, 2025
4589663
refactoring
keyboardDrummer Dec 9, 2025
037a7d1
Fixes
keyboardDrummer Dec 9, 2025
1c9cfd1
Moved tests
keyboardDrummer Dec 9, 2025
3a3809c
Fix grammar test
keyboardDrummer Dec 9, 2025
927b0bb
Getting there
keyboardDrummer Dec 9, 2025
faa49df
TestExamples test passes
keyboardDrummer Dec 9, 2025
4481959
Refactoring
keyboardDrummer Dec 9, 2025
c600cf1
Fix
keyboardDrummer Dec 9, 2025
9cef91e
Support Datetime (#266)
aqjune-aws Dec 9, 2025
94e1af3
Generalize reflexive transitive closure (#267)
joscoh Dec 9, 2025
25df923
Revert AdvancedMaps changes
keyboardDrummer Dec 10, 2025
3c933e5
Add missing license headers
keyboardDrummer Dec 10, 2025
f182891
Revert RealBitVector
keyboardDrummer Dec 10, 2025
5bc8abd
Tweaks
keyboardDrummer Dec 10, 2025
fe2a831
Save state
keyboardDrummer Dec 10, 2025
2cd178c
Refactoring
keyboardDrummer Dec 10, 2025
12946cf
Refactoring
keyboardDrummer Dec 10, 2025
b12d781
Cleanup
keyboardDrummer Dec 10, 2025
75cc85f
Merge branch 'main' into laurelParsing
keyboardDrummer Dec 10, 2025
84235b4
Fix Laurel/TestGrammar
keyboardDrummer Dec 10, 2025
cffb991
Merge branch 'laurelParsing' of github.com:keyboardDrummer/Strata int…
keyboardDrummer Dec 10, 2025
a3e0856
Fix alpha equivalence for Boogie programs (#265)
joscoh Dec 10, 2025
00d8b83
Minor cleanups - particularly to Python DDM code (#260)
joehendrix Dec 11, 2025
b2ae3dc
Move Boogie examples
keyboardDrummer Dec 11, 2025
ea3438f
Rename
keyboardDrummer Dec 11, 2025
977786d
Add more Laurel examples (#228)
keyboardDrummer Dec 11, 2025
4aa17a2
Update DialectMap to include closure proof (#235)
joehendrix Dec 11, 2025
77aa05a
Merge remote-tracking branch 'origin' into laurelParsing
keyboardDrummer Dec 15, 2025
fbe4de5
Move back Boogie examples
keyboardDrummer Dec 15, 2025
e827d76
Remove white line
keyboardDrummer Dec 15, 2025
ff76419
Moved examples
keyboardDrummer Dec 15, 2025
ce236d8
Delete Examples.lean files since they're obsolete
keyboardDrummer Dec 15, 2025
79fbeb9
Remove duplication
keyboardDrummer Dec 15, 2025
b0832e6
Expand test
keyboardDrummer Dec 15, 2025
2de306c
Do not use type and fn feature from DDM
keyboardDrummer Dec 15, 2025
6e90ace
Fix parser
keyboardDrummer Dec 15, 2025
8ff685d
Update translate file
keyboardDrummer Dec 15, 2025
086f6f8
Added some expected errors
keyboardDrummer Dec 15, 2025
0ea1bbb
Fix test
keyboardDrummer Dec 15, 2025
c397cb5
Attempt at translating to Boogie
keyboardDrummer Dec 15, 2025
126885b
Add sequencing of impure expressions
keyboardDrummer Dec 15, 2025
b547baf
Move towards combining test and source file
keyboardDrummer Dec 15, 2025
3160a8c
Bump lean-toolchain to v4.25.2 (#273)
joehendrix Dec 15, 2025
83c28d6
Improve translator to Boogie
keyboardDrummer Dec 16, 2025
a496a14
Merge remote-tracking branch 'origin/main' into laurelParsing
keyboardDrummer Dec 16, 2025
4ac44c9
Merge branch 'main' into moveExamples
keyboardDrummer Dec 16, 2025
c2164e2
Merge branch 'laurelParsing' into laurelMoreStmtExpr
keyboardDrummer Dec 16, 2025
245f7ad
Fix after merge
keyboardDrummer Dec 16, 2025
4683301
Merge branch 'laurelParsing' into laurelMoreStmtExpr
keyboardDrummer Dec 16, 2025
69e05e4
Update test
keyboardDrummer Dec 16, 2025
95bb904
Fix
keyboardDrummer Dec 16, 2025
1d19b86
Fix oops
keyboardDrummer Dec 16, 2025
0ebc51d
Merge branch 'laurelParsing' into laurelMoreStmtExpr
keyboardDrummer Dec 16, 2025
c44fad1
Fix warning
keyboardDrummer Dec 16, 2025
d0bada5
Fixes
keyboardDrummer Dec 16, 2025
125bf17
Fix warning
keyboardDrummer Dec 16, 2025
fd1374f
Renames
keyboardDrummer Dec 16, 2025
cd77f34
T2_NestedImpureStatements.lean
keyboardDrummer Dec 16, 2025
de4e4a4
Restructure files
keyboardDrummer Dec 16, 2025
110fc87
Improvements
keyboardDrummer Dec 16, 2025
0104e5a
Updates
keyboardDrummer Dec 16, 2025
a7562b5
Updates to the grammar
keyboardDrummer Dec 16, 2025
d530725
Updates
keyboardDrummer Dec 16, 2025
d37c57a
Add panics
keyboardDrummer Dec 16, 2025
871b27e
Translate all operators
keyboardDrummer Dec 16, 2025
1646019
Add DDM unwrap metadata (#261)
MikaelMayer Dec 16, 2025
8ddbaa3
Merge branch 'main' into moveExamples
aqjune-aws Dec 16, 2025
c27615e
Turn Strata Python bindings into native namespace package (#276)
ssomayyajula Dec 16, 2025
52c0eb0
Support for classes (#270)
andrewmwells-amazon Dec 16, 2025
872a746
Fix pyAnalyze CI (#278)
andrewmwells-amazon Dec 17, 2025
492cd53
Hide counterexamples when verbose flag is false (#271)
vjjocius Dec 17, 2025
30d59b1
Boogie lexpr gen + generator bug fix (#272)
codyroux Dec 17, 2025
5624f00
Progress with T3
keyboardDrummer Dec 17, 2025
02c5cdd
Merge remote-tracking branch 'origin/main' into moveExamples
keyboardDrummer Dec 17, 2025
9efa44a
Undo bad changes
keyboardDrummer Dec 17, 2025
853aa4d
Merge branch 'laurelParsing' into laurelMoreStmtExpr
keyboardDrummer Dec 17, 2025
088816c
Merge branch 'moveExamples' into laurelMoreStmtExpr
keyboardDrummer Dec 17, 2025
f0454dd
T3 passes now
keyboardDrummer Dec 17, 2025
b70f84d
Added failing assertion
keyboardDrummer Dec 17, 2025
e328a48
Move examples from `Strata` to `StrataTest` to reduce build time (#274)
keyboardDrummer Dec 17, 2025
5ce8f20
feat(DDM): Add Bool support to DDM core (#255)
MikaelMayer Dec 17, 2025
6b0c417
Add breaking comment
keyboardDrummer Dec 18, 2025
67f4b31
Test update
keyboardDrummer Dec 18, 2025
333fc61
Test passes now
keyboardDrummer Dec 18, 2025
eae1536
Merge branch 'main' into laurelParsing
keyboardDrummer Dec 18, 2025
7e16741
Merge remote-tracking branch 'origin/main' into laurelParsing
keyboardDrummer Dec 18, 2025
f711bdc
Merge branch 'laurelParsing' of github.com:keyboardDrummer/Strata int…
keyboardDrummer Dec 18, 2025
fbb9a07
Merge branch 'laurelParsing' into laurelMoreStmtExpr
keyboardDrummer Dec 18, 2025
0d964e3
Add missing file
keyboardDrummer Dec 18, 2025
b3c66a3
Fix
keyboardDrummer Dec 18, 2025
f75ed44
Improve testing output and fix some issues
keyboardDrummer Dec 18, 2025
c6c8d5c
Use dbg_trace instead of IO
keyboardDrummer Dec 18, 2025
f878398
Cleanup
keyboardDrummer Dec 18, 2025
f80e775
Rename
keyboardDrummer Dec 18, 2025
b7f4f86
Fix TestGrammar file
keyboardDrummer Dec 18, 2025
78b8c88
Refactoring
keyboardDrummer Dec 18, 2025
f24afe5
Cleanup
keyboardDrummer Dec 18, 2025
3283f93
Improvements to output parameters
keyboardDrummer Dec 18, 2025
b423c9e
Cleanup
keyboardDrummer Dec 18, 2025
d5d3a57
Bump to v4.26.0 (#281)
joehendrix Dec 18, 2025
1e1be4c
Switch Z3 timeout from soft to hard (#284)
andrewmwells-amazon Dec 18, 2025
197dddb
Add more concrete evaluators for bit-vector operations in Boogie (#275)
aqjune-aws Dec 18, 2025
ee0f0f9
PyAnalyze While and FloorDiv (#283)
andrewmwells-amazon Dec 18, 2025
22e10d7
Strata language definition document (#186)
atomb Dec 18, 2025
dca53ec
Z3 -T param takes seconds (#286)
andrewmwells-amazon Dec 18, 2025
4cec349
Rename file
keyboardDrummer Dec 19, 2025
c32a3d5
Move file
keyboardDrummer Dec 19, 2025
44c4082
Merge remote-tracking branch 'origin/main' into laurelParsing
keyboardDrummer Dec 19, 2025
d803b56
Fixes
keyboardDrummer Dec 19, 2025
b0de596
Extend PythonToBoogie to use signatures database (#279)
joehendrix Dec 19, 2025
8733c69
PyAnalyze run multiple Z3 configs in parallel. (#288)
andrewmwells-amazon Dec 22, 2025
5432464
feat(DDM): Add pipe-delimited identifier support (#285)
MikaelMayer Dec 22, 2025
9856651
Fix TestGrammar
keyboardDrummer Dec 23, 2025
f6dfea9
Merge branch 'main' into laurelParsing
keyboardDrummer Dec 23, 2025
91ad85f
Merge branch 'laurelParsing' into laurelMoreStmtExpr
keyboardDrummer Dec 23, 2025
89d9008
Fixes
keyboardDrummer Dec 23, 2025
e26c206
feat(DDM): Support dots in identifiers (#293)
MikaelMayer Dec 23, 2025
f8a9a67
Merge branch 'main' into laurelParsing
shigoel Dec 24, 2025
2305039
Laurel minimal grammar and transformation (#256)
keyboardDrummer Dec 24, 2025
1dde070
Code review from previous PR
keyboardDrummer Dec 24, 2025
721c6c0
Merge remote-tracking branch 'fork/laurelParsing' into laurelMoreStmt…
keyboardDrummer Dec 24, 2025
79203e4
Merge commit '23050398e4a9782' into laurelMoreStmtExpr
keyboardDrummer Dec 24, 2025
d0ea8bf
Small refactoring
keyboardDrummer Dec 24, 2025
7cf21e0
Improve error reporting when calling solver
keyboardDrummer Dec 24, 2025
a3bee06
Start porting DDM to use modules (#287)
joehendrix Dec 30, 2025
b554911
Fixes #295 (#296)
shigoel Dec 31, 2025
0810e7e
Add B3 Language Support as Strata Backend Dialect (#224)
MikaelMayer Dec 31, 2025
bf0b2b9
Merge remote-tracking branch 'origin/main' into laurelMoreStmtExpr
keyboardDrummer Jan 5, 2026
53bab9c
Add missing import
keyboardDrummer Jan 5, 2026
b845049
Remove obsolete TestGrammar file
keyboardDrummer Jan 5, 2026
10cab6f
Fix CallElimCorrect proof (#264)
thanhnguyen-aws Jan 6, 2026
bfc441e
Translate datatypes to SMT via `declare-datatype` (#251)
joscoh Jan 6, 2026
34d88b8
Update codeowners (#303)
joscoh Jan 7, 2026
91058f8
Merge branch 'main' into laurelMoreStmtExpr
keyboardDrummer Jan 8, 2026
1c186a0
Fix errors
keyboardDrummer Jan 8, 2026
4bc6a2b
Remove hack
keyboardDrummer Jan 8, 2026
17bdf58
Fix #304, allow multiple instantiations of polymorphic functions (#305)
joscoh Jan 8, 2026
c711142
Refactoring
keyboardDrummer Jan 9, 2026
202633a
Refactoring
keyboardDrummer Jan 9, 2026
9451e45
Refactoring
keyboardDrummer Jan 9, 2026
2ff9f17
Refactoring
keyboardDrummer Jan 9, 2026
d4efe5b
Merge branch 'main' into laurelMoreStmtExpr
keyboardDrummer Jan 9, 2026
c90a7de
Add termination proofs for formatStmtExpr and translateExpr
Jan 9, 2026
43ba4e4
Percolate source location metadata from Boogie DDM down to Lambda (#309)
shigoel Jan 9, 2026
1f82794
Improve Ion serialization and deserialization performance (#298)
joehendrix Jan 9, 2026
6e469fc
Fix: multiple variables in Strata/B3 quantifiers (#311)
MikaelMayer Jan 9, 2026
4251492
Add a translator from SMT.Term to SMTDDM.Term (#177)
aqjune-aws Jan 9, 2026
f0aa528
Sequence the program using a reversed list for bookkeeping
keyboardDrummer Jan 12, 2026
f282147
Merge branch 'main' into laurelMoreStmtExpr
keyboardDrummer Jan 12, 2026
a84748a
Remove noise
keyboardDrummer Jan 12, 2026
5170e51
Merge branch 'laurelMoreStmtExpr' of github.com:keyboardDrummer/Strat…
keyboardDrummer Jan 12, 2026
bc221e3
Bump documentation to 4.26.0 (#316)
joehendrix Jan 12, 2026
f16e9a0
feat(DDM): Java code generator for dialects (#292)
fabiomadge Jan 12, 2026
b1c1962
Add Lean version consistency checking (#318)
joehendrix Jan 12, 2026
3c67cf7
Merge branch 'main' into laurelMoreStmtExpr
shigoel Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 7 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
/StrataTest/DDM/ @joehendrix @shigoel @aqjune-aws

# Dialects
/Strata/DL/Lambda/ @shigoel @atomb @aqjune-aws
/StrataTest/DL/Lambda/ @shigoel @atomb @aqjune-aws
/Strata/DL/Lambda/ @shigoel @atomb @aqjune-aws @joscoh
/StrataTest/DL/Lambda/ @shigoel @atomb @aqjune-aws @joscoh

/Strata/DL/Imperative/ @atomb @shigoel @aqjune-aws
/StrataTest/DL/Imperative/ @atomb @shigoel @aqjune-aws
/Strata/DL/Imperative/ @atomb @shigoel @aqjune-aws @joscoh
/StrataTest/DL/Imperative/ @atomb @shigoel @aqjune-aws @joscoh

/Strata/DL/SMT/ @andrewmwells-amazon @atomb
/Strata/DL/SMT/ @andrewmwells-amazon @atomb @aqjune-aws

/Strata/DL/Utils/ @shigoel @atomb @aqjune-aws

Expand All @@ -33,6 +33,8 @@

/Strata/Languages/C_Simp/ @andrewmwells-amazon @shigoel

/Strata/Languages/Python/ @andrewmwells-amazon @joehendrix @shigoel

/Strata/Transform/ @atomb @andrewmwells-amazon

# Documentation
Expand Down
11 changes: 11 additions & 0 deletions .github/scripts/check_lean_consistency.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
# This checks that the version of Lean in the main package
# matches the version in the Verso documentation package.
set -e

if cmp --silent "lean-toolchain" "docs/verso/lean-toolchain"; then
exit 0
else
echo "Strata and StrataDoc lean versions do not match."
exit 1
fi
64 changes: 64 additions & 0 deletions .github/workflows/cbmc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: CBMC

on:
workflow_call:

jobs:
cbmc_test:
name: Run CBMC tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install cvc5
shell: bash
run: |
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH_NAME="x86_64"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH_NAME="arm64"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
wget https://github.com/cvc5/cvc5/releases/download/cvc5-1.2.1/cvc5-Linux-${ARCH_NAME}-static.zip
unzip cvc5-Linux-${ARCH_NAME}-static.zip
chmod +x cvc5-Linux-${ARCH_NAME}-static/bin/cvc5
echo "$GITHUB_WORKSPACE/cvc5-Linux-${ARCH_NAME}-static/bin/" >> $GITHUB_PATH
- name: Install z3
shell: bash
run: |
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH_NAME="x86_64"
wget https://github.com/Z3Prover/z3/releases/download/z3-4.15.2/z3-4.15.2-x64-glibc-2.39.zip
ARCHIVE_NAME="z3-4.15.2-x64-glibc-2.39"
elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then
ARCH_NAME="arm64"
wget https://github.com/Z3Prover/z3/releases/download/z3-4.15.2/z3-4.15.2-arm64-glibc-2.34.zip
ARCHIVE_NAME="z3-4.15.2-arm64-win"
else
echo "Unsupported architecture: $ARCH"
exit 1
fi
unzip "${ARCHIVE_NAME}.zip"
chmod +x "${ARCHIVE_NAME}/bin/z3"
echo "$GITHUB_WORKSPACE/${ARCHIVE_NAME}/bin/" >> $GITHUB_PATH
- name: Install CBMC
shell: bash
run: |
wget https://github.com/diffblue/cbmc/releases/download/cbmc-6.4.1/ubuntu-22.04-cbmc-6.4.1-Linux.deb
sudo dpkg -i ubuntu-22.04-cbmc-6.4.1-Linux.deb
- name: Build Strata
uses: leanprover/lean-action@v1
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Run CBMC tests
shell: bash
run: |
export CBMC_DIR="/usr/bin/"
./Strata/Backends/CBMC/run_strata_cbmc.sh Strata/Backends/CBMC/tests/simpleTest.csimp.st
42 changes: 29 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,20 @@ jobs:
run: dotnet test ${SOLUTION}
- name: Test Strata Command line
run: .github/scripts/testStrataCommand.sh
- name: Verify examples
- name: Validate examples against expected output
working-directory: Examples
shell: bash
run: |
find "Examples" -maxdepth 1 -type f -name "*.st" | while IFS= read -r file; do
source ~/.profile && lake exe StrataVerify "$file"
done
run: ./run_examples.sh
- uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Build using pip
run: pip install .
working-directory: Tools/Python
- name: Run pyAnalyze tests
working-directory: StrataTest/Languages/Python
shell: bash
run: ./run_py_analyze.sh

lint_checks:
name: Run lint checks
Expand All @@ -104,33 +112,35 @@ jobs:
run: .github/scripts/lintWhitespace.sh
- name: Check for import Lean
run: .github/scripts/checkLeanImport.sh
- name: Check Lean version consistncy
run: .github/scripts/check_lean_consistency.sh

build_doc:
name: Build Documentation
name: Build documentation
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Build documetation package
- name: Build documentation package
uses: leanprover/lean-action@v1
with:
build-args: '--wfail'
lake-package-directory: 'docs/ddm'
- name: Build Documentation
run: lake exe docs
working-directory: docs/ddm
lake-package-directory: 'docs/verso'
- name: Build documentation
run: ./generate.sh
working-directory: docs/verso

build_python:
name: Build and test Python package
name: Build and test Python
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.14'
- name: Build using pip
run: pip install .
working-directory: Tools/Python
Expand All @@ -143,3 +153,9 @@ jobs:
- name: Run test script
run: ./scripts/run_cpython_tests.sh
working-directory: Tools/Python

cbmc:
needs: build_and_test_lean
permissions:
contents: read
uses: ./.github/workflows/cbmc.yml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
vcs/*.smt2

Strata.code-workspace

StrataTest/Internal
29 changes: 29 additions & 0 deletions .kiro/settings/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"mcpServers": {
"lean-lsp": {
"command": "uvx",
"args": [
"lean-lsp-mcp"
],
"disabled": false,
"autoApprove": [
"lean_build",
"lean_file_contents",
"lean_diagnostic_messages",
"lean_goal",
"lean_term_goal",
"lean_hover_info",
"lean_completions",
"lean_declaration_file",
"lean_multi_attempt",
"lean_run_code",
"loan_local_search",
"lean_leansearch",
"lean_loogle",
"lean_leanfinder",
"lean_state_search",
"lean_hammer_premise"
]
}
}
}
109 changes: 109 additions & 0 deletions .kiro/steering/plausible-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
inclusion: fileMatch
fileMatchPattern: ['**/StrataTest/**/*.lean', '**/Examples/**/*.lean']
---

# Plausible Property-Based Testing

Use Plausible for property-based testing in Strata test files. It finds counter-examples to propositions by generating random test cases.

## When to Use

- Testing transformation correctness properties (e.g., `DetToNondetCorrect.lean`, `CallElimCorrect.lean`)
- Validating semantic equivalences between program representations
- Testing expression evaluation properties (Lambda, Imperative dialects)
- Verifying type system properties
- Quick sanity checks before formal proofs

## Required Type Class Instances

For custom types to work with Plausible, implement these three instances:

1. **`Repr α`** - String representation (use `deriving Repr` when possible)
2. **`Shrinkable α`** - Reduces counter-examples to minimal cases
3. **`Arbitrary α`** - Random value generator

## Implementation Patterns

### Simple Algebraic Types
Use automatic derivation:
```lean
inductive MyType where
| case1 : Nat → MyType
| case2 : Bool → MyType
deriving Repr, Arbitrary
```

### Dependent Types with Invariants
Manually implement instances to maintain invariants:
```lean
structure BoundedNat where
val : Nat
h : val < 100
deriving Repr

instance : Shrinkable BoundedNat where
shrink := fun ⟨n, _⟩ =>
(Shrinkable.shrink n).filterMap fun n' =>
if h : n' < 100 then some ⟨n', h⟩ else none

instance : Arbitrary BoundedNat :=
⟨do
let n ← SampleableExt.interpSample (Fin 100)
return ⟨n.val, n.isLt⟩⟩
```

### Product Types
Shrink components independently:
```lean
instance : Shrinkable (α × β) where
shrink := fun (a, b) =>
(Shrinkable.shrink a).map (·, b) ++
(Shrinkable.shrink b).map (a, ·)
```

### Strata-Specific Types
For Lambda expressions, Imperative statements, or Boogie constructs, ensure generators produce well-typed, valid AST nodes.

## Usage Modes

### Tactic Mode (Preferred)
```lean
example (xs ys : Array Nat) : xs.size = ys.size → xs = ys := by
plausible -- Finds: xs := #[0], ys := #[1]
```

### Programmatic Mode
```lean
#eval Testable.check <| ∀ (x y : Nat), x + y = y + x -- Success
```

### Configuration
```lean
example (a b : Bool) : a = b := by
plausible (config := {quiet := true, numInst := 1000})
```

## Testing Workflow

1. **Write property** as a Lean proposition
2. **Add Plausible instances** for custom types (if needed)
3. **Run test** with `plausible` tactic or `#eval Testable.check`
4. **Interpret results**:
- Counter-example found → property is false
- Success → property likely holds (not a proof)
- Use counter-examples to refine properties or fix bugs

## Common Pitfalls

- **Missing instances**: Ensure `Repr`, `Shrinkable`, and `Arbitrary` are all implemented
- **Invalid generators**: Generators must respect type invariants (use guards or filtered generation)
- **Non-decidable properties**: Plausible requires decidable propositions
- **Over-constrained shrinking**: Shrinking should preserve the counter-example property

## Integration with Strata

- Place property tests in `StrataTest/` mirroring the `Strata/` structure
- Test transformation correctness before attempting formal proofs
- Use Plausible to validate semantic preservation properties
- Generate test cases for edge cases in dialect implementations
Loading
Loading