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

Support definitions that are local to a theory #1351

Open
myreen opened this issue Nov 20, 2024 · 3 comments
Open

Support definitions that are local to a theory #1351

myreen opened this issue Nov 20, 2024 · 3 comments

Comments

@myreen
Copy link
Contributor

myreen commented Nov 20, 2024

I would like to be able to write local on some definitions:

Definition foo_def[local]:
  foo n = n + 1:num
End

The intended meaning is the same as writing:

Definition foo_def:
  foo n = n + 1:num
End

...
                
val _ = (delete_const "foo"; export_theory());
@myreen
Copy link
Contributor Author

myreen commented Nov 20, 2024

The delete_const at the end there might be a bit too destructive since some people give HOL the entire script file (including the export_theory line) when starting their session.

My main wish is that the local definitions are as absent as possible from the perspective of other theories.

@konrad-slind
Copy link
Contributor

Deletion of constants and invalidation of definitions is a big change to the HOL logic. I have no problem with it being an informal aspect of working with HOL, especially when working in a scratch theory. But it would be nice to have it formally verified in something like the Candle setting.

Half-baked thought: maybe export_theory() could be refined into a kind of "conservative extension" inference rule which only retains material in the current theory segment that has types and constants drawn from (A) the ancestry or (B) the "segment signature", which lists out the types and constants one wants to keep from the current theory segment.

@konrad-slind
Copy link
Contributor

Or one could take a complementary approach and list out the "segment co-signature" which enumerates the types and constants one wants to suppress.

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

No branches or pull requests

2 participants