Dual feasibility constraints, kkt conditions

Hi everyone,

I’m quite new to Julia and was looking to automatically generate dual feasibility constraints, KKT conditions, strong duality constraints and add them to the initial primal problem for further steps. I have seen Dualization.jl and BilevelOptimization.jl and noticed they somehow generate these KKT conditions for solving their bilevel problems. I’m wondering if I can have access to these functions through either these packages or other ones. I actually went through these packages’ codes but couldn’t figure out how to extract the parts I want. Can anybody advise me on the path I’d better go through for that? Is hard coding these constraints the right approach?

Thank you in advance for any suggestions,