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

Partial abstraction / variable substitution+merging #29

Merged
merged 2 commits into from
Oct 14, 2023
Merged

Conversation

kris-brown
Copy link
Collaborator

@kris-brown kris-brown commented Oct 11, 2023

VarACSets work very well with colimits, but limits are subtle. Likewise, maps out of VarACSets are very nice, but maps into VarACSets are subtle. Some more machinery for working with VarACSets is implemented here (which could potentially be upstreamed once it gets battle-tested).

Firstly, sub_vars takes an ACSet + some data (e.g. AttrVar(1) -> :x, AttrVar(3)->:abc) and "evaluates" the variables. This PR also allows this to merge variables together based on input data like [AttrVar(2), AttrVar(4)]. This is all done via a pushout.

Secondly, a notion of "partial abstraction" is needed because we want to take maps B->X and lift them to maps into the "fully abstracted" version of X1 (call it A). This is hard for two reasons: 1.) no ACSet with concrete attribute values can map into A, 2.) an issue with needing to send an AttrVar to two distinct AttrVars in A, explained more in the docstring. This problem is addressed via applying sub_vars to a fully abstracted ACSet.

This corresponds to a factorization of B->X into B->ParAbs(X)->X (observed by @KevinArlin: see nlab and the blog for more details).

Footnotes

  1. This replaces all attributes with distinct variables, even if (e.g.) all the weights of the graph edges are the same value.

@kris-brown kris-brown self-assigned this Oct 11, 2023
@kris-brown kris-brown added the bug Something isn't working label Oct 11, 2023
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8f785c7) 79.88% compared to head (60cce70) 81.22%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   79.88%   81.22%   +1.33%     
==========================================
  Files          27       27              
  Lines        1700     1672      -28     
==========================================
  Hits         1358     1358              
+ Misses        342      314      -28     
Files Coverage Δ
src/categorical_algebra/CSets.jl 95.41% <100.00%> (+7.50%) ⬆️
src/rewrite/PBPO.jl 88.05% <100.00%> (+4.72%) ⬆️
src/rewrite/Representable.jl 58.33% <100.00%> (ø)
src/schedules/Wiring.jl 82.05% <100.00%> (+2.74%) ⬆️
src/schedules/Basic.jl 68.29% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kris-brown kris-brown merged commit 8c4bde4 into main Oct 14, 2023
9 checks passed
@kris-brown kris-brown deleted the fixPBPO branch October 14, 2023 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant