Skip to content

Split out Bag theory, elaborate Maps and Bags into Arrays#703

Merged
nikivazou merged 16 commits into
ucsd-progsys:developfrom
clayrat:elab-map
Sep 16, 2024
Merged

Split out Bag theory, elaborate Maps and Bags into Arrays#703
nikivazou merged 16 commits into
ucsd-progsys:developfrom
clayrat:elab-map

Conversation

@clayrat

@clayrat clayrat commented Sep 9, 2024

Copy link
Copy Markdown
Contributor

As a continuation of #688, this PR elaborates Map operations into Array ones, allowing for the correct handling of polymorphic Map values.

It also separates Bags (i.e., integer-valued maps) from generic Maps and removes some ad-hoc Map operations that are currently only implementable as Z3 lambdas (prj, shift and to_set). This is a precursor to adding CVC5 support, as the latter does not support arbitrary Array operations, but instead has a generic SMTLIB Array theory (with const, store and select) and separate theories of Sets and Bags.

@nikivazou nikivazou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment thread tests/neg/maps.fq
constraint:
env [ 1; 2; 3; 4; 5 ]
lhs {v : int | true }
rhs {v : int | m2 = Map_union m4 m4 }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is removed because Map_union is no more supported?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this operation is only defined for Maps with integer values, so it got moved into the Bag theory as Bag_union

@clayrat

clayrat commented Sep 10, 2024

Copy link
Copy Markdown
Contributor Author

For the reference, the Map operations we're removing here were first introduced in #624

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.

2 participants