-
Notifications
You must be signed in to change notification settings - Fork 5
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
C-Par rewriting #61
Comments
Hi @kris-brown, I know we've discussed this elsewhere but I wanted to list out the example I was talking to you about regarding the runtime schema for a colored petri net somewhere less ephemeral, since it would benefit instantly from this feature. using Catlab, AlgebraicRewriting
@present CPNSch(FreeSchema) begin
(C₁,C₂,M,S)::Ob
RealType::AttrType
IntType::AttrType
StringType::AttrType
c₁::Hom(C₁,M)
c₂::Hom(C₂,M)
m::Hom(M,S)
sname::Attr(S,StringType)
label₁::Attr(C₁,StringType)
label₂::Attr(C₂,StringType)
size::Attr(C₁,IntType)
density::Attr(C₂,RealType)
end
@acset_type CPN(CPNSch)
cpn = @acset CPN{Float64,Int,String} begin
S=3
sname=["A", "B", "C"]
C₁=1
label₁=["job1"]
size=1
c₁=[1]
C₂=1
label₂=["job2"]
density=0.5
c₂=[2]
M=2
m=[1,1]
end
# rule to move colors of type 1 to B
L = @acset CPN{Float64,Int,String} begin
S=2
sname=["A", "B"]
StringType=1
IntType=1
C₁=1
label₁=[AttrVar(1)]
size=[AttrVar(1)]
c₁=[1]
M=1
m=[1]
end
# uh oh, c₁: C₁ -> M is dangling
I = @acset CPN{Float64,Int,String} begin
S=2
sname=["A", "B"]
StringType=1
IntType=1
C₁=1
label₁=[AttrVar(1)]
size=[AttrVar(1)]
end
L = @acset CPN{Float64,Int,String} begin
S=2
sname=["A", "B"]
StringType=1
IntType=1
C₁=1
label₁=[AttrVar(1)]
size=[AttrVar(1)]
c₁=[1]
M=1
m=[2]
end |
Thanks for the example! the other one I find very motivating is a schema |
The intermediate state of the world (and of the rewrite rule, i.e. the$I$ component) in this case would not satisfy the discrete opfibration condition of $C$ -Set. But this should be functionally equivalent to rewriting where the relevant hom has been replaced by a span.
The text was updated successfully, but these errors were encountered: