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

Varmap2 #452

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Varmap2 #452

merged 1 commit into from
Jul 10, 2023

Conversation

bgregoir
Copy link
Contributor

The goal is to remove the depend map Fv.t.
This allows to generalise the semantic, in particular sem and psem can be fully unified.
Normally this should allows to extend array_expansion:
replace reg array argument and return on function call.
It should also allows to remove all the truncate stuff:
we can use sem up to regalloc, after than I think the truncate stuff are not used
anymore.

@bgregoir bgregoir marked this pull request as draft May 21, 2023 10:38
@eponier
Copy link
Contributor

eponier commented May 22, 2023

I didn't look at the code, but the summary is promising!

proofs/lang/varmap.v Outdated Show resolved Hide resolved
@vbgl vbgl force-pushed the varmap2 branch 2 times, most recently from 1b448c0 to 1b0c4ba Compare July 10, 2023 08:02
Varmaps, aka environments, i.e., finite mappings from variables to their
values are now represented by the Vm.t datatype.

These maps are total and return a value compatible with the type of the
variable. They are parametrized by an instance of the WithSubWord class
telling whether said maps may hold partial values (i.e., machine words
whose size is smaller than the variable they are bound to). Source-level
languages enforce the “nosubword” invariant whereas lower-level
languages use the relaxed “withsubword” instance.

Semantics of structured languages is now parametrized by an instance of
the DirectCall class. This parameter controls whether passing of
function arguments and returned values behave as assignments. With the
“indirect_c” instance, function arguments and returned values are
truncated according to the signature of the called function. Moreover,
they must not be undefined values. With the “direct_c” instance however,
exchanged values are blindly copied.

This more relaxed semantics enables the transformation of arrays into
collections of individual variables (aka “register array expansion”)
even when said arrays occur as function arguments or returned values.
Indeed, even if an array is not undefined, there is no guarantee that
its cells are also defined. Using the semantics with direct calls
removes this constraint.
@vbgl vbgl merged commit d262c46 into main Jul 10, 2023
@vbgl vbgl deleted the varmap2 branch July 10, 2023 13:10
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

Successfully merging this pull request may close these issues.

3 participants