AlgebraicJulia / Catlab.jl

A framework for applied category theory in the Julia language
https://www.algebraicjulia.org
MIT License
608 stars 58 forks source link

More support for subacsets with variables #817

Closed kris-brown closed 1 year ago

kris-brown commented 1 year ago

This PR extends https://github.com/AlgebraicJulia/Catlab.jl/pull/808 to support negation / subtraction / implication for VarACSets.

Because monic VarFunctions are representable by FinFunctions, a lot of redundant code was eliminated by just treating the components of the AttrType parts the same as the Ob parts - the only care that's needed is to map over the components with AttrVar when constructing the ACSetTransformation components (and undoing this when going in the reverse direction).