Monic constraint and no_bind
kwarg for AttrVars in hom search
#918
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
orno_bind
kwargs are turned on (either wholesale withtrue
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 useIterators.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).