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

Sigma migrations #79

Open
ohaaga opened this issue Aug 8, 2024 · 1 comment
Open

Sigma migrations #79

ohaaga opened this issue Aug 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ohaaga
Copy link

ohaaga commented Aug 8, 2024

Behaviour shown in the tests here isn't what I would expect. I would expect to specify the dictionaries in the "forward" direction, and get sigma migrations from either possible functor between discrete one and two object schemas.

@kris-brown
Copy link
Collaborator

Reposting the gist content here

using AlgebraicABMs, AlgebraicRewriting, Test

@present SchX(FreeSchema) begin X::Ob end
@acset_type XType(SchX)

@present SchXY(FreeSchema) begin 
  X::Ob
  Y::Ob
end
@acset_type XYType(SchXY)

empty_x = @acset XType begin end
empty_xy = @acset XYType begin end

x = representable(XType, :X) 
x′ = representable(XYType, :X)
y = representable(XYType, :Y) 


x_to_x = Migrate(
	Dict(:X => :X),
	Dict(),
	SchX, XType, 
	SchXY, XYType;
	delta=false
)

x_to_y = Migrate(
	Dict(:X => :Y),
	Dict(),
	SchX, XType, 
	SchXY, XYType;
	delta=false
)

@test x_to_x(empty_x) == empty_xy
@test x_to_y(empty_x) == empty_xy

@test x_to_x(x) == x′
@test x_to_y(x) == y

@kris-brown kris-brown self-assigned this Aug 9, 2024
@kris-brown kris-brown added the bug Something isn't working label Aug 9, 2024
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

No branches or pull requests

2 participants