---
title: Disciplined Nonlinear Programming (DNLP)
url: https://www.emergentmind.com/topics/disciplined-nonlinear-programming-dnlp
type: topic
---

# Disciplined Nonlinear Programming (DNLP)

Searching arXiv for the DNLP paper and closely related background on DCP/CVXPY.
{"query": "\"Disciplined Nonlinear Programming\" arXiv", "max_results": 5}
{"query": "\"Disciplined Nonlinear Programming\"", "max_results": 10}
Disciplined nonlinear programming (DNLP) is a syntax for specifying nonlinear programming problems that is inspired by disciplined convex programming (DCP) and designed for general-purpose nonlinear programs [2606.02896]. It permits arbitrary smooth functions to be used freely while imposing composition rules on nonsmooth convex and concave atoms. Under these rules, any DNLP-compliant problem can be automatically canonicalized into a standard smooth nonlinear programming (NLP) form, with no loss in optimal value or optimal solutions. The resulting formulation is intended to balance the unrestricted “black-box” style associated with systems such as AMPL, Pyomo, and JuMP against the certified structure of DCP, while extending NLP modeling to include useful nondifferentiable convex and concave functions [2606.02896].

## 1. Position within optimization modeling

DNLP extends the DCP idea of a grammar and atom library to the nonlinear, possibly nonconvex setting [2606.02896]. In DCP, the atom library is organized around affine, convex, and concave atoms, and composition rules certify convexity of the full problem. In DNLP, affine atoms are replaced by the broader class of smooth atoms, defined as functions that are twice continuously differentiable in the interior of their domain, while collections of nonsmooth convex and nonsmooth concave atoms are retained. The central requirement is that these nonsmooth atoms be used only in compositions that admit a lossless epigraph or hypograph relaxation.

This yields a precise distinction between DNLP and both unrestricted nonlinear modeling and classical DCP. In DCP, all nonlinearities must fit a convex or concave certificate. In DNLP, arbitrary nonconvex smooth atoms are admissible, but nonsmooth convex and concave atoms remain disciplined. In both frameworks, nonsmooth convex atoms are handled through epigraph variables and constraints, and nonsmooth concave atoms through hypograph variables and constraints.

A concise characterization is given in the paper: a problem is DNLP-compliant if, after replacing every smooth atom by its first-order Taylor approximation, that linearized problem conforms to DCP [2606.02896]. This statement makes explicit that DNLP preserves the compositional discipline of DCP while enlarging the admissible smooth component to cover general nonlinear structure.

## 2. Atom classes and expression grammar

DNLP partitions its atom library into three disjoint classes: smooth atoms $\phi \in A_{\text{smooth}}$, nonsmooth-convex atoms $\phi \in A_{\text{NS-convex}}$, and nonsmooth-concave atoms $\phi \in A_{\text{NS-concave}}$ [2606.02896]. Each atom has known curvature, sign, and monotonicity in each argument. Expressions are formed recursively as
$$
E ::= \phi(E_1,\ldots,E_k),
$$
where $\phi$ is an atom of arity $k$ and the $E_i$ are sub-expressions, variables, or constants.

The grammar then classifies expressions into three categories. An expression is smooth if its root atom is smooth and all of its arguments are smooth. An expression is L-convex if its root atom belongs to $A_{\text{smooth}} \cup A_{\text{NS-convex}}$ and, for each argument, exactly one of the following holds: the argument is smooth; the argument is L-convex and the atom is nondecreasing in that argument; or the argument is L-concave and the atom is nonincreasing in that argument. L-concavity is defined symmetrically: the root atom belongs to $A_{\text{smooth}} \cup A_{\text{NS-concave}}$, and each argument is either smooth, or L-convex under a nonincreasing dependence, or L-concave under a nondecreasing dependence [2606.02896].

Two corollaries organize a large share of the resulting syntax. Every smooth expression is both L-convex and L-concave, and sums of L-convex expressions remain L-convex, while sums of L-concave expressions remain L-concave. These closure properties are the basis for building large DNLP models from smaller certified components.

## 3. Objectives, constraints, and compliance

A DNLP problem must satisfy specific objective and constraint forms [2606.02896]. The objective must be either a minimization of an L-convex expression or a maximization of an L-concave expression. Equality constraints must have the form $E_1 = E_2$ with both sides smooth. Inequality constraints must be either
$$
E_1 \le E_2
$$
with $E_1$ L-convex and $E_2$ L-concave, or
$$
E_1 \ge E_2
$$
with $E_1$ L-concave and $E_2$ L-convex. No other forms are permitted.

This rule system parallels the DCP principle that “convex $\le$ convex” is invalid while “convex $\le$ concave” is acceptable. The significance in DNLP is not convexity certification of the overall optimization problem, but certification that the nonsmooth structure can be rewritten losslessly into smooth NLP form. A plausible implication is that DNLP should be understood less as a nonconvexity-reducing formalism than as a syntax for safe reformulation.

Compliance is checked structurally. Expression trees are parsed and labeled in a bottom-up pass as smooth, L-convex, or L-concave according to the grammar. If any node violates the rules, the problem is rejected as non-DNLP [2606.02896]. This is a syntactic acceptance criterion rather than a semantic proof of global tractability.

## 4. Canonicalization into standard smooth NLP

The canonicalization target is the standard smooth NLP form
$$
\text{minimize } f(z) \quad \text{subject to } c(z)=0,\quad \ell \le z \le u,
$$
where $f$ and $c$ are smooth [2606.02896]. The rewriting is performed in two passes over the expression trees.

The first pass is bottom-up classification. Each node is assigned its status as smooth, L-convex, or L-concave. The second pass is top-down rewriting. For a smooth atom with restricted domain $D \ne \mathbb{R}^k$, an auxiliary variable is introduced for its argument together with constraints enforcing membership in $D$ and equality to the original argument expression. This moves domain restrictions into simple bound constraints at the solver level. For a nonsmooth-convex atom $\phi(g(x))$, the atom is replaced by an auxiliary variable $t$ together with the inequality $t \ge \phi(g(x))$. For a nonsmooth-concave atom, the replacement is $t \le \phi(g(x))$ [2606.02896].

The key theoretical statement is the lossless epigraph relaxation theorem. If $P$ is a DNLP-compliant problem and $P'$ is its relaxation obtained by replacing each nonsmooth-convex atom $\phi(g)$ by $t$ and $t \ge \phi(g)$, with the analogous construction for nonsmooth-concave atoms, then $P$ and $P'$ have the same optimal value and the same projection of the solution set onto the original variables [2606.02896]. The paper explains this by monotonicity: in a minimization problem, every nonsmooth-convex atom appears in a context that is nondecreasing in that atom, and analogously for maximization and hypograph relaxations.

Each epigraph or hypograph constraint is then rewritten into an equivalent smooth set of equalities and inequalities. The paper gives classical examples:
- $t \ge |x| \iff -t \le x \le t$.
- $t \ge \max(x,y) \iff x \le t,\; y \le t$.
- $t \ge \|x\|_1 \iff \exists v \ge |x| \text{ with } 1^T v \le t$, written as $-v \le x \le v,\; 1^T v \le t$.
- $t \ge \|x\|_2 \iff \text{quad\_over\_lin}(x,t) - t \le 0$.
- $t \le \min(x,y) \iff x \ge t,\; y \ge t$ [2606.02896].

After these rewritings, all remaining nonlinear structure is smooth, and only equality constraints and bound constraints remain. The paper states that from this point it is trivial to pass the model to off-the-shelf NLP solvers such as Ipopt, Knitro, Uno, and Copt.

## 5. Illustrative formulations and implementation in CVXPY

Two examples in the paper show the relation between DNLP syntax and canonical NLP form [2606.02896]. The first is the analytic center of a polyhedron:
$$
\text{minimize } -\sum_{i=1}^m \log(b_i - a_i^T x).
$$
Here $\log$ is a smooth, concave atom with domain $x>0$, and $b-Ax$ is smooth, so the objective is L-convex. The canonical form introduces $t \in \mathbb{R}^m$ and becomes
$$
\text{minimize } -\sum_{i=1}^m \log(t_i)
$$
subject to
$$
t = b-Ax,\qquad t \ge 0.
$$

The second example is $\ell_1$ regression:
$$
\text{minimize } \|Ax-b\|_1.
$$
Since $\|\cdot\|_1$ is nonsmooth-convex and its argument is smooth, the canonical form introduces $t \in \mathbb{R}^m$ and yields
$$
\text{minimize } 1^T t
$$
subject to
$$
-t \le Ax-b \le t.
$$
In both examples, the canonical model is a smooth NLP in standard form.

DNLP is implemented as a fully open-source extension to CVXPY [2606.02896]. When `prob.solve(nlp=True)` is called, CVXPY builds expression trees for the objective and constraints, classifies nodes via a post-order traversal, and then performs a pre-order rewrite pass. Smooth atoms with restricted domain are rewritten using auxiliary variables, bounds, and equality links; nonsmooth-convex atoms are rewritten with epigraph variables and inequalities; nonsmooth-concave atoms are rewritten with hypograph variables and inequalities. Each such constraint is then replaced by a smooth reformulation.

The implementation also includes a two-phase differentiation backend in C. In the symbolic preprocessing phase, the canonical problem is traversed to discover and cache the sparsity pattern of the Jacobian of $c(z)$ and the Hessian of the Lagrangian. In the numeric per-iteration phase, atom derivatives are evaluated at the current $(z,\lambda,\mu)$ and used to assemble the Jacobian and Hessian. The paper states that this yields efficient, sparse derivative oracles for Ipopt, Uno, Knitro, and Copt. Additional interface features include `prob.is_dnlp()` for compliance checking, `best_of=N` for random restarts within user-specified variable bounds, and parameter changes between solves without recompilation [2606.02896].

## 6. Advantages, limitations, and interpretive context

The paper identifies several practical advantages of DNLP [2606.02896]. One is simpler initialization: domain restrictions become simple bound constraints on auxiliary variables, so solvers need only a feasible point within these bounds and do not evaluate functions such as `log` or `sqrt` at infeasible points. The analytic-center example is used to illustrate that a polyhedron not containing the origin can still be handled automatically, whereas many modeling front-ends crash under default origin initialization. A second advantage is robust handling of nonsmooth atoms. Without DNLP, terms such as $\ell_1$ or Huber may remain in user code and be passed to automatic differentiation as black boxes, which often causes solver stagnation at nondifferentiable points. DNLP instead applies lossless relaxation followed by smooth reformulation. A third advantage is broader function support: all smooth atoms, including trigonometric, exponential, and Bessel functions, may appear in arbitrary nonconvex combinations, subject only to the DNLP rules, while nonsmooth convex and concave atoms enrich the language.

The same source emphasizes several limitations. DNLP provides no convergence guarantees beyond those of generic NLP and does not overcome nonconvexity; it reformulates user-specified nonconvexities in a disciplined way rather than resolving their algorithmic hardness. The grammar excludes some natural nonsmooth compositions, including expressions such as $\min(\max(\cdot),\cdot)$, so some problems must be manually reformulated or lie outside DNLP altogether. Canonicalization may increase problem size because of auxiliary variables, although the paper states that this trade-off is usually worthwhile for improved solver robustness. Performance also remains solver-dependent, and some canonical forms may be more efficient than others in particular solvers.

In this sense, DNLP occupies a specific methodological niche. It is neither an unrestricted algebraic modeling system nor a convexity-certifying framework in the DCP sense. Instead, it codifies a restricted but expressive syntax under which useful nondifferentiable convex and concave functions can be mixed with arbitrary smooth nonlinearities and then converted, without loss, into a solver-compatible smooth NLP. This suggests that its main contribution is structural mediation between high-level modeling and general-purpose NLP algorithms rather than a new solution method in the narrow algorithmic sense.

Source: https://www.emergentmind.com/topics/disciplined-nonlinear-programming-dnlp