AlgebraicJulia / AlgebraicABMs.jl

Stochastic graph rewriting for agent based modeling
https://algebraicjulia.github.io/AlgebraicABMs.jl/
MIT License
3 stars 2 forks source link

index error after deleting target #34

Closed ohaaga closed 3 months ago

ohaaga commented 3 months ago

A rule deleting one vertex from the representable edge will not match using rewrite(), but will fire as the only rule of an ABM (and throws an index error).

https://gist.github.com/ohaaga/e7dd1df3e5ca557691e2bde700c06980

kris-brown commented 3 months ago

This comes from the fact that the incremental hom search functionality of AlgebraicRewriting comes with support for monic constraints + application conditions, but does not have any notion of the dangling condition! So the simplest way out is that AlgebraicABMs should just check for all DPO rules that, when it comes time to fire an event, check if the dangling condition is violated and move on if so. In principle this functionality could be added to the incremental hom set itself, though.