# Access to automatic reformulations created internally by BilevelJump

**URL:** <https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268>\
**Category:** Optimization (Mathematical)\
**Tags:** jump, bilevel\
**Created:** [June 13, 2023, 6:11am UTC](https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268 "2023-06-13T06:11:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![martina.gherardi](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@martina.gherardi](https://discourse.julialang.org/u/martina.gherardi)\
**Post date:** [June 13, 2023, 6:11am UTC](https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268/1 "2023-06-13T06:11:43Z")

</div>

Hi,

I was wondering if there is a possibility to access the automatic reformulations that BilevelJump creates internally to solve the bilinear model. In particular, I would like to access (1) the dual of the lower level and (2) the strong duality constraint that Julia should create when using `mode=BilevelJuMP.StrongDualityMode()` . This can be useful for me to do some checks.

Thank you  
Martina

---

<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:** [June 13, 2023, 8:03am UTC](https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268/2 "2023-06-13T08:03:38Z")

</div>

You’d need to look at the source code of BilevelJuMP. I don’t think this is publicly accessible and documented, but @joaquimg might have some pointers.

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [June 21, 2023, 4:32am UTC](https://discourse.julialang.org/t/access-to-automatic-reformulations-created-internally-by-bileveljump/100268/3 "2023-06-21T04:32:43Z")

</div>

If you have a bilevel model such as:

```julia
model = BilevelModel(...)

```

you can pass keyword arguments while optimizing:

```julia
optimize!(
    model,
    lower_prob = "lower.lp",
    upper_prob = "upper.lp",
    bilevel_prob = "bilevel.lp",
)

```
