summaryrefslogtreecommitdiff
path: root/tests/lean/Constants.lean
diff options
context:
space:
mode:
authorSon HO2024-03-18 07:23:00 +0100
committerGitHub2024-03-18 07:23:00 +0100
commita24f42ff7f0ae3c2aeb51decb0d0c90d6e50ffac (patch)
tree7c9e526912d4fcbde4ed2ff4c17988fd5c89c96e /tests/lean/Constants.lean
parentd56946242859e0d375c1d44585b9da6d5fbe94cb (diff)
parent9e230d0c4378b5c992c820cc1f4322896f739095 (diff)
Merge pull request #92 from AeneasVerif/son/globals
Add generics to constants/globals
Diffstat (limited to 'tests/lean/Constants.lean')
-rw-r--r--tests/lean/Constants.lean15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lean/Constants.lean b/tests/lean/Constants.lean
index 7949a25c..40f590d4 100644
--- a/tests/lean/Constants.lean
+++ b/tests/lean/Constants.lean
@@ -149,4 +149,19 @@ def S3 : Pair U32 U32 := eval_global S3_body
def S4_body : Result (Pair U32 U32) := mk_pair1 7#u32 8#u32
def S4 : Pair U32 U32 := eval_global S4_body
+/- [constants::V]
+ Source: 'src/constants.rs', lines 86:0-86:31 -/
+structure V (T : Type) (N : Usize) where
+ x : Array T N
+
+/- [constants::{constants::V<T, N>#1}::LEN]
+ Source: 'src/constants.rs', lines 91:4-91:24 -/
+def V.LEN_body (T : Type) (N : Usize) : Result Usize := Result.ret N
+def V.LEN (T : Type) (N : Usize) : Usize := eval_global (V.LEN_body T N)
+
+/- [constants::use_v]:
+ Source: 'src/constants.rs', lines 94:0-94:42 -/
+def use_v (T : Type) (N : Usize) : Result Usize :=
+ Result.ret (V.LEN T N)
+
end constants