Herb-AI / HerbConstraints.jl

Constraints for Herb.jl
https://herb-ai.github.io/
MIT License
0 stars 0 forks source link

Wrapper for domains. (`BitVector` / `StateSparseSet`) #46

Open Whebon opened 1 month ago

Whebon commented 1 month ago

Holes can have domains of two different types:

Propagators can use domain functions to check certain properties. For example:

These functions are used as if the domain was a BitVector. However, they are not intuitive for what they are supposed to do. For a StateSparseSet this is even more confusing, because sum seems like it should behave completely different.

Solution

Use a wrapper function around domains and give intuitive names to domain operations. (Like minimum and size)

abstract type AbstractDomain end

struct BitVetorDomain
    domain::BitVector
end

struct StateDomain
    domain::StateSparseSet
end

It should support at least the following operations:

Why is this not here yet

Adding the wrapper might cause overhead when copying over many holes during program iteration.