Skip to content

feat: constraint-kind trait family and path-constraint/multiplier carriers#484

Merged
ocots merged 1 commit into
mainfrom
feat/path-constraint-carriers
Jul 9, 2026
Merged

feat: constraint-kind trait family and path-constraint/multiplier carriers#484
ocots merged 1 commit into
mainfrom
feat/path-constraint-carriers

Conversation

@ocots

@ocots ocots commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Introduces trait family for constraint kinds and generic carriers for path constraints and multipliers, laying groundwork for constrained optimal control flows.

  • AbstractConstraintKind trait family (Traits/constraint_kind.jl): StateConstraintKind, ControlConstraintKind, MixedConstraintKind with constraint_kind() accessor and predicates
  • PathConstraint{F,K,TD,VD} type (Data/path_constraint.jl): carriers for path-constraint functions with constraint kind, time/variable dependence. Natural call signatures per kind (g(x), g(u), g(x,u)) and uniform g(t,x,u,v). User-facing constructors: StateConstraint(), ControlConstraint(), MixedConstraint().
  • Multiplier{F,TD,VD} type (Data/multiplier.jl): carriers for Lagrange multipliers with time/variable dependence. Call signature μ(t,x,p,v) and natural forms.
  • Display helpers for show support in helpers.jl
  • No breaking changes; existing code unaffected

Design reference

See .reports/constraints-and-duals-design.md section B1 (CTBase phase).

Test plan

  • ✅ Full CTBase test suite: 4579/4579 passing (Aqua ambiguity/piracy checks included)
  • ✅ New trait test: test_constraint_kind.jl (34 tests)
  • ✅ New data tests: test_abstract_path_constraint.jl, test_path_constraint.jl, test_abstract_multiplier.jl, test_multiplier.jl (98 tests total)
  • ✅ Updated test_data_module.jl export/private symbol lists

Version bumped to 0.27.3-beta.

🤖 Generated with Claude Code

…riers

- Add AbstractConstraintKind trait family (Traits/constraint_kind.jl):
  StateConstraintKind, ControlConstraintKind, MixedConstraintKind
- Add constraint_kind() accessor and predicates (is_state/control/mixed_constraint)
- Wire into Traits.jl (includes, exports, module docstring)
- Add AbstractPathConstraint{K,TD,VD} abstract type (Data/abstract_path_constraint.jl)
- Add PathConstraint{F,K,TD,VD} concrete type with natural/uniform call signatures
- User-facing constructors: StateConstraint(), ControlConstraint(), MixedConstraint()
- Add AbstractMultiplier{TD,VD} abstract type (Data/abstract_multiplier.jl)
- Add Multiplier{F,TD,VD} concrete type with natural/uniform call signatures
- Add display helpers in Data/helpers.jl (_kind_label, _natural_sig_pc, _uniform_sig_pc,
  _natural_sig_mult, _uniform_sig_mult)
- Wire into Data.jl (includes, exports)
- Update test_data_module.jl export/private symbol lists
- Add 5 new test files: test_constraint_kind.jl, test_abstract_path_constraint.jl,
  test_path_constraint.jl, test_abstract_multiplier.jl, test_multiplier.jl
- Full CTBase test suite: 4579/4579 passing (Aqua included)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ocots
ocots merged commit 6ec0610 into main Jul 9, 2026
6 checks passed
@ocots
ocots deleted the feat/path-constraint-carriers branch July 9, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant