-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
Require Import CoqOfRust.CoqOfRust. | ||
Require Import CoqOfRust.simulations.M. | ||
|
||
Require Import move_sui.simulations.move_binary_format.file_format. | ||
Require Import move_sui.simulations.move_vm_types.values.values_impl. | ||
Require Import move_sui.proofs.move_vm_types.values.values_impl. | ||
|
||
Module SignatureToken. | ||
Lemma t_beq_is_valid (x y : SignatureToken.t) : | ||
SignatureToken.t_beq x y = true <-> x = y. | ||
Proof. | ||
Admitted. | ||
End SignatureToken. | ||
|
||
Module Constant. | ||
Module Valid. | ||
Definition t (x : Constant.t) : Prop := | ||
match Impl_Value.deserialize_constant x with | ||
| None => False | ||
| Some value => IsValueOfType.t value x.(Constant.type_) | ||
end. | ||
End Valid. | ||
End Constant. | ||
|
||
Module ConstantPool. | ||
Module Valid. | ||
Definition t (x : ConstantPool.t) : Prop := | ||
List.Forall Constant.Valid.t x. | ||
End Valid. | ||
End ConstantPool. | ||
|
||
Module CompiledModule. | ||
Module Valid. | ||
Record t (x : CompiledModule.t) : Prop := { | ||
constant_pool : ConstantPool.Valid.t x.(CompiledModule.constant_pool); | ||
}. | ||
End Valid. | ||
End CompiledModule. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
CoqOfRust/move_sui/proofs/move_vm_types/values/values_impl.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Require Import CoqOfRust.CoqOfRust. | ||
Require Import CoqOfRust.simulations.M. | ||
Require Import CoqOfRust.lib.proofs.lib. | ||
|
||
Require Import move_sui.simulations.move_binary_format.file_format. | ||
Require Import move_sui.simulations.move_vm_types.values.values_impl. | ||
|
||
Module IsValueOfType. | ||
Definition t (value : Value.t) (typ : SignatureToken.t) : Prop := | ||
match value, typ with | ||
| ValueImpl.U8 _, SignatureToken.U8 => True | ||
| ValueImpl.U16 _, SignatureToken.U16 => True | ||
| ValueImpl.U32 _, SignatureToken.U32 => True | ||
| ValueImpl.U64 _, SignatureToken.U64 => True | ||
| ValueImpl.U128 _, SignatureToken.U128 => True | ||
| ValueImpl.U256 _, SignatureToken.U256 => True | ||
| ValueImpl.Bool _, SignatureToken.Bool => True | ||
| ValueImpl.Address _, SignatureToken.Address => True | ||
(* TODO: other cases *) | ||
| _, _ => False | ||
end. | ||
End IsValueOfType. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters