Optim
This folder contains all the different (abstraction-based or not) solvers that can be used. Note that all the solvers are defined using the MathOptInterface framework as a subtype of AbstractOptimizer by implementig the optimize! function.
Abstraction-based solvers
Uniform grid abstraction solver
Dionysos.Optim.Abstraction.UniformGridAbstraction.Optimizer — Type
Optimizer{T} <: MOI.AbstractOptimizerA high-level abstraction-based solver that automatically orchestrates system abstraction and control synthesis. This wrapper follows the classical abstraction pipeline (e.g., as in SCOTS), where the state and input spaces are discretized into hyper-rectangular cells, independent of the specific control task.
It delegates responsibility to modular sub-solvers: one for abstraction and one for control, depending on the type of problem to be solved.
Structure and Sub-solvers
The optimizer internally manages two sub-solvers:
abstraction_solver:OptimizerEmptyProblem: Used to compute the symbolic abstraction of the system from its dynamics and domain.control_solver: One of the following control-specific optimizers, depending on the problem type:
Behavior
The user sets the control task via:
MOI.set(optimizer, MOI.RawOptimizerAttribute("concrete_problem"), my_problem)wheremy_problemis a subtype ofProblemType.The optimizer automatically dispatches to the appropriate control solver based on the problem type.
If the abstraction has not yet been computed, it is automatically built before solving the control problem.
Once computed, the abstraction is cached — switching the control problem (e.g., from safety to reachability) does not recompute it.
The field
solve_time_sectracks the runtime of the last call toMOI.optimize!.The resulting controller and value function are stored and can be queried from the wrapper.
User-settable and access to subsolver fields
Via MOI.set(...), the user may configure abstraction_solver and control_solver parameters. Any field accessible in the sub-solvers (abstraction or control) can be transparently accessed via:
MOI.set(optimizer, MOI.RawOptimizerAttribute("state_grid"), grid)
MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_value_function"))Example
using Dionysos, JuMP
optimizer = MOI.instantiate(Dionysos.Optim.UniformGridAbstraction.Optimizer)
MOI.set(optimizer, MOI.RawOptimizerAttribute("concrete_problem"), my_problem)
MOI.set(optimizer, MOI.RawOptimizerAttribute("state_grid"), state_grid)
MOI.set(optimizer, MOI.RawOptimizerAttribute("input_grid"), input_grid)
MOI.set(optimizer, MOI.RawOptimizerAttribute("time_step"), 0.1)
MOI.set(optimizer, MOI.RawOptimizerAttribute("print_level"), 2)
MOI.optimize!(optimizer)
time = MOI.get(optimizer, MOI.RawOptimizerAttribute("solve_time_sec"))
value_fun = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_value_function"))
controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("concrete_controller"))Dionysos.Optim.Abstraction.UniformGridAbstraction.OptimizerEmptyProblem — Type
OptimizerEmptyProblem{T} <: MOI.AbstractOptimizerA solver responsible for constructing a symbolic abstraction of the system dynamics, independently of any control specification.
This optimizer wraps everything needed to solve an EmptyProblem, which is used to generate a symbolic model (abstraction) of either a continuous- or discrete-time system.
The optimizer supports several abstraction modes, optional implicit mappings/state sets, periodic mappings, multithreaded computation, and distributed partition-based abstraction.
Purpose
This optimizer builds a symbolic abstraction by discretizing the state and input spaces, constructing a state/input mapping, defining a source-state domain, and computing the abstract transition relation from a system approximation.
The abstraction method is selected via the approx_mode field. Depending on the chosen mode, the optimizer constructs either an over-approximation, an under-approximation, or a simulation-based abstraction.
The resulting abstract model can then be reused by higher-level control solvers (safety, reachability, co-safe LTL, etc.).
Abstraction semantics
The constructed symbolic model distinguishes between:
XMapping: global mapping from concrete states to abstract states.Xset: set of source states that are enumerated when building transitions.Rset: set of retained / allowed states that may appear as transition targets.UMapping: mapping from concrete inputs to abstract inputs.Uset: admissible abstract-input set.
In the standard non-distributed setting, Xset usually coincides with Rset. In distributed mode, the abstraction may be computed on local partitions of Xset, while retaining a common global Rset.
Parameters
Mandatory fields set by the user
empty_problem(required): An instance ofEmptyProblemcontaining the system to abstract and the target abstraction region.State discretization (required):
- either
state_grid - or
h, from which the state grid is built internally.
- either
input_grid(required, unlessUMappingis set directly): The discretization grid for the input space.
Optional mapping / set fields
abstraction_region(optional): Concrete region used to define the abstraction domain. If not provided, the optimizer uses:empty_problem.region, if available,- otherwise
empty_problem.system.X.
incl_mode(optional, default =MP.INNER): Inclusion mode used when constructing mappings or state sets.XMapping(optional): Pre-built abstract-state mapping. If not provided, it is constructed from the state grid.Xset(optional): Source abstract-state set. If not provided, it is built fromabstraction_region.Rset(optional): Retained / allowed target-state set. If not provided, it defaults tocopy(Xset).UMapping(optional): Pre-built abstract-input mapping.Uset(optional): Abstract-input set. If not provided, a default admissible set is built.
Grid / implicit representation settings
state_grid(optional): Explicit state grid used for discretization.h(optional): Grid spacing vector used to construct the state grid ifstate_gridis not provided.use_implicit_mapping(optional, default =false): Iftrue, constructs an implicit state mapping instead of an explicit one.mapping_region(required ifuse_implicit_mapping = true): Hyper-rectangle used as ambient region for the implicit mapping. It must encloseabstraction_region.use_implicit_stateset(optional, default =false): Iftrue, buildsXsetas an implicit state set rather than an explicit set of indices.
Periodic mapping settings
use_periodic_mapping(optional, default =false): Iftrue, wraps the state mapping as a periodic mapping.
When enabled, the following fields are required:
periodic_dims: indices of periodic dimensions.periodic_periods: period length for each periodic dimension.periodic_start(optional): start point for each periodic dimension. Defaults to zero if not provided.
System approximation settings
approx_mode(optional, default =GROWTH): Abstraction technique used to build the system approximation. Supported modes:USER_DEFINED: Use a custom over-approximation map. Setoverapproximation_map.GROWTH: Use growth-bound based approximation. Setjacobian_bound, or directlygrowthbound_map.ngrowthboundcontrols the internal growth-bound discretization parameter.LINEARIZED: Use linearization and derivative bounds. SetDF_sys,bound_DF, andbound_DDF.CENTER_SIMULATION: Simulate the center of each abstract cell only.RANDOM_SIMULATION: Simulate randomly sampled points in each abstract cell. Setn_samples.
efficient(optional, default =true): Whether to use the optimized approximation-specific abstraction kernel when available.
Continuous-time settings
time_step(required for continuous-time systems): Sampling step used to discretize a continuous-time approximation.nsystem(optional, default =5): Number of internal substeps used during continuous-time simulation/discretization routines.
Execution settings
threaded(optional, default =false): Iftrue, enables multithreaded abstraction on a single Julia process.distributed(optional, default =false): Iftrue, enables partition-based distributed abstraction across Julia worker processes.distributed_procs(optional): Vector of Julia worker IDs used for distributed abstraction. Ifnothing, all available workers returned byDistributed.workers()are used.distributed_nparts(optional): Number of source-state partitions used in distributed abstraction. Ifnothing, defaults to the number of selected worker processes.distributed_partition_strategy(optional, default =:roundrobin): Strategy used to partition the source-state setXset. Typical choices include:roundrobinand:contiguous.
In distributed mode, each partition receives:
- the same global
XMapping, - the same global
Rset, - a local subset of
Xset,
and computes transitions for its own source states. The final abstract transition relation is obtained by merging all locally computed transitions.
Logging / progress settings
print_level(optional, default =1): Verbosity level:0: silent1: summary information2: detailed progress output
progress_update_interval(optional, default =Int(1e5)): Number of source-state/input pairs processed between progress updates.progress_dt(optional, default =0.2): Minimum wall-clock time between progress refreshes in threaded mode.
Internally computed fields (after MOI.optimize!)
abstract_system: The resulting symbolic abstraction, of typeSymbolicModelList.discrete_time_system: Internally constructed discrete-time system used to generate the abstraction.abstraction_construction_time_sec: Total abstraction-construction time in seconds.
Approximation objects derived from approx_mode
continuous_time_system_approximation: AContinuousTimeSystemApproximation, built automatically if the original system is continuous.discrete_time_system_approximation: ADiscreteTimeSystemApproximation, used by the abstraction kernel in all cases.
Typical workflow
- Define the concrete empty problem and discretization parameters.
- Build or infer the state/input mappings and state sets.
- Construct the system approximation from
approx_mode. - Compute the abstract transition relation, either:
- sequentially,
- multithreaded,
- or distributed across source-state partitions.
- Store the resulting symbolic abstraction in
abstract_system.
Example
using Dionysos, JuMP
optimizer = MOI.instantiate(Dionysos.Optim.OptimizerEmptyProblem.Optimizer)
MOI.set(optimizer, MOI.RawOptimizerAttribute("empty_problem"), my_problem)
MOI.set(optimizer, MOI.RawOptimizerAttribute("state_grid"), state_grid)
MOI.set(optimizer, MOI.RawOptimizerAttribute("input_grid"), input_grid)
MOI.set(optimizer, MOI.RawOptimizerAttribute("time_step"), 0.1)
MOI.set(optimizer, MOI.RawOptimizerAttribute("print_level"), 2)
MOI.set(optimizer, MOI.RawOptimizerAttribute("approx_mode"), GROWTH)
MOI.set(optimizer, MOI.RawOptimizerAttribute("jacobian_bound"), my_jacobian_bound)
MOI.optimize!(optimizer)
time = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstraction_construction_time_sec"))
abstract_system = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_system"))
discrete_time_system = MOI.get(optimizer, MOI.RawOptimizerAttribute("discrete_time_system"))Dionysos.Optim.Abstraction.UniformGridAbstraction.OptimizerOptimalControlProblem — Type
OptimizerOptimalControlProblem{T} <: MOI.AbstractOptimizerAn optimizer that solves reachability or reach-avoid optimal control problems using symbolic abstractions of the system.
This solver takes as input a concrete problem (typically an instance of OptimalControlProblem) and a symbolic abstraction of the system (i.e., an abstract_system). It then solves the abstract version of the control problem.
Key Behavior
- Lifts the concrete problem to the symbolic abstraction space (
abstract_system) and constructs the correspondingabstract_problem. - Computes the
controllable_set— the largest set of abstract states from which reachability can be guaranteed. - Synthesizes an
abstract_controllerthat brings the system to the target set under worst-case dynamics. - Computes the
abstract_value_functionthat maps each state (cell) to the worst-case number of steps needed to reach the target. - The solver is successful if the field
successistrueafterMOI.optimize!.
Parameters
Mandatory fields set by the user
concrete_problem(required): An instance ofOptimalControlProblemthat defines the reach-avoid task (system, initial set, target, costs, horizon).abstract_system(required): The symbolic abstraction of the system, usually obtained from an abstraction optimizer such asOptimizerEmptyProblem.
Optional user-tunable parameters
early_stop(optional, default =false): Iftrue, the fixpoint algorithm stops early when the initial set is fully contained in the controllable set. Iffalse, it computes the entire maximal controllable set.sparse_input(optional, default =false): Iftrue, uses a sparse representation of the transition table, reducing memory usage when the number of inputs is large but only few are admissible per state (e.g., indeterminized abstractions, withnew_input = (input, target)).print_level(optional, default =1): Controls verbosity:0: silent1: default2: detailed logging
Internally computed fields
These fields are generated automatically during MOI.optimize!.
abstract_problem: The lifted version of the concrete problem over the abstract system.abstract_problem_time_sec: Time taken to solve the abstract problem.abstract_controller: A controller mapping abstract states to control inputs.controllable_set: Set of abstract states from which the target is reachable.uncontrollable_set: Complementary states with no admissible reachability strategy.value_fun_tab: Tabular value function over abstract states (e.g., cost-to-go or step count).abstract_value_function: Functional form of the abstract value function.concrete_value_function: Functional form of the value function mapped back to the original system.success: Boolean flag indicating whether the solver completed successfully.
Example
using Dionysos, JuMP
optimizer = MOI.instantiate(Dionysos.Optim.OptimizerOptimalControlProblem.Optimizer)
MOI.set(optimizer, MOI.RawOptimizerAttribute("concrete_problem"), my_problem)
MOI.set(optimizer, MOI.RawOptimizerAttribute("abstract_system"), abstract_system)
MOI.set(optimizer, MOI.RawOptimizerAttribute("print_level"), 2)
MOI.optimize!(optimizer)
time = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_problem_time_sec"))
controllable_set = MOI.get(optimizer, MOI.RawOptimizerAttribute("controllable_set"))
abstract_value_function = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_value_function"))
concrete_value_function = MOI.get(optimizer, MOI.RawOptimizerAttribute("concrete_value_function"))
concrete_controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("concrete_controller"))Dionysos.Optim.Abstraction.UniformGridAbstraction.OptimizerSafetyProblem — Type
OptimizerSafetyProblem{T} <: MOI.AbstractOptimizerAn optimizer for solving safety control problems over symbolic system abstractions.
This solver takes as input a SafetyProblem and a symbolic abstraction of the system (e.g., a SymbolicModelList), and computes a controller that ensures the system remains within a safe set over a time horizon or indefinitely.
Key Behavior
- Lifts the concrete safety problem to the abstract domain and builds an
abstract_problem. - Computes the invariant set, i.e., the largest set of abstract states from which all trajectories can be safely controlled.
- Synthesizes an
abstract_controllerthat guarantees safety under worst-case transitions. - The optimization is successful if
success == trueafter callingMOI.optimize!.
Parameters
Mandatory fields set by the user
concrete_problem(required): An instance ofSafetyProblemthat specifies the system, initial set, safe set, and horizon.abstract_system(required): A symbolic abstraction of the system, e.g., obtained fromOptimizerEmptyProblem.
Optional user-tunable parameters
print_level(optional, default =1): Controls verbosity:0: silent1: default (info)2: verbose debug output
Internally computed fields
These fields are automatically filled in by MOI.optimize!.
abstract_problem: The lifted version of the safety problem in the symbolic domain.abstract_problem_time_sec: Time taken to solve the safety problem over the abstract system.abstract_controller: A controller mapping abstract states to admissible inputs that keep the system safe.invariant_set: The largest subset of abstract states from which safety can be maintained.invariant_set_complement: States from which safety cannot be guaranteed.success: Boolean flag indicating whether a valid invariant set and controller were found.
Example
using Dionysos,
optimizer = MOI.instantiate(Dionysos.Optim.OptimizerSafetyProblem.Optimizer)
MOI.set(optimizer, MOI.RawOptimizerAttribute("concrete_problem"), my_problem)
MOI.set(optimizer, MOI.RawOptimizerAttribute("abstract_system"), abstract_system)
MOI.set(optimizer, MOI.RawOptimizerAttribute("print_level"), 2)
MOI.optimize!(optimizer)
time = MOI.get(optimizer, MOI.RawOptimizerAttribute("abstract_problem_time_sec"))
invariant_set = MOI.get(optimizer, MOI.RawOptimizerAttribute("invariant_set"))
abstract_controller = MOI.get(optimizer, MOI.RawOptimizerAttribute("concrete_controller"))Dionysos.Optim.Abstraction.UniformGridAbstraction.OptimizerCoSafeLTLProblem — Type
OptimizerCoSafeLTLProblem{T} <: MOI.AbstractOptimizerAbstraction-based solver for co-safe LTL control problems.
This optimizer:
- lifts a concrete
CoSafeLTLProblemto an abstract automaton problem, - calls the generic automaton-level co-safe LTL optimizer in
SY, - stores the resulting abstract controller and solve status.
Dionysos.Optim.Abstraction.UniformGridAbstraction.make_out_of_domain_handler — Function
makeoutofdomainhandler(; mode=0, warn=true, dims=nothing)
mode = 0: return nothing when x is not allowed (or outside mapping) mode = 1: project to nearest allowed abstract state (using mapping coords)
Uniform ellipsoid abstraction solver
Hybrid system abstraction solver
PCLF Bisimulation Quotient solver
Dionysos.Optim.Abstraction.PCLFBisimulationQuotient.gamma_cover_set — Function
gamma_cover_set(piece::PCLF.PolyhedralPiece, X::LazySets.Hyperrectangle)Return the smallest τ such that
X ⊆ P_piece(τ)for
P_piece(τ) = {x : -τ w <= Gx <= τ w}.Dionysos.Optim.Abstraction.PCLFBisimulationQuotient._support_abs_row_on_hyperrectangle — Function
_support_abs_row_on_hyperrectangle(g, X)Compute
max_{x ∈ X} |g' x|for a hyperrectangle X.
Other abstraction-based solvers
Dionysos.Optim.Abstraction.LazyEllipsoidsAbstraction.Optimizer — Type
Optimizer{T} <: MOI.AbstractOptimizerAbstraction-based solver using a lazy abstraction method with ellipsoidal cells (RRT-based).
Other solvers
Dionysos.Optim.BemporadMorari.Optimizer — Type
Optimizer{T} <: MOI.AbstractOptimizerBemporad Morari solver: Optimal control of hybrid systems via a predictive control scheme using mixed integer quadratic programming (MIQP) online optimization procedures.
Dionysos.Optim.BranchAndBound.Optimizer — Type
Optimizer{T} <: MOI.AbstractOptimizerBranch and bound solver: Optimal control of hybrid systems via a predictive control scheme combining a branch and bound algorithm that can refine Q-functions using Lagrangian duality.