# Nonconvex JuMP model to DictModel cannot see constraints

**URL:** <https://discourse.julialang.org/t/nonconvex-jump-model-to-dictmodel-cannot-see-constraints/111485>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [March 11, 2024, 8:15pm UTC](https://discourse.julialang.org/t/nonconvex-jump-model-to-dictmodel-cannot-see-constraints/111485 "2024-03-11T20:15:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtapia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rtapia/32/207390_2.png) [@rtapia](https://discourse.julialang.org/u/rtapia)\
**Post date:** [March 11, 2024, 8:15pm UTC](https://discourse.julialang.org/t/nonconvex-jump-model-to-dictmodel-cannot-see-constraints/111485/1 "2024-03-11T20:15:57Z")

</div>

Hello,

Following the example from [DictModel definition · Nonconvex.jl](https://julianonconvex.github.io/Nonconvex.jl/stable/problem/dict_model/)

```julia
using JuMP, Nonconvex
jump_model = JuMP.Model()
@variable jump_model 0 <= x[i=1:3] <= 1
@constraint jump_model sum(x) <= 1
model = DictModel(jump_model)

```

Should I be able to confirm the constraint using NonconvexCore.getnineqconstraints(model)? Because the output is zero.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/7/2745bb67f49cd2a0d85796f0a8282c686aebafe1.png)

Thanks

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [March 11, 2024, 11:28pm UTC](https://discourse.julialang.org/t/nonconvex-jump-model-to-dictmodel-cannot-see-constraints/111485/2 "2024-03-11T23:28:05Z")

</div>

This looks like a bug. The conversion from JuMP is tested [NonconvexCore.jl/test/jump.jl at master · JuliaNonconvex/NonconvexCore.jl · GitHub](https://github.com/JuliaNonconvex/NonconvexCore.jl/blob/master/test/jump.jl). I will need to look into the above example.

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [March 11, 2024, 11:40pm UTC](https://discourse.julialang.org/t/nonconvex-jump-model-to-dictmodel-cannot-see-constraints/111485/3 "2024-03-11T23:40:15Z")

</div>

> [@rtapia](#):
>
> `@constraint jump_model sum(x) <= 1`

Found the bug. For some reason, Nonconvex only supports named JuMP constraints! This is not intentional and I will try to fix it. But a workaround is:

```julia
@constraint jump_model c1 sum(x) <= 1

```
