-
Notifications
You must be signed in to change notification settings - Fork 58
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
Constrain acset hom search to specified subsets #873
Conversation
a6732c5
to
b4360ef
Compare
valid
constraint for homsearchThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kris! Since in the end the implementation just adds an extra predicate to check, it might be cleaner and slightly more flexible to call the keyword argument predicates
and have it take a dict of dicts of arbitrary predicates (boolean-valued Julia functions). Then to recover the current behavior, you pass the lambda x -> x ∈ my_set
. What do you think?
Yeah I like this idea a lot! |
Hm on second thought, can we think of any properties other than the simple subset relation that make sense? It seems like you'll always be able to determine the relevant subset before you run the hom search. There's no useful data at runtime (even if you were to throw the current BacktrackingState into the predicate, you have no idea what order the parts are being traversed in) so it's hard to think of a reasonable predicate). |
I agree that in practice this will at most save you a coercion to a set since the input data is finitary, but it might still be nice to not insist on a single data type. Your call. |
It feels nicer whenever we can get away with passing around data rather than functions, and I figured the coercion to |
The |
I'm on board with changing the keyword arg to |
This constraint allows one to say, e.g. when searching for maps from the path graph with two edges into some big graph, that V2 must be sent to either vertex 2, 5, or 6 in the codomain, and that E1 must be sent to edge 3 or 7 in the codomain, etc. I.e. we have the option to restrict valid assignments to an arbitrary subset of the codomain for each part in the domain.
This is a required feature for my implementation of incremental hom search.
This is technically a generalization of the
initial
keyword argument, which would bevalid
assigning a singleton set to some part of the domain. However, the way that case is treated (immediately beginning hom search with that assignment) is very different from the general case (a check when making an assignment arbitrarily deep in the tree), so it's helpful to be able to declare these separately.