JuliaReach / LazySets.jl

Scalable symbolic-numeric set computations in Julia
https://juliareach.github.io/LazySets.jl/
Other
227 stars 32 forks source link

Overapproximate a union with a hyperrectangle #1738

Open mforets opened 4 years ago

mforets commented 4 years ago
b = rand(BallInf)
c = rand(Ball2)
u = UnionSet(b, c)
overapproximate(u, Hyperrectangle)

MethodError: no method matching overapproximate(::UnionSet{Float64,BallInf{Float64},Ball2{Float64}}, ::Type{Hyperrectangle})
Closest candidates are:
  overapproximate(!Matched::CartesianProductArray{N<:Real,#s89} where #s89<:AbstractHyperrectangle{N<:Real}, ::Type{#s69} where #s69<:Hyperrectangle) where N<:Real at /home/mforets/.julia/dev/LazySets/src/Approximations/overapproximate.jl:118
  overapproximate(!Matched::CartesianProduct{N<:Real,#s89,#s69} where #s69<:AbstractHyperrectangle{N<:Real} where #s89<:AbstractHyperrectangle{N<:Real}, ::Type{#s57} where #s57<:Hyperrectangle) where N<:Real at /home/mforets/.julia/dev/LazySets/src/Approximations/overapproximate.jl:145
  overapproximate(!Matched::LinearMap{N<:Real,#s89,NM,MAT} where MAT<:AbstractArray{NM,2} where NM where #s89<:AbstractHyperrectangle{N<:Real}, ::Type{Hyperrectangle}) where N<:Real at /home/mforets/.julia/dev/LazySets/src/Approximations/overapproximate.jl:173
  ...

Stacktrace:
 [1] top-level scope at In[11]:4
schillic commented 4 years ago

Just a comment: The reason why this does not work is that UnionSet <: LazySet does not hold. One way to resolve this is to extend the interface to non-convex sets (see #185).