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

Transparency and opacity should not be linked. #987

Open
sarsko opened this issue Apr 6, 2024 · 0 comments
Open

Transparency and opacity should not be linked. #987

sarsko opened this issue Apr 6, 2024 · 0 comments

Comments

@sarsko
Copy link
Contributor

sarsko commented Apr 6, 2024

Currently the following:

#[open]
#[logic]
fn my_logic_function() {}

#[open]
#[logic]
pub fn my_pub_logic_function() {
	my_logic_function()
}

would return the following error:

Cannot make `"my_logic_function"` transparent in `"my_pub_logic_function"` as it would call a less-visible item.

because the inner function is not pub.

This causes issues when we have internal helper functions which we don't want to be pub, but which we want to be open to aid the SMT solvers.

I therefore believe this restriction should be lifted (similar to how you in regular Rust are allowed to pub a function which internally calls a private function).


The reason this came up is that I was updating CreuSAT to current Creusot. It utilises a scheme of having private _inner predicates and logic functions which take Seqs, Ints, etc, and pub wrappers around those functions which take regular Rust types. Previously these _inners where pub, which lead to me using a mix of wrappers and wrappees which made refactoring harder, and tied implementation and proof implementation together more than desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant