Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
12e7e3e
add CFG to procedure body, no error handling, tests pass
May 5, 2026
cbeee72
eliminate toStmts and use pattern matching/error handling
May 5, 2026
723b1ae
add parser support for user-facing syntax with examples and tests
May 6, 2026
602741c
Add TODO comments for two-stage GOTO pipeline refactor
May 6, 2026
dbb6f91
add DetCFG abbrev, add obligation extraction and call extraction for …
May 6, 2026
39123b0
refactor ObligationExtraction
May 6, 2026
814530e
Address PR review: getCfg, CBMC error, CFG eval, grammar comment
May 6, 2026
051f976
integrate semantics for Call statements which could invoke procedures…
May 6, 2026
48a2a32
CST support for unstructured programs
May 6, 2026
5d3aba6
add explicit comments on funcDecl extraction for unstructured program
May 6, 2026
1b8a0e5
add ANF comment
May 6, 2026
6c7a61a
alphaEquiv for CFG
May 6, 2026
4ccddf4
no-op when inlining unstructured procedures
May 6, 2026
b295843
add more support for CFG handling
May 6, 2026
d184ea0
simplify StatementEval
May 6, 2026
70cda23
indent
May 6, 2026
10cb1eb
Address PR review: remove .stmts, refine Body interface, cleanup
May 6, 2026
58695e5
Regenerate editor syntax files for new CFG keywords (goto, cfg)
May 7, 2026
39acfc8
StatementEval returns error on nonexisting label
May 7, 2026
15cfcf0
Refine unstructured procedure cases, add comments
May 7, 2026
9d1de97
define variable infrastructures
May 7, 2026
7e20805
refactor
May 7, 2026
03c940e
Precond Elim for CFGs
May 7, 2026
eba79e4
add error branch for renameAllLocalNames in ProcedureInlining
May 7, 2026
c993332
intermediate proof fix
May 7, 2026
e6d71f7
fix proof
May 7, 2026
e5c4793
comment
May 7, 2026
3bfd467
fix WFProcedure
May 7, 2026
6d937fc
restore comments
May 7, 2026
9eb49ab
run out of fuel warning
May 7, 2026
402e43d
better comments on WF
May 7, 2026
18b41d8
error on goto with 2+ targets
May 7, 2026
d694805
refine type checker for CFG
May 7, 2026
21a86aa
simplify
May 7, 2026
09973f6
refine comments
May 7, 2026
4305a67
fix: propagate error in runCFG fallthrough and clarify ObligationExtr…
May 11, 2026
035fa8b
test: add end-to-end CFG verification and body preservation tests
May 11, 2026
74a0977
fix: wrap Procedure.body assignment in TerminationCheck.lean for Body…
May 11, 2026
8f0939d
fix: split postconditionsValid into structured/CFG fields and add Cor…
May 12, 2026
8e944c7
refactor: enrich CoreBodyExec with terminal eval and unify postcondit…
May 12, 2026
7e5884f
Merge branch 'main' into htd/unstructured-procedure
PROgram52bc May 12, 2026
cf067e8
implement type checking for CFG
May 12, 2026
39afe3e
Implement symbolic executor for CFG
May 12, 2026
c1299b8
abstract collectCmds
May 12, 2026
b9334dc
add more documentation/better abstraction
May 12, 2026
4d29cde
add metadata to unstructured programs
May 8, 2026
6f2aca0
feat: preserve loop contracts in CFG transfer metadata
May 12, 2026
6d2582c
fix: split transfer_goto grammar to enforce 1 or 2 targets at parse time
May 12, 2026
11f11eb
fix: increment var_def counter when generating nondet goto fvar
May 12, 2026
7f0d3b9
Fix binding bug in CFG Parser
May 12, 2026
12b0295
fix comments
May 12, 2026
b0640fd
refactor: use Procedure.Body.getStructured instead of raw match
May 12, 2026
b9bb6bb
simplify CFG Eval
May 13, 2026
63181c9
feat: add CFG-based Core-to-GOTO pipeline alongside direct path
May 13, 2026
891d1c4
fix comments
May 14, 2026
86e4600
Elimiate unnecessary constructor
May 14, 2026
0fcdc25
Add PR template warning about repository split (#1166)
atomb May 14, 2026
4759712
Htd/unstructured procedure experiment (#1169)
PROgram52bc May 15, 2026
99b84e5
lake: build Strata lib as a test-driver dependency (#1138)
tautschnig May 15, 2026
8acaa4b
The small-step semantics of Imperative must have scoped var init, rem…
aqjune-aws May 15, 2026
a5d36ed
Support SMT string literals and common string ops in translateTerm (#…
tautschnig May 15, 2026
50b0e12
feat: introduce Provenance type and migrate metadata from FileRange (…
MikaelMayer May 15, 2026
e529f8b
Merge branch 'main' into htd/unstructured-procedure
May 15, 2026
1d47569
Fix bug: ADT constructors do not change `Map` to `Array` when using u…
thanhnguyen-aws May 18, 2026
75e806e
Core.formatProgram to produce round-trip-parseable output for all con…
MikaelMayer May 18, 2026
0b4c836
Merge branch 'main' into htd/unstructured-procedure
May 18, 2026
6b3c065
bump maxRecDepth
May 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
**Warning:** This repository will shortly undergo a split into several separate repositories. If you're creating a PR that crosses the boundaries between these repositories, you may want to hold off until the split is complete or be prepared to rework your PR into multiple PRs once the split is complete.

The code that will be moved includes:
- Strata/DDM/*
- Strata/Languages/Boole/*
- Strata/Languages/Python/* along with Tools/Python/*
- Tools/BoogieToStrata
23 changes: 23 additions & 0 deletions Examples/CFGNondet.core.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
program Core;

// Nondeterministic CFG: y is set to either 1 or 2.
procedure NondetChoice(out y : int)
spec {
ensures (y == 1 || y == 2);
}
cfg entry {
entry: {
goto left, right;
}
left: {
y := 1;
goto done;
}
right: {
y := 2;
goto done;
}
done: {
return;
}
};
48 changes: 48 additions & 0 deletions Examples/CFGSimple.core.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
program Core;

// A simple deterministic CFG: compute max of two integers.
procedure Max(x : int, y : int, out m : int)
spec {
ensures (m >= x);
ensures (m >= y);
ensures (m == x || m == y);
}
cfg entry {
entry: {
branch (x >= y) goto then_branch else else_branch;
}
then_branch: {
m := x;
goto done;
}
else_branch: {
m := y;
goto done;
}
done: {
return;
}
};

// A CFG with a simple loop: increment y until it reaches n.
procedure CountUp(n : int, out y : int)
spec {
requires (n >= 0);
ensures (y == n);
}
cfg entry {
entry: {
y := 0;
goto loop;
}
loop: {
branch (y < n) goto body else done;
}
body: {
y := y + 1;
goto loop;
}
done: {
return;
}
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
program Core;

function f (x : int) : int;
axiom [f_positive]: forall __q0 : int :: f(__q0) > 0;
axiom [f_monotone]: forall __q0 : int :: forall __q1 : int :: __q0 < __q1 ==> f(__q0) < f(__q1);
axiom [f_positive]: forall x : int :: f(x) > 0;
axiom [f_monotone]: forall x : int :: forall y : int :: x < y ==> f(x) < f(y);
function g (x : int) : int;
function h (x : int) : int;
axiom [h_def]: forall __q0 : int :: h(__q0) == f(__q0) + 1;
axiom [h_def]: forall x : int :: h(x) == f(x) + 1;
procedure TestF (x : int, out result : int)
spec {
ensures [result_positive]: result > 0;
Expand Down
3 changes: 2 additions & 1 deletion Strata/Backends/CBMC/CoreToCBMC.lean
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,8 @@ def createImplementationSymbolFromAST (func : Core.Procedure) : Except String CB

-- For now, keep the hardcoded implementation but use function name from AST
let loc : SourceLoc := { functionName := (func.header.name.toPretty), lineNum := "1" }
let stmtJsons ← (func.body.mapM (stmtToJson (I:=CoreLParams) · loc))
let bodyStmts ← func.body.getStructured
let stmtJsons ← (bodyStmts.mapM (stmtToJson (I:=CoreLParams) · loc))

let implValue := Json.mkObj [
("id", "code"),
Expand Down
1 change: 1 addition & 0 deletions Strata/Backends/CBMC/GOTO.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-/
module

import Strata.Backends.CBMC.GOTO.CoreCFGToGOTOPipeline
import Strata.Backends.CBMC.GOTO.CoreToCProverGOTO
import Strata.Backends.CBMC.GOTO.CoreToGOTOPipeline
import Strata.Backends.CBMC.GOTO.DefaultSymbols
Expand Down
Loading
Loading