From 1151752a3a7f46c114a7277cf3b83cce92ad9357 Mon Sep 17 00:00:00 2001 From: schillic Date: Sun, 6 Jan 2019 22:00:23 +0100 Subject: [PATCH] subset check in polyhedron --- docs/src/lib/binary_functions.md | 1 + docs/src/man/set_operations.md | 46 ++++++++-------- src/is_subset.jl | 95 ++++++++++++++++++++++++++++---- test/unit_Polygon.jl | 1 - test/unit_Polytope.jl | 17 ++++++ 5 files changed, 124 insertions(+), 36 deletions(-) diff --git a/docs/src/lib/binary_functions.md b/docs/src/lib/binary_functions.md index 31dc07ca67..97a3db18bf 100644 --- a/docs/src/lib/binary_functions.md +++ b/docs/src/lib/binary_functions.md @@ -67,6 +67,7 @@ intersection(::UnionSetArray{N}, ::LazySet{N}) where {N<:Real} ⊆(::AbstractPolytope{N}, ::LazySet{N}, ::Bool=false) where {N<:Real} ⊆(::AbstractPolytope{N}, ::AbstractHyperrectangle, ::Bool=false) where {N<:Real} ⊆(::AbstractHyperrectangle{N}, ::AbstractHyperrectangle{N}, ::Bool=false) where {N<:Real} +⊆(::LazySet{N}, ::Union{AbstractPolytope{N}, HPolyhedron{N}, HalfSpace{N}}, ::Bool=false) where {N<:Real} ⊆(::AbstractSingleton{N}, ::LazySet{N}, ::Bool=false) where {N<:Real} ⊆(::AbstractSingleton{N}, ::AbstractHyperrectangle{N}, ::Bool=false) where {N<:Real} ⊆(::AbstractSingleton{N}, ::AbstractSingleton{N}, ::Bool=false) where {N<:Real} diff --git a/docs/src/man/set_operations.md b/docs/src/man/set_operations.md index 024bdcb210..ff9ca48e2c 100644 --- a/docs/src/man/set_operations.md +++ b/docs/src/man/set_operations.md @@ -225,30 +225,30 @@ The table entries consist of subsets of the following list of operations. | type ↓ \ type → |LazyS |APtop |ACSym |ACSPt |APgon |AHrec |AHPgn |ASing |Ball1 |Ball2 |BInf |Ballp |Ellip |Empty |HalfS |HPgon |HPhed |HPtop |Hplan |Hrect |Itrvl |Line |LineS |Singl |VPgon |VPtop |ZeroS |Zonot | CP | CPA | CH | CHA |EMap | EPM |Itsct |ItscA |LiMap | MS | MSA | CMS | SIH | UnionSet | UnionSArr | |-------------------------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | **Interfaces** | | | | | | | | | | | | | | | ⊎ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -| `LazySet` | ⊎ | ⊎i | ⊎i | ⊎i | ⊎i |⊆ ⊎i |⊆i ⊎ | ⊎ ∩ | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎ | ⊎ |⊆i ⊎ |⊆i ⊎i | ⊎i | ⊎ | ⊎i | ⊎i ∩i | ⊎i | ⊎i | ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎ ∩ | ⊎ ∩ | +| `LazySet` | ⊎ |⊆ ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆ ⊎i |⊆i ⊎ |⊆i ⊎ ∩ |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆ ⊎i |⊆i ⊎i |⊆ ⊎ |⊆i ⊎ |⊆i ⊎ |⊆i ⊎i |⊆i ⊎i | ⊎ |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎ ∩ | ⊎ ∩ | | `APolytope` |⊆ ⊎i |⊆i ⊎i ∩ |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆ ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩ |⊆i ⊎i ∩ |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | -| `ACentrallySymmetric` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `ACentrallySymmetric` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | | `ACentrallySymmetricPolytope` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `APolygon` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |- |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `AHyperrectangle` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆ ⊎ ∩ |⊆i ⊎i ∩i |⊆i ⊎ ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `AHPolygon` |⊆i ⊎ |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩ |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |- |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i C |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | -| `ASingleton` |⊆ ⊎ ∩ |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆ ⊎ ∩i |⊆i ⊎i ∩i |⊆ ⊎ ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | +| `ASingleton` |⊆ ⊎ ∩ |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆ ⊎ ∩i |⊆i ⊎i ∩i |⊆ ⊎ ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | | | | | | | | | | | | | | | | ⊎ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Basic set types** | | | | | | | | | | | | | | | ⊎ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Ball1` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | -| `Ball2` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆ ⊎i ∩i | ⊎i |⊆ ⊎ |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆ ⊎i ∩i | ⊎i | ⊎i |⊆ ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `Ball2` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆ ⊎i ∩i |⊆i ⊎i |⊆ ⊎ |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆ ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆ ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | | `BallInf` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | -| `Ballp` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆ ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆ ⊎i ∩i | ⊎i | ⊎i |⊆ ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `Ellipsoid` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `EmptySet` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `HalfSpace` | ⊎ | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎ | ⊎i | ⊎i ∩ | ⊎i ∩ | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `Ballp` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆ ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆ ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆ ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `Ellipsoid` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `EmptySet` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `HalfSpace` | ⊎ |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎ |⊆i ⊎i |⊆i ⊎i ∩ |⊆i ⊎i ∩ | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | | `HPolygon`/`HPolygonOpt` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i C |⊆i ⊎i ∩i C |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i C |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i ∩i C |⊆i ⊎i |⊆i ⊎i ∩i Ci|- |⊆i ⊎i |⊆i ⊎i ∩i C |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i Ci| ⊎i ∩i | ⊎i ∩i | -| `HPolyhedron` | ⊎ | ⊎i ∩ C | ⊎i | ⊎i ∩i Ci| ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i ∩i Ci| ⊎i |⊆i ⊎i ∩i Ci| ⊎i | ⊎i | ⊎i | ⊎i ∩ | ⊎i ∩i Ci| ⊎i ∩ | ⊎i ∩ Ci| ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i | ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i ∩i Ci| ⊎i ∩ Ci|⊆i ⊎i ∩i Ci| ⊎i ∩i Ci| ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i Ci| ⊎i ∩i | ⊎i ∩i | +| `HPolyhedron` | ⊎ |⊆i ⊎i ∩ C | ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i |⊆i ⊎i ∩i Ci| ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩ |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩ |⊆i ⊎i ∩ Ci| ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩ Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci| ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i Ci| ⊎i ∩i | ⊎i ∩i | | `HPolytope` |⊆i ⊎ |⊆i ⊎i ∩ C |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i C |⊆i ⊎i ∩i C |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩ |⊆i ⊎i ∩i C |⊆i ⊎i ∩ |⊆i ⊎i ∩ Ci|⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩ C |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i Ci| ⊎i ∩i | ⊎i ∩i | -| `Hyperplane` | ⊎ | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎ | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `Hyperplane` | ⊎ |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎ | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | | `Hyperrectangle` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i C |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `Interval` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |- |⊆i ⊎i ∩i |- |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |- |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |- |- |⊆i ⊎i ∩i |- |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | -| `Line` | ⊎ | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |- | ⊎i ∩ | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `Line` | ⊎ |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |- | ⊎i ∩ |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | | `LineSegment` |⊆ ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆ ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |- |⊆i ⊎i |⊆i ⊎ ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `Singleton` |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `VPolygon` |⊆i ⊎i |⊆i ⊎i ∩i C |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i C |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i ∩i Ci|- |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i Ci| ⊎i ∩i | ⊎i ∩i | @@ -257,18 +257,18 @@ The table entries consist of subsets of the following list of operations. | `Zonotope` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i C |⊆i ⊎i ∩i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎ |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i Ci|⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i Ci|⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i Ci| ⊎i ∩i | ⊎i ∩i | | | | | | | | | | | | | | | | | ⊎ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **Lazy set operation types** | | | | | | | | | | | | | | | ⊎ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -| `CartesianProduct` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `CartesianProductArray` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `ConvexHull` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `ConvexHullArray` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `ExponentialMap` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `ExponentialProjectionMap` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `Intersection` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `IntersectionArray` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `LinearMap` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `MinkowskiSum` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `MinkowskiSumArray` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | -| `CacheMinkowskiSum` | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i |⊆i ⊎i ∩i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `CartesianProduct` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `CartesianProductArray` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `ConvexHull` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `ConvexHullArray` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `ExponentialMap` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `ExponentialProjectionMap` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `Intersection` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `IntersectionArray` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `LinearMap` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `MinkowskiSum` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `MinkowskiSumArray` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | +| `CacheMinkowskiSum` | ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i |⊆i ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i | ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i | ⊎i |⊆i ⊎i | ⊎i ∩i | ⊎i ∩i | | `SymmetricIntervalHull` |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i |⊆i ⊎i ∩i | ⊎i ∩i | ⊎i ∩i | | `UnionSet` |⊆ ⊎ ∩ |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i | ⊎ | ⊎ | | `UnionSetArray` |⊆ ⊎ ∩ |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i |⊆i ⊎i ∩i | ⊎ | ⊎ | diff --git a/src/is_subset.jl b/src/is_subset.jl index bdad9123f0..c93e2bef34 100644 --- a/src/is_subset.jl +++ b/src/is_subset.jl @@ -22,7 +22,7 @@ optionally compute a witness. * If `witness` option is deactivated: `true` iff ``S ⊆ H`` * If `witness` option is activated: * `(true, [])` iff ``S ⊆ H`` - * `(false, v)` iff ``S \\not\\subseteq H`` and ``v ∈ S \\setminus H`` + * `(false, v)` iff ``S ⊈ H`` and ``v ∈ S \\setminus H`` ### Algorithm @@ -53,7 +53,7 @@ optionally compute a witness. * If `witness` option is deactivated: `true` iff ``P ⊆ H`` * If `witness` option is activated: * `(true, [])` iff ``P ⊆ H`` - * `(false, v)` iff ``P \\not\\subseteq H`` and ``v ∈ P \\setminus H`` + * `(false, v)` iff ``P ⊈ H`` and ``v ∈ P \\setminus H`` ### Notes @@ -107,7 +107,7 @@ hyperrectangular set, and if not, optionally compute a witness. * If `witness` option is deactivated: `true` iff ``H1 ⊆ H2`` * If `witness` option is activated: * `(true, [])` iff ``H1 ⊆ H2`` - * `(false, v)` iff ``H1 \\not\\subseteq H2`` and ``v ∈ H1 \\setminus H2`` + * `(false, v)` iff ``H1 ⊈ H2`` and ``v ∈ H1 \\setminus H2`` ### Algorithm @@ -168,7 +168,7 @@ compute a witness. * If `witness` option is deactivated: `true` iff ``P ⊆ S`` * If `witness` option is activated: * `(true, [])` iff ``P ⊆ S`` - * `(false, v)` iff ``P \\not\\subseteq S`` and ``v ∈ P \\setminus S`` + * `(false, v)` iff ``P ⊈ S`` and ``v ∈ P \\setminus S`` ### Algorithm @@ -195,6 +195,69 @@ function ⊆(P::AbstractPolytope{N}, S::LazySet{N}, witness::Bool=false end end +""" + ⊆(S::LazySet{N}, + P::Union{AbstractPolytope{N}, HPolyhedron{N}, HalfSpace{N}}, + witness::Bool=false + )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real} + +Check whether a convex set is contained in a polyhedron, and if not, optionally +compute a witness. + +### Input + +- `S` -- inner convex set +- `P` -- outer polyhedron (including a half-space) +- `witness` -- (optional, default: `false`) compute a witness if activated + +### Output + +* If `witness` option is deactivated: `true` iff ``S ⊆ P`` +* If `witness` option is activated: + * `(true, [])` iff ``S ⊆ P`` + * `(false, v)` iff ``S ⊈ P`` and ``v ∈ P \\setminus S`` + +### Algorithm + +Since ``S`` is convex, we can compare the support function of ``S`` and ``P`` in +each direction of the constraints of ``P``. + +For witness generation, we use the support vector in the first direction where +the above check fails. +""" +function ⊆(S::LazySet{N}, + P::Union{AbstractPolytope{N}, HPolyhedron{N}, HalfSpace{N}}, + witness::Bool=false + )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real} + @inbounds for H in constraints_list(P) + if ρ(H.a, S) > H.b + if witness + return (false, σ(H.a, S)) + else + return false + end + end + end + return witness ? (true, N[]) : true +end + +# disambiguation +function ⊆(S::Union{AbstractPolytope{N}, AbstractHyperrectangle{N}, + AbstractSingleton{N}, LineSegment{N}}, + P::Union{AbstractPolytope{N}, HPolyhedron{N}, HalfSpace{N}}, + witness::Bool=false + )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real} + return invoke(⊆, Tuple{LazySet{N}, typeof(P), Bool}, S, P, witness) +end +function ⊆(P::AbstractPolytope{N}, + H::AbstractHyperrectangle{N}, + witness::Bool=false + )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real} + return invoke(⊆, + Tuple{LazySet{N}, AbstractHyperrectangle{N}, Bool}, + P, H, witness) +end + # --- AbstractSingleton --- @@ -217,7 +280,7 @@ if not, optionally compute a witness. * If `witness` option is deactivated: `true` iff ``S ⊆ \\text{set}`` * If `witness` option is activated: * `(true, [])` iff ``S ⊆ \\text{set}`` - * `(false, v)` iff ``S \\not\\subseteq \\text{set}`` and + * `(false, v)` iff ``S ⊈ \\text{set}`` and ``v ∈ S \\setminus \\text{set}`` """ function ⊆(S::AbstractSingleton{N}, set::LazySet{N}, witness::Bool=false @@ -251,7 +314,7 @@ set, and if not, optionally compute a witness. * If `witness` option is deactivated: `true` iff ``S ⊆ H`` * If `witness` option is activated: * `(true, [])` iff ``S ⊆ H`` - * `(false, v)` iff ``S \\not\\subseteq H`` and ``v ∈ S \\setminus H`` + * `(false, v)` iff ``S ⊈ H`` and ``v ∈ S \\setminus H`` ### Notes @@ -290,7 +353,7 @@ single value, and if not, optionally compute a witness. * If `witness` option is deactivated: `true` iff ``S1 ⊆ S2`` iff ``S1 == S2`` * If `witness` option is activated: * `(true, [])` iff ``S1 ⊆ S2`` - * `(false, v)` iff ``S1 \\not\\subseteq S2`` and ``v ∈ S1 \\setminus S2`` + * `(false, v)` iff ``S1 ⊈ S2`` and ``v ∈ S1 \\setminus S2`` """ function ⊆(S1::AbstractSingleton{N}, S2::AbstractSingleton{N}, @@ -326,7 +389,7 @@ and if not, optionally compute a witness. * If `witness` option is deactivated: `true` iff ``B1 ⊆ B2`` * If `witness` option is activated: * `(true, [])` iff ``B1 ⊆ B2`` - * `(false, v)` iff ``B1 \\not\\subseteq B2`` and ``v ∈ B1 \\setminus B2`` + * `(false, v)` iff ``B1 ⊈ B2`` and ``v ∈ B1 \\setminus B2`` ### Algorithm @@ -372,7 +435,7 @@ value, and if not, optionally compute a witness. * If `witness` option is deactivated: `true` iff ``B ⊆ S`` * If `witness` option is activated: * `(true, [])` iff ``B ⊆ S`` - * `(false, v)` iff ``B \\not\\subseteq S`` and ``v ∈ B \\setminus S`` + * `(false, v)` iff ``B ⊈ S`` and ``v ∈ B \\setminus S`` """ function ⊆(B::Union{Ball2{N}, Ballp{N}}, S::AbstractSingleton{N}, @@ -419,7 +482,7 @@ optionally compute a witness. * If `witness` option is deactivated: `true` iff ``L ⊆ S`` * If `witness` option is activated: * `(true, [])` iff ``L ⊆ S`` - * `(false, v)` iff ``L \\not\\subseteq S`` and ``v ∈ L \\setminus S`` + * `(false, v)` iff ``L ⊈ S`` and ``v ∈ L \\setminus S`` ### Algorithm @@ -458,7 +521,7 @@ optionally compute a witness. * If `witness` option is deactivated: `true` iff ``L ⊆ H`` * If `witness` option is activated: * `(true, [])` iff ``L ⊆ H`` - * `(false, v)` iff ``L \\not\\subseteq H`` and ``v ∈ L \\setminus H`` + * `(false, v)` iff ``L ⊈ H`` and ``v ∈ L \\setminus H`` ### Notes @@ -531,7 +594,15 @@ function ⊆(∅::EmptySet{N}, X::LazySet{N}, witness::Bool=false end # disambiguation -function ⊆(∅::EmptySet{N}, H::AbstractHyperrectangle{N}, witness::Bool=false +function ⊆(∅::EmptySet{N}, + S::Union{AbstractPolytope{N}, HPolyhedron{N}, HalfSpace{N}}, + witness::Bool=false + )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real} + return witness ? (true, N[]) : true +end +function ⊆(∅::EmptySet{N}, + H::AbstractHyperrectangle{N}, + witness::Bool=false )::Union{Bool, Tuple{Bool, Vector{N}}} where {N<:Real} return witness ? (true, N[]) : true end diff --git a/test/unit_Polygon.jl b/test/unit_Polygon.jl index 5d8bf82faa..c54c3de28f 100644 --- a/test/unit_Polygon.jl +++ b/test/unit_Polygon.jl @@ -219,7 +219,6 @@ for N in [Float64, Float32, Rational{Int}] p2 = VPolygon([N[1, 0]]) b = BallInf(N[2, 0], N(1)) @test ⊆(p2, p1) && ⊆(p2, p1, true)[1] - @test ⊆(HPolygon{N}(), p1) subset, witness = ⊆(p1, b, true) @test !⊆(p1, b) && !subset && witness ∈ p1 && witness ∉ b subset, witness = ⊆(p2, b, true) diff --git a/test/unit_Polytope.jl b/test/unit_Polytope.jl index d482f72568..e8845b94cf 100644 --- a/test/unit_Polytope.jl +++ b/test/unit_Polytope.jl @@ -100,6 +100,12 @@ for N in [Float64, Rational{Int}, Float32] remove_redundant_constraints!(P) @test length(P.constraints) == 4 + # subset + H = BallInf(N[0, 0], N(1)) + P = convert(HPolytope, H) + @test BallInf(N[0, 0], N(1)) ⊆ P + @test !(BallInf(N[0, 0], N(1.01)) ⊆ P) + # ----- # V-rep # ----- @@ -282,5 +288,16 @@ if test_suite_polyhedra cp = cartesian_product(p1, p2) vl = vertices_list(cp) @test ispermutation(vl, [N[0, 0, 2], N[1, 1, 2]]) + + # tohrep from VPolytope + P = VPolytope([v1, v2, v3, v4, v5]) + @test tohrep(P) isa HPolytope + @test tovrep(P) isa VPolytope # no-op + + # subset (see #974) + H = BallInf(N[0, 0], N(1)) + P = convert(VPolytope, H) + @test BallInf(N[0, 0], N(1)) ⊆ P + @test !(BallInf(N[0, 0], N(1.01)) ⊆ P) end end