Closed dlfivefifty closed 4 years ago
Wait, I got it: all we need is ApplyDomain
and BroadcastDomain
which will replace ProductDomain
, MappedDomain
, etc.
So x in ApplyDomain(f, A, B, ...)
if there exists a in A
and b in B
such that x == f(a,b)
. So [1,2] in ApplyDomain(vcat, 0..1, 1..2)
.
This is a neat idea and I've used it partially in #55. The current implementation is such that a lazy domain implements its in
method in terms of the domains it contains: it can (1) map the point x to something else, (2) distribute the result over the composing domains, and finally (3) combine the outcomes. This is governed by the functions preprocess
, composition
and combine
.
The VcatDomain now exists, a flexible "broadcast" way of constructing domains does not exist yet.
The notion of a product of domains is really about concatenation of the inputs. Renaming it to
VcatDomain
makes this clear, and opens up the possibility ofHcatDomain
andHvcatDomain
, so that: