Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit c121bf0

Browse files
authored
[prover] Update MSL doc (#784)
* update MSL doc * update link * revise example
1 parent e7fa1bb commit c121bf0

File tree

5 files changed

+12
-24
lines changed

5 files changed

+12
-24
lines changed

apps/nextra/pages/en/build/smart-contracts/error-codes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For the sources of these errors, see:
1414

1515
- [vm_status.rs](https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/vm_status.rs)
1616
- [error.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/move-stdlib/sources/error.move)
17-
- [account.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account.move)
17+
- [account.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account/account.move)
1818
- [coin.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/coin.move)
1919
- [token.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token/sources/token.move)
2020
- [token_transfers.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token/sources/token_transfers.move)

apps/nextra/pages/en/build/smart-contracts/prover/spec-lang.mdx

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,6 @@ exists <binding>, ..., <binding> [ where <exp> ] : <exp>
136136
- The optional constraint `where <exp>` allows to restrict the quantified range. `forall x: T where p: q`
137137
is equivalent to `forall x: T : p ==> q` and `exists x: T where p: q` is equivalent to `exists x: T : p && q`.
138138

139-
Notice that it is possible to quantify over types. For example:
140-
141-
```move
142-
forall t: type, addr: address where exists<R<t>>(addr): exists<T<t>>(addr)
143-
```
144-
145139
## Choice operator
146140

147141
The choice operator allows selecting a value that satisfies a predicate:
@@ -658,20 +652,6 @@ module 0x42::m {
658652
}
659653
```
660654

661-
If this is not wanted, and the `aborts_with` should be independent of `aborts_if`, one can use the
662-
property `[check]`:
663-
664-
```move
665-
module 0x42::m {
666-
spec get_one_off {
667-
aborts_if !exists<Counter>(addr) with 3;
668-
aborts_if global<Counter>(addr) == 0 with EXECUTION_FAILURE;
669-
670-
aborts_with [check] 3, EXECUTION_FAILURE;
671-
}
672-
}
673-
```
674-
675655
## Requires condition
676656

677657
The `requires` condition is a spec block member that postulates a pre-condition for a function. The
@@ -857,6 +837,14 @@ module 0x42::m {
857837
}
858838
```
859839

840+
Notice that type parameters are supported in global invariants. For example, the invariant above can be rewritten into the below one if `Counter` is generic:
841+
842+
```move
843+
module addr::M {
844+
invariant<T> forall a: addr where exists<Counter<T>>(a): global<Counter<T>>(a).value > 0;
845+
}
846+
```
847+
860848
#### Disabling invariants
861849

862850
There are times when a global invariant holds almost everywhere, except for a brief interval inside a function. In current Move code, this often occurs when something (e.g. an account) is being set up and

apps/nextra/pages/en/build/smart-contracts/resource-accounts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ For an example, see the `SignerCapability` employed by the `mint_nft` function
8383
in [`minting.move`](https://github.com/aptos-labs/aptos-core/blob/2e9d8ee759fcd3f6e831034f05c1656b1c48efc4/aptos-move/move-examples/mint_nft/sources/minting.move#L143-L181).
8484

8585
For more details, see the "resource account" references in [`resource_account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/resource_account.move)
86-
and [`account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account.move).
86+
and [`account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account/account.move).

apps/nextra/pages/ja/build/smart-contracts/error-codes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: "Aptosのエラーコード"
1010

1111
- [vm_status.rs](https://github.com/aptos-labs/aptos-core/blob/main/third_party/move/move-core/types/src/vm_status.rs)
1212
- [error.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/move-stdlib/sources/error.move)
13-
- [account.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account.move)
13+
- [account.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account/account.move)
1414
- [coin.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/coin.move)
1515
- [token.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token/sources/token.move)
1616
- [token_transfers.move](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token/sources/token_transfers.move)

apps/nextra/pages/ja/build/smart-contracts/resource-accounts.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ Aptosでは、リソースアカウントはソースアドレスと追加のシ
4242

4343
例として、[`minting.move`](https://github.com/aptos-labs/aptos-core/blob/2e9d8ee759fcd3f6e831034f05c1656b1c48efc4/aptos-move/move-examples/mint_nft/sources/minting.move#L143-L181)`mint_nft`関数で使用される`SignerCapability`を参照してください。
4444

45-
詳細については、[`resource_account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/resource_account.move)[`account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account.move)の「リソースアカウント」に関する参照を参照してください。
45+
詳細については、[`resource_account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/resource_account.move)[`account.move`](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/account/account.move)の「リソースアカウント」に関する参照を参照してください。

0 commit comments

Comments
 (0)