# MathOptInterface Documentation

**URL:** <https://discourse.julialang.org/t/mathoptinterface-documentation/93544>\
**Category:** Optimization (Mathematical)\
**Created:** [January 25, 2023, 11:57pm UTC](https://discourse.julialang.org/t/mathoptinterface-documentation/93544 "2023-01-25T23:57:04Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [January 26, 2023, 12:44am UTC](https://discourse.julialang.org/t/mathoptinterface-documentation/93544/8 "2023-01-26T00:44:04Z")

</div>

For example,

```julia
julia> using JuMP, HiGHS

julia> model = Model(HiGHS.Optimizer);

julia> set_silent(model)

julia> @variable(model, 0 <= x[1:3] <= 3, Int)
3-element Vector{VariableRef}:
 x[1]
 x[2]
 x[3]

julia> @variable(model, 1 <= n <= 3, Int)
n

julia> @constraint(model, [n; x] in MOI.CountDistinct(4))
[n, x[1], x[2], x[3]] ∈ MathOptInterface.CountDistinct(4)

julia> optimize!(model)

julia> value(n), value.(x)
(2.0, [1.0, 0.0, 0.0])

```

---

_[View the full topic](https://discourse.julialang.org/t/mathoptinterface-documentation/93544)._
