summaryrefslogtreecommitdiff
path: root/tests/lean/External
diff options
context:
space:
mode:
authorSon HO2023-11-22 15:06:43 +0100
committerGitHub2023-11-22 15:06:43 +0100
commitbacf3f5f6f5f6a9aa650d5ae8d12a132fd747039 (patch)
tree9953d7af1fe406cdc750030a43a5e4d6245cd763 /tests/lean/External
parent587f1ebc0178acb19029d3fc9a729c197082aba7 (diff)
parent01cfd899119174ef7c5941c99dd251711f4ee701 (diff)
Merge pull request #45 from AeneasVerif/son_merge_types
Big cleanup
Diffstat (limited to 'tests/lean/External')
-rw-r--r--tests/lean/External/Funs.lean27
-rw-r--r--tests/lean/External/FunsExternal_Template.lean15
-rw-r--r--tests/lean/External/Types.lean3
3 files changed, 30 insertions, 15 deletions
diff --git a/tests/lean/External/Funs.lean b/tests/lean/External/Funs.lean
index 55fb07be..e5655c7e 100644
--- a/tests/lean/External/Funs.lean
+++ b/tests/lean/External/Funs.lean
@@ -7,7 +7,8 @@ open Primitives
namespace external
-/- [external::swap]: forward function -/
+/- [external::swap]: forward function
+ Source: 'src/external.rs', lines 6:0-6:46 -/
def swap (T : Type) (x : T) (y : T) (st : State) : Result (State × Unit) :=
do
let (st0, _) ← core.mem.swap T x y st
@@ -15,7 +16,8 @@ def swap (T : Type) (x : T) (y : T) (st : State) : Result (State × Unit) :=
let (st2, _) ← core.mem.swap_back1 T x y st st1
Result.ret (st2, ())
-/- [external::swap]: backward function 0 -/
+/- [external::swap]: backward function 0
+ Source: 'src/external.rs', lines 6:0-6:46 -/
def swap_back
(T : Type) (x : T) (y : T) (st : State) (st0 : State) :
Result (State × (T × T))
@@ -26,14 +28,16 @@ def swap_back
let (_, y0) ← core.mem.swap_back1 T x y st st2
Result.ret (st0, (x0, y0))
-/- [external::test_new_non_zero_u32]: forward function -/
+/- [external::test_new_non_zero_u32]: forward function
+ Source: 'src/external.rs', lines 11:0-11:60 -/
def test_new_non_zero_u32
(x : U32) (st : State) : Result (State × core.num.nonzero.NonZeroU32) :=
do
let (st0, o) ← core.num.nonzero.NonZeroU32.new x st
core.option.Option.unwrap core.num.nonzero.NonZeroU32 o st0
-/- [external::test_vec]: forward function -/
+/- [external::test_vec]: forward function
+ Source: 'src/external.rs', lines 17:0-17:17 -/
def test_vec : Result Unit :=
do
let v := alloc.vec.Vec.new U32
@@ -43,7 +47,8 @@ def test_vec : Result Unit :=
/- Unit test for [external::test_vec] -/
#assert (test_vec == .ret ())
-/- [external::custom_swap]: forward function -/
+/- [external::custom_swap]: forward function
+ Source: 'src/external.rs', lines 24:0-24:66 -/
def custom_swap
(T : Type) (x : T) (y : T) (st : State) : Result (State × T) :=
do
@@ -52,7 +57,8 @@ def custom_swap
let (st2, _) ← core.mem.swap_back1 T x y st st1
Result.ret (st2, x0)
-/- [external::custom_swap]: backward function 0 -/
+/- [external::custom_swap]: backward function 0
+ Source: 'src/external.rs', lines 24:0-24:66 -/
def custom_swap_back
(T : Type) (x : T) (y : T) (st : State) (ret0 : T) (st0 : State) :
Result (State × (T × T))
@@ -63,21 +69,24 @@ def custom_swap_back
let (_, y0) ← core.mem.swap_back1 T x y st st2
Result.ret (st0, (ret0, y0))
-/- [external::test_custom_swap]: forward function -/
+/- [external::test_custom_swap]: forward function
+ Source: 'src/external.rs', lines 29:0-29:59 -/
def test_custom_swap
(x : U32) (y : U32) (st : State) : Result (State × Unit) :=
do
let (st0, _) ← custom_swap U32 x y st
Result.ret (st0, ())
-/- [external::test_custom_swap]: backward function 0 -/
+/- [external::test_custom_swap]: backward function 0
+ Source: 'src/external.rs', lines 29:0-29:59 -/
def test_custom_swap_back
(x : U32) (y : U32) (st : State) (st0 : State) :
Result (State × (U32 × U32))
:=
custom_swap_back U32 x y st 1#u32 st0
-/- [external::test_swap_non_zero]: forward function -/
+/- [external::test_swap_non_zero]: forward function
+ Source: 'src/external.rs', lines 35:0-35:44 -/
def test_swap_non_zero (x : U32) (st : State) : Result (State × U32) :=
do
let (st0, _) ← swap U32 x 0#u32 st
diff --git a/tests/lean/External/FunsExternal_Template.lean b/tests/lean/External/FunsExternal_Template.lean
index c8bc397f..55cd6bb5 100644
--- a/tests/lean/External/FunsExternal_Template.lean
+++ b/tests/lean/External/FunsExternal_Template.lean
@@ -6,22 +6,27 @@ import External.Types
open Primitives
open external
-/- [core::mem::swap]: forward function -/
+/- [core::mem::swap]: forward function
+ Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/mem/mod.rs', lines 726:0-726:42 -/
axiom core.mem.swap (T : Type) : T → T → State → Result (State × Unit)
-/- [core::mem::swap]: backward function 0 -/
+/- [core::mem::swap]: backward function 0
+ Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/mem/mod.rs', lines 726:0-726:42 -/
axiom core.mem.swap_back0
(T : Type) : T → T → State → State → Result (State × T)
-/- [core::mem::swap]: backward function 1 -/
+/- [core::mem::swap]: backward function 1
+ Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/mem/mod.rs', lines 726:0-726:42 -/
axiom core.mem.swap_back1
(T : Type) : T → T → State → State → Result (State × T)
-/- [core::num::nonzero::NonZeroU32::{14}::new]: forward function -/
+/- [core::num::nonzero::{core::num::nonzero::NonZeroU32#14}::new]: forward function
+ Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/num/nonzero.rs', lines 79:16-79:57 -/
axiom core.num.nonzero.NonZeroU32.new
: U32 → State → Result (State × (Option core.num.nonzero.NonZeroU32))
-/- [core::option::Option::{0}::unwrap]: forward function -/
+/- [core::option::{core::option::Option<T>}::unwrap]: forward function
+ Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/option.rs', lines 932:4-932:34 -/
axiom core.option.Option.unwrap
(T : Type) : Option T → State → Result (State × T)
diff --git a/tests/lean/External/Types.lean b/tests/lean/External/Types.lean
index 71d70eed..40f20cda 100644
--- a/tests/lean/External/Types.lean
+++ b/tests/lean/External/Types.lean
@@ -5,7 +5,8 @@ open Primitives
namespace external
-/- [core::num::nonzero::NonZeroU32] -/
+/- [core::num::nonzero::NonZeroU32]
+ Source: '/rustc/d59363ad0b6391b7fc5bbb02c9ccf9300eef3753/library/core/src/num/nonzero.rs', lines 50:12-50:33 -/
axiom core.num.nonzero.NonZeroU32 : Type
/- The state type used in the state-error monad -/