# It's All Set - LazySets Errors: Showing Types and set\_tolerance not defined

**URL:** https://discourse.julialang.org/t/its-all-set-lazysets-errors-showing-types-and-set-tolerance-not-defined/85994
**Category:** General Usage
**Tags:** package
**Created:** [August 19, 2022, 10:41am UTC](https://discourse.julialang.org/t/its-all-set-lazysets-errors-showing-types-and-set-tolerance-not-defined/85994 "2022-08-19T10:41:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)
#### Post date: [August 19, 2022, 10:41am UTC](https://discourse.julialang.org/t/its-all-set-lazysets-errors-showing-types-and-set-tolerance-not-defined/85994/1 "2022-08-19T10:41:35Z")

</div>

Hi all,

I get two errors on LazySets tutorial at the last section, the first one:

```julia
using LazySets

println("=== Concrete set types ===\n")
for S in subtypes(LazySet, true)
    if !isoperationtype(S)
        println(S)
    end
end
println("\n=== Lazy set types ===\n")
for S in subtypes(LazySet, true)
    if isoperationtype(S)
        println(S)
    end
end

```

get:  
**=== Concrete set types ===**

**Ball1**  
**Ball2**  
**BallInf**  
**Ballp**  
**DensePolynomialZonotope**  
**Ellipsoid**  
**EmptySet**  
**HParallelotope**  
**HPolygon**  
**HPolygonOpt**  
**HPolyhedron**  
**HPolytope**  
**HalfSpace**  
**Hyperplane**  
**Hyperrectangle**  
**Interval**  
**LazySets.AbstractStar**  
**Line**  
**Line2D**  
**LineSegment**

**MethodError: no method matching isoperationtype(::Type{QuadraticMap})**  
**Closest candidates are:**  
\*\* isoperationtype(::ConvexSet) at ~/.julia/packages/LazySets/7LPS2/src/Interfaces/ConvexSet.jl:796\*\*  
\*\* isoperationtype(::Type{\<:ConvexHull}) at ~/.julia/packages/LazySets/7LPS2/src/LazyOperations/ConvexHull.jl:53\*\*  
\*\* isoperationtype(::Type{\<:Singleton}) at ~/.julia/packages/LazySets/7LPS2/src/Sets/Singleton.jl:32\*\*  
\*\* …\*\*

**Stacktrace:**  
\*\* [1] top-level scope\*\*  
\*\* @ ./In[65]:3\*\*  
\*\* [2] eval\*\*  
\*\* @ ./boot.jl:373 [inlined]\*\*  
\*\* [3] include\_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)\*\*  
\*\* @ Base ./loading.jl:1196\*\*

Then the second one:

```julia
import Polyhedra, CDDLib
using LazySets, LaTeXStrings, Optim
using Plots: plot, plot!, text, lens!, bbox

p(args...; kwargs...) = plot(xlims=(0,4), ylims=(0,4), ratio=1, lab="",
                        xlab=L"x_{1}", ylab=L"x_{2}", args...; kwargs...)
p!(args...; kwargs...) = plot!(lab="", args...; kwargs...);

polygon() = VPolygon([[1.0, 1.0], [1.000000001, 1.0]])

# default relative tolerance
@show LazySets._rtol(Float64)

P1 = polygon()

@show vertices_list(P1)

# increase relative tolerance
LazySets.set_rtol(Float64, 1e-9)

P2 = polygon()

@show vertices_list(P2)

p(xlims=(0.9999999985, 1.000000002), ylims=(0.9999999985, 1.000000002))
p!(P1)
p!(P2)

# reset relative tolerance to default
LazySets.set_tolerance(Float64)

p!()

```

get:  
**LazySets.\_rtol(Float64) = 1.0e-9**  
**vertices\_list(P1) = [[1.0, 1.0], [1.000000001, 1.0]]**  
**vertices\_list(P2) = [[1.0, 1.0], [1.000000001, 1.0]]**

**UndefVarError: set\_tolerance not defined**

**Stacktrace:**  
\*\* [1] getproperty(x::Module, f::Symbol)\*\*  
\*\* @ Base ./Base.jl:35\*\*  
\*\* [2] top-level scope\*\*  
\*\* @ In[70]:30\*\*  
\*\* [3] eval\*\*  
\*\* @ ./boot.jl:373 [inlined]\*\*  
\*\* [4] include\_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)\*\*  
\*\* @ Base ./loading.jl:1196\*\*

---

<div class="post-metadata">

### Author: ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)
#### Post date: [August 19, 2022, 12:58pm UTC](https://discourse.julialang.org/t/its-all-set-lazysets-errors-showing-types-and-set-tolerance-not-defined/85994/2 "2022-08-19T12:58:51Z")

</div>

> [@Freya\_the\_Goddess](#):
>
> **MethodError: no method matching isoperationtype(::Type{QuadraticMap})**

For this first one, it seems the `QuadraticMap` type was added just a month ago to LazySets, and I think they missed to add a `isoperationtype(::Type{QuadraticMap})` method (or maybe it was intentional, in which case the tutorial needs to be updated). Either way, I’ll open an issue for this, thanks for reporting it.

For now, you can do:

```julia
julia> for S in subtypes(LazySet, true)
           # these three types don't have an `isoperationtype` method, so work around it
           S in (QuadraticMap, SimpleSparsePolynomialZonotope, SparsePolynomialZonotope) && continue
           if !isoperationtype(S)
               println(S)
           end
       end

```

to print out the rest of the concrete set types.

---

<div class="post-metadata">

### Author: ![digital\_carver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/digital_carver/32/33818_2.png) [@digital\_carver](https://discourse.julialang.org/u/digital_carver)
#### Post date: [August 19, 2022, 1:29pm UTC](https://discourse.julialang.org/t/its-all-set-lazysets-errors-showing-types-and-set-tolerance-not-defined/85994/3 "2022-08-19T13:29:55Z")

</div>

For the second issue, `set_tolerance` seems to have been moved into a separate package, so that line should be changed to:

```julia
LazySets.Comparison.set_tolerance(Float64)

```

---

<div class="post-metadata">

### Author: ![mforets](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mforets/32/298_2.png) [@mforets](https://discourse.julialang.org/u/mforets)
#### Post date: [November 25, 2022, 1:59pm UTC](https://discourse.julialang.org/t/its-all-set-lazysets-errors-showing-types-and-set-tolerance-not-defined/85994/4 "2022-11-25T13:59:48Z")

</div>

> `set_tolerance` seems to have been moved into a separate package, so that line should be changed to:

It has been outsourced to the package `ReachabilityBase.jl`.

For the first question, note that you can always do:

```julia
julia> using AbstractTrees

julia> AbstractTrees.children(T::Type{<:LazySet}) = subtypes(T)

julia> print_tree(LazySet)
LazySet
├─ AbstractAffineMap
│ ├─ AffineMap
│ ├─ ExponentialMap
│ ├─ ExponentialProjectionMap
│ ├─ InverseLinearMap
....
├─ QuadraticMap
├─ Rectification
├─ UnionSet
└─ UnionSetArray

```

Pass `maxdepth=8` to `print_tree` to avoid truncation of the displayed tree.
