Skip to content

Commit eed18ef

Browse files
committed
Add example program and define TransferOperator in PWhile.lean
1 parent ac86eee commit eed18ef

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

ProgramAnalysis/ProbabilisticPrograms/PWhile.lean

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,24 @@ public def Stmt.vars : Stmt → List Var
434434
public structure Prog where
435435
stmt : Stmt
436436
domains : List (Var × Finset Int)
437-
allVarsHaveDomain : ∀ x ∈ stmt.vars, (domains.lookup x).isSome
437+
allVarsHaveDomain : ∀ x ∈ stmt.vars, (domains.lookup x).isSome := by decide
438438

439439
public def Prog.domain (p : Prog) (x : Var) : Option (Finset Int) :=
440440
p.domains.lookup x
441441

442+
def example2 : Stmt := [pWhile|
443+
x := x + 1
444+
]
445+
446+
def prog2 : Prog where
447+
stmt := example2
448+
domains := [("x", {1, 2, 3, 4, 5, 6, 7, 8})]
449+
450+
451+
inductive TransferOperator (size : Nat) where
452+
| I
453+
| E (l₁ l₂ : Label)
454+
| U (var : Var) (expr : ArithAtom)
442455

443456

444457
end ProgramAnalysis.ProbabilisticPrograms

0 commit comments

Comments
 (0)