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

[WIP][Prover] remove reference for parameters and return value for spec functions #15190

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions third_party/move/move-model/src/builder/module_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,11 @@ impl<'env, 'translator> ModuleBuilder<'env, 'translator> {
) {
let name = self.symbol_pool().make(&name.0.value);
let (type_params, params, result_type) = self.decl_ana_signature(signature, false);
let params = params
.into_iter()
.map(|Parameter(sym, ty, loc)| Parameter(sym, ty.skip_reference().clone(), loc))
.collect_vec();
let result_type = result_type.skip_reference().clone();

// Add the function to the symbol table.
let fun_id = SpecFunId::new(self.spec_funs.len());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module 0x42::m {

struct RistrettoPoint has drop {
handle: u64
}

struct CompressedRistretto has copy, store, drop {
data: vector<u8>
}

native fun point_compress_internal(point: &RistrettoPoint): vector<u8>;

spec fun spec_point_compress_internal(point: &RistrettoPoint): vector<u8>;

spec point_compress_internal(point: &RistrettoPoint): vector<u8> {
pragma opaque;
ensures result == spec_point_compress_internal(point);
}

public fun point_compress(point: &RistrettoPoint): CompressedRistretto {
CompressedRistretto {
data: point_compress_internal(point)
}
}

}
Loading