Skip to content

Commit 694b3a9

Browse files
committed
Work in progress on property-based tests
1 parent e6b39b8 commit 694b3a9

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

analysis/markov/lake-manifest.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
"inputRev": "26d5ce4d60195a869b1fdb100b442794ea63e1ad",
2222
"inherited": false,
2323
"configFile": "lakefile.toml"},
24+
{"url": "https://github.com/argumentcomputer/LSpec.git",
25+
"type": "git",
26+
"subDir": null,
27+
"scope": "",
28+
"rev": "d2bbbfa61a82ac199a5e852aa375acffd9a3b3f1",
29+
"name": "LSpec",
30+
"manifestFile": "lake-manifest.json",
31+
"inputRev": null,
32+
"inherited": false,
33+
"configFile": "lakefile.toml"},
2434
{"url": "https://github.com/leanprover-community/mathlib4",
2535
"type": "git",
2636
"subDir": null,

analysis/markov/lakefile.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
21
import Lake
32

43
open Lake DSL
54

65
package «linleios» where
76
version := StdVer.mk (SemVerCore.mk 0 1 0) ""
7+
testDriver := "linleios_test"
88
leanOptions := #[
99
-- pretty-prints `fun a ↦ b`
1010
`pp.unicode.fun, true⟩,
@@ -24,9 +24,16 @@ lean_exe «linleios» where
2424
srcDir := "src"
2525
supportInterpreter := false
2626

27+
lean_exe «linleios_test» where
28+
root := `LinleiosTest
29+
srcDir := "src"
30+
2731
require mathlib from git
2832
"https://github.com/leanprover-community/mathlib4" @ "v4.20.0"
2933

34+
require LSpec from git
35+
"https://github.com/argumentcomputer/LSpec.git"
36+
3037
require Parser from git
3138
"https://github.com/fgdorais/lean4-parser" @ "26d5ce4d60195a869b1fdb100b442794ea63e1ad"
3239

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Linleios
2+
import Std.Data.HashMap
3+
4+
open Std.HashMap (singleton_eq_insert)
5+
6+
7+
/--
8+
The genesis state starts with zero counts.
9+
-/
10+
theorem genesis : (default : State).clock = 0 ∧ (default : State).rbCount = 0 ∧ (default : State).ebCount = 0 := by
11+
constructor
12+
rfl
13+
constructor
14+
rfl
15+
rfl
16+
17+
/-
18+
The initial probability is unity.
19+
-/
20+
#guard totalProbability (default : Probabilities) == 1
21+
22+
23+
def main : IO Unit :=
24+
pure ()

0 commit comments

Comments
 (0)