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

Monic constraint and no_bind kwarg for AttrVars in hom search #918

Merged
merged 4 commits into from
Jun 29, 2024

Conversation

kris-brown
Copy link
Contributor

Addresses #916 in addition to addressing addressing the fact that the monic constraint keyword effectively would ignore AttrType components of the homomorphisms, which had the effect of:

1.) Returning morphisms which were technically not monic, if there existed matches which bound AttrVars in the domain to concrete values in the codomain
2.) Erroneously erroring due to "free floating variables" - we do not need to error for free floating variables if there is a monic constraint, since there are a finite number of possible assignments for each domain AttrVar in this case.

By default, homomorphism search can bind AttrVars to concrete values, but this will not be possible if monic or no_bind kwargs are turned on (either wholesale with true or componentwise). In these cases, it is not a problem if the domain has free-floating AttrVars. This is accomplished by adding a bit of code at the very end of the hom-search: we look at all of the unbound variables (which necessarily are free-floating ones) and use Iterators.product to further iterate over all possible bindings of those variables to AttrVars in the codomain (if monic, then we further only look at AttrVars which have not yet been assigned to).

@kris-brown kris-brown linked an issue Jun 28, 2024 that may be closed by this pull request
@epatters epatters changed the title Monic constraint and no_bind kwarg for AttrVars in hom search Monic constraint and no_bind kwarg for AttrVars in hom search Jun 28, 2024
Copy link
Member

@epatters epatters left a comment

Choose a reason for hiding this comment

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

Thanks Kris, just one comment about docs!

src/categorical_algebra/HomSearch.jl Show resolved Hide resolved
@epatters epatters merged commit dff1397 into main Jun 29, 2024
10 checks passed
@epatters epatters deleted the bind_kwarg branch June 29, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyword argument for sending attrvars to other attrvars
2 participants