Template reference
A template is a SetProg family. The constructors below build the families that Choosing a template presents, and a SetProg family can also be passed directly. What works with what says which problems each supports.
Constructors
PathCompleteCertificates.QuadraticFunction — Type
QuadraticFunction(P)The quadratic form $V(x) = x^\top P x$, a fitted node function of optimal control. Matrix(V) is $P$. Stability and safety return native SetProg sets instead: see QuadraticTemplate.
PathCompleteCertificates.QuadraticTemplate — Method
QuadraticTemplate()The quadratic forms $V(x) = x^\top P x$, as the SetProg family Ellipsoid(symmetric = true). It applies to every system and every problem, and gives semidefinite programs.
For stability, a fitted node function V is a SetProg ellipsoid: evaluate it with node_value, and read $P$ as V.Q. The conditioning_bound keyword of certify bounds $P$ between $I$ and conditioning_bound times $I$. Safety returns one SetProg shifted ellipsoid per node, for the barrier $[x; 1]^\top P [x; 1]$, and optimal control a QuadraticFunction per node. See Choosing a template.
PathCompleteCertificates.PiecewiseQuadraticTemplate — Method
PiecewiseQuadraticTemplate(node_partitions)The functions quadratic on each cone over the facets of a polytope, as one SetProg ellipsoid per node, piecewise on the polytope of that node in node_partitions. Each polytope must contain the origin in its interior, and planar_conic_partition builds one in the plane. It applies to every system, for stability, safety, and optimal control with fixed gains, gives semidefinite programs, and needs import SumOfSquares, with which SetProg makes the pieces agree on the boundaries of the cones. refine does not run on this template: its edge slacks are not implemented. See Choosing a template.
PathCompleteCertificates.SumOfSquaresTemplate — Method
SumOfSquaresTemplate(degree; min_scale = 1, convex = false)The sums of squares $V(x) = \sum_j q_j(x)^2$, each $q_j$ a homogeneous polynomial of degree degree, so that $V$ has degree 2degree, as a normalized SetProg PolySet family. degree = 1 gives the quadratic forms. It applies to every system, for stability, safety and optimal control, gives semidefinite programs, and needs import SumOfSquares. Polynomial coordinates are created automatically from the system dimension.
Each node function is min_scale * sum(x .^ 2)^degree plus a sum of squares, which excludes $V \equiv 0$. convex = true also makes each node function convex, which optimal control requires, with a cost of degree p = 2degree. refine does not run on this template: its edge slacks are not implemented. See Choosing a template.
PathCompleteCertificates.PiecewiseLinearTemplate — Method
PiecewiseLinearTemplate(node_partitions; min_scale = 1)The polyhedral functions linear on each cone over the facets of a polytope, as one SetProg polytope per node, with the polytope of each node in node_partitions. Each polytope must contain the origin in its interior, and planar_conic_partition builds one in the plane. It applies to every system. Stability gives linear programs, safety, with an ellipsoidal $X_0$ and an $X_u$ outside an ellipsoid, second-order cone programs, and optimal control with fixed gains a linear program for p = 1 and a second-order cone program for p = 2. min_scale normalizes the stability node functions: each is at least min_scale times the function equal to one on the boundary of its polytope. Its dual is DualPiecewiseLinearTemplate.
PathCompleteCertificates.planar_conic_partition — Method
planar_conic_partition(order; library = nothing)A partition of the plane for PiecewiseLinearTemplate and DualPiecewiseLinearTemplate: a centrally symmetric polygon with 8 * 2^(order - 1) facets. The cones over its facets lie between the rays of $(1, 0)$, $(1, 1)$, $(0, 1)$, $(-1, 1)$ and their opposites, each split in two at every further order by the sum of its two rays. library gives a Polyhedra library, with a linear programming solver.
PathCompleteCertificates.DualPiecewiseLinearTemplate — Method
DualPiecewiseLinearTemplate(node_partitions; min_weight = 1)
DualPiecewiseLinearTemplate(matrices; min_weight = 1)
DualPiecewiseLinearTemplate(n_nodes, dimension; min_weight = 1)The duals of the functions of PiecewiseLinearTemplate: at each node, the gauge of the polar of a set linear on each cone over the facets of the polytope in node_partitions. It is dual(PiecewiseLinearTemplate(node_partitions; min_scale = min_weight)), and min_weight normalizes the node functions through that polar.
With one invertible matrix $G$ per node in matrices, the polytope has the rows of $G$ and their opposites as vertices, and the node functions are $V(x) = \max_k |(G x)_k| / w_k$, whose faces come in parallel pairs, normal to the rows of $G$, with every weight $w_k$ at least min_weight. (n_nodes, dimension) takes the identity at each of n_nodes nodes, which gives boxes.
It applies to every system. Stability gives linear programs, and safety, with an ellipsoidal $X_0$ and an $X_u$ outside an ellipsoid, second-order cone programs.
PathCompleteCertificates.LinearCopositiveFunction — Method
LinearCopositiveFunction(c)The function $V(x) = c^\top x$ on the nonnegative orthant, a node function of LinearCopositiveTemplate, as a SetProg set. Evaluate it with node_value.
PathCompleteCertificates.LinearCopositiveTemplate — Method
LinearCopositiveTemplate()The linear functions $V(x) = c^\top x$ on the nonnegative orthant, as a SetProg polytope on that orthant. It applies to positive systems, whose matrices have nonnegative entries, for stability, and gives linear programs. Its dual is DualCopositiveTemplate. See Choosing a template.
PathCompleteCertificates.DualCopositiveFunction — Method
DualCopositiveFunction(v)The function $V(x) = \max_i x_i / v_i$ on the nonnegative orthant, a node function of DualCopositiveTemplate, as a SetProg set. Evaluate it with node_value.
PathCompleteCertificates.DualCopositiveTemplate — Method
DualCopositiveTemplate(; min_weight = 1)The functions $V(x) = \max_i x_i / v_i$ on the nonnegative orthant, the duals of those of LinearCopositiveTemplate, as a SetProg polytope on that orthant. It applies to positive systems, for stability, and gives linear programs. min_weight normalizes the node functions: every weight $v_i$ is at least min_weight.
The template interface
What a template provides to a problem: the primitives that build its node functions and edge inequalities, and what the package needs to know about it. Extending the package says which to implement for a new family.
PathCompleteCertificates.add_decrease! — Function
add_decrease!(model, template, V_src, V_dst, map; scale = 1)The decrease condition of an edge: V_dst after map is at most scale times V_src. Constrain, for every $x$, $\text{scale} \cdot V_{src}(x) \ge V_{dst}(\text{map} \cdot x)$, as a set inclusion for a SetProg family.
PathCompleteCertificates.add_function_variables! — Function
add_function_variables!(model, template, dimension, node)Add the variables of the node function at node, with the constraints that make it a member of the template, and return the function.
PathCompleteCertificates.add_normalization! — Function
add_normalization!(model, template, V; conditioning_bound = Inf)Constrain V to be positive away from the origin, at a fixed scale, which excludes the trivial function V ≡ 0: its set contains, or lies in, a fixed reference set. For an ellipsoid, a finite conditioning_bound also bounds its matrix by conditioning_bound * I.
PathCompleteCertificates.decrease_slack — Function
decrease_slack(template, V_src, V_dst, map; scale = 1)The slack of the decrease condition scale · V_src(x) ≥ V_dst(map · x) for fitted node functions: nonnegative when it holds, zero exactly when it is tight. It is in the units of the fitted functions, so compare slacks within one certificate only. Not implemented for polynomial and piecewise-quadratic families, whose slacks would need an optimization of their own.
PathCompleteCertificates.has_dual — Function
has_dual(template) -> BoolWhether dual(template) and dual(template, V) are defined, false by default.
PathCompleteCertificates.homogeneity_degree — Function
homogeneity_degree(template) -> IntThe degree $\delta$ such that $V(c x) = c^\delta V(x)$ for every function of the template and every $c > 0$.
PathCompleteCertificates.is_applicable — Function
is_applicable(template, system) -> BoolWhether template applies to the dynamics of system, true by default. The copositive templates apply to positive systems only. A problem refuses a template that does not apply, and no lift is valid for it.
PathCompleteCertificates.is_closed_under — Function
is_closed_under(template, operation, system) -> BoolWhether combining members of the template by operation gives a member, false by default. system matters only for Composition and InverseComposition.
PathCompleteCertificates.reindex — Function
reindex(template, origins)The template for a lifted graph whose nodes come from origins. A single template is unchanged. A vector, one template per node, follows origins, and throws if a node merges origins with different templates.
PathCompleteCertificates.solution_value — Function
solution_value(template, V)The node function V after optimize!, with values in place of variables: for a SetProg family, the fitted set.
SetProg families
The families of SetProg, which the constructors return and the problems accept directly.
SetProg.Domain — Type
Domain(set, domain)Restrict a set variable family to a fixed polyhedral domain, constructing a Sets.Intersection when the variable is instantiated. Accepts a Polyhedra representation or polyhedron, MOI.Nonnegatives(n), or MOI.Nonnegatives to infer the orthant dimension from the model. The domain restricts the gauge in the selected modeling space: dual modeling returns the polar of the restricted gauge. Supported constraints depend on the resulting intersection.