Skip to content

Commit f18479a

Browse files
committed
refactor: clean up code and imports
1 parent 0776891 commit f18479a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

CoqOfRust/move_sui/simulations/move_vm_types/values/values_impl.v

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
Require Import CoqOfRust.CoqOfRust.
2-
Require Import Coq.Lists.List.
3-
Import ListNotations.
42
Require Import CoqOfRust.simulations.M.
53
Require Import CoqOfRust.lib.lib.
64

@@ -9,7 +7,6 @@ Import simulations.M.Notations.
97
Require CoqOfRust.move_sui.simulations.move_binary_format.errors.
108
Module PartialVMResult := errors.PartialVMResult.
119
Module PartialVMError := errors.PartialVMError.
12-
Import PartialVMResult.
1310

1411
Require CoqOfRust.move_sui.simulations.move_core_types.vm_status.
1512
Module StatusCode := vm_status.StatusCode.
@@ -209,7 +206,6 @@ Module ReferenceImpl.
209206
| IndexedRef : IndexedRef.t -> t
210207
| ContainerRef : ContainerRef.t -> t
211208
.
212-
213209
End ReferenceImpl.
214210

215211
(*
@@ -661,15 +657,15 @@ Module Impl_IndexedRef.
661657
let idx := Z.to_nat self.(IndexedRef.idx) in
662658
let container := ContainerRef.container self.(IndexedRef.container_ref) in
663659
match container with
664-
| Container.VecBool r => Result.Ok $ ValueImpl.Bool (nth idx r false)
665-
| Container.VecAddress r => Result.Ok $ ValueImpl.Address (nth idx r default_address)
660+
| Container.VecBool r => Result.Ok $ ValueImpl.Bool (List.nth idx r false)
661+
| Container.VecAddress r => Result.Ok $ ValueImpl.Address (List.nth idx r default_address)
666662
| _ => match container with
667-
| Container.VecU8 r => Result.Ok $ ValueImpl.U8 (nth idx r 0)
668-
| Container.VecU16 r => Result.Ok $ ValueImpl.U16 (nth idx r 0)
669-
| Container.VecU32 r => Result.Ok $ ValueImpl.U32 (nth idx r 0)
670-
| Container.VecU64 r => Result.Ok $ ValueImpl.U64 (nth idx r 0)
671-
| Container.VecU128 r => Result.Ok $ ValueImpl.U128 (nth idx r 0)
672-
| Container.VecU256 r => Result.Ok $ ValueImpl.U256 (nth idx r 0)
663+
| Container.VecU8 r => Result.Ok $ ValueImpl.U8 (List.nth idx r 0)
664+
| Container.VecU16 r => Result.Ok $ ValueImpl.U16 (List.nth idx r 0)
665+
| Container.VecU32 r => Result.Ok $ ValueImpl.U32 (List.nth idx r 0)
666+
| Container.VecU64 r => Result.Ok $ ValueImpl.U64 (List.nth idx r 0)
667+
| Container.VecU128 r => Result.Ok $ ValueImpl.U128 (List.nth idx r 0)
668+
| Container.VecU256 r => Result.Ok $ ValueImpl.U256 (List.nth idx r 0)
673669
| _ => Result.Err $ PartialVMError.new StatusCode.UNKNOWN_INVARIANT_VIOLATION_ERROR
674670
end
675671
end.

0 commit comments

Comments
 (0)