Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Prover] the use of a type parameter with exists in spec #6658

Open
junkil-park opened this issue Feb 17, 2023 · 6 comments · Fixed by #6777
Open

[Prover] the use of a type parameter with exists in spec #6658

junkil-park opened this issue Feb 17, 2023 · 6 comments · Fixed by #6777
Assignees
Labels
bug Something isn't working move-prover stale-exempt Prevents issues from being automatically marked and closed as stale

Comments

@junkil-park
Copy link
Contributor

junkil-park commented Feb 17, 2023

How to reproduce

This case is from the object module in the aptos_framework. To reproduce, run Prover uncommenting the ensures line.

    native fun exists_at<T: key>(object: address): bool;
    spec exists_at {
        pragma opaque;
        aborts_if false;
        // TODO: Disabled the following post-condition due to an issue with
        // the use of a type parameter in `exists` in spec.
        // ensures result == exists<T>(object);
    }

The current version of Prover fails during the model building process, complaining that:

error: The type argument to `exists` and `global` must be a struct type but #0 is not a struct type.
  ┌─ ./sources/object.spec.move:7:27
  │
7 │         ensures result == exists<T>(object);
  │                           ^^^^^^^^^^^^^^^^^

Error: exiting with model building errors

Expected output

Prover runs without an error.

@junkil-park junkil-park added the bug Something isn't working label Feb 17, 2023
junkil-park added a commit that referenced this issue Feb 17, 2023
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: #6658
junkil-park added a commit that referenced this issue Feb 17, 2023
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: #6658
@junkil-park junkil-park self-assigned this Feb 23, 2023
@lbmeiyi lbmeiyi moved this from 🆕 New to For Grabs in Move Language and Runtime Feb 24, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 9, 2023

This issue is stale because it has been open 45 days with no activity. Remove the stale label or comment - otherwise this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Apr 9, 2023
@rahxephon89
Copy link
Contributor

Close since #6777 resolved it.

@github-project-automation github-project-automation bot moved this from For Grabs to ✅ Done in Move Language and Runtime Apr 9, 2023
@rahxephon89 rahxephon89 reopened this Jun 20, 2023
@github-project-automation github-project-automation bot moved this from ✅ Done to 📋 Backlog in Move Language and Runtime Jun 20, 2023
@rahxephon89
Copy link
Contributor

Reopen this to track the feature request to support exists_at in the spec.

@rahxephon89 rahxephon89 self-assigned this Jun 20, 2023
@wrwg
Copy link
Contributor

wrwg commented Jun 21, 2023

Why do we need exists_at at spec level? One can just use exists in specifications, since specs do not have the restriction to only do this for resources in the same module.

@github-actions github-actions bot removed the Stale label Jun 21, 2023
@rahxephon89
Copy link
Contributor

rahxephon89 commented Jun 22, 2023

Why do we need exists_at at spec level? One can just use exists in specifications, since specs do not have the restriction to only do this for resources in the same module.

When exists_at is instantiated with a concrete type, it is OK to use exists. But in the function public fun address_to_object<T: key>(object: address): Object<T> in the object module, exists_at is used in the assert statement and generic types such as exists<T> are not supported in the spec language.

@wrwg
Copy link
Contributor

wrwg commented Jun 22, 2023

Why do we need exists_at at spec level? One can just use exists in specifications, since specs do not have the restriction to only do this for resources in the same module.

When exists_at is instantiated with a concrete type, it is OK to use exists. But in the function public fun address_to_object<T: key>(object: address): Object<T> in the object module, exists_at is used in the assert statement and generic types such as exists<T> are not supported in the spec language.

Then we probably should fix the bug that generic types are not supported for exists?

@rahxephon89 rahxephon89 moved this from 📋 Backlog to 🏗 In progress in Move Language and Runtime Jun 23, 2023
@rahxephon89 rahxephon89 moved this from 🏗 In progress to 📋 Backlog in Move Language and Runtime Jul 27, 2023
@sausagee sausagee added the stale-exempt Prevents issues from being automatically marked and closed as stale label Jul 31, 2023
vgao1996 pushed a commit to vgao1996/aptos-framework-test that referenced this issue Sep 16, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
vgao1996 pushed a commit to vgao1996/aptos-framework-test that referenced this issue Sep 16, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Sep 17, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 23, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 24, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 30, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Oct 30, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Nov 14, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
aptos-bot pushed a commit to aptos-labs/aptos-framework that referenced this issue Dec 5, 2024
- This PR fix the broken spec by mocking up the `aptos_framework::object::exists_at`.
- It's because a correct spec is not supported by Prover. This is a TODO and filed as an issue: aptos-labs/aptos-core#6658

GitOrigin-RevId: 74f6790f32b4fc09729d8c0e7930f9f93b534e2a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working move-prover stale-exempt Prevents issues from being automatically marked and closed as stale
Projects
Status: 📋 Backlog
4 participants