@@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file.
77The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
88and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
99
10- ## [ 0.9.15] - 2026-04-18
10+ ## [ 0.9.15-beta ] - 2026-04-18
1111
1212### 🚀 Enhancements
1313
@@ -60,37 +60,43 @@ expr = expression(pre.definition) # Returns the Expr
6060model = build (pre) # Works even without definition
6161```
6262
63- #### Consistent Variable and Control Checking Functions
63+ #### User-Facing Model Predicates
6464
65- - ** New functions** : Added ` is_variable() ` and ` is_control_free() ` for checking problem properties
66- - ** Dual methods** : Both functions have methods for ` PreModel ` and ` Model ` types
67- - ** Consistent API** : These functions follow the same pattern as ` is_autonomous() `
68- - ** Runtime dimension checks** : Unlike time dependence (type-parameterized), variable and control use runtime dimension checks
69- - ** Display integration** : Updated display code to use the new functions instead of inline comparisons
65+ - ** New predicates** : Added user-friendly predicate methods for ` Model ` instances
66+ - ** Exclusive to Model** : Predicates are only available for immutable ` Model ` , not ` PreModel `
67+ - ** Consistent naming** : Follows pattern ` has_* ` for presence checks, ` is_* ` for property checks
68+ - ** New exports** : ` has_variable ` , ` has_control ` , ` has_abstract_definition ` , ` is_abstractly_defined ` , ` is_nonautonomous ` , ` is_nonvariable `
7069
7170#### API Enhancements
7271
7372``` julia
7473# Check if problem has optimisation variables
75- is_variable (ocp :: PreModel ) # Returns true if variable_dimension > 0
76- is_variable (ocp :: Model ) # Returns true if variable_dimension > 0
74+ has_variable (model ) # Alias for is_variable(model)
75+ is_nonvariable (model ) # Opposite of is_variable(model)
7776
78- # Check if problem is control-free (no control input)
79- is_control_free (ocp:: PreModel ) # Returns true if control_dimension == 0
80- is_control_free (ocp:: Model ) # Returns true if control_dimension == 0
77+ # Check if problem has control input
78+ has_control (model) # Opposite of is_control_free(model)
79+
80+ # Check if problem has abstract definition
81+ has_abstract_definition (model) # Checks if definition is non-empty
82+ is_abstractly_defined (model) # Alias for has_abstract_definition
83+
84+ # Check time dependence
85+ is_nonautonomous (model) # Opposite of is_autonomous(model)
8186```
8287
8388### 📊 API Changes
8489
85- - ** New exports** : ` is_variable ` and ` is_control_free ` are now exported from CTModels
86- - ** Display code** : Internal display functions now use the new checking functions instead of inline dimension comparisons
90+ - ** Breaking** : ` is_variable(ocp::PreModel) ` , ` is_control_free(ocp::PreModel) ` , ` is_autonomous(ocp::PreModel) ` removed
91+ - ** New exports** : ` has_variable ` , ` has_control ` , ` has_abstract_definition ` , ` is_abstractly_defined ` , ` is_nonautonomous ` , ` is_nonvariable `
92+ - ** Display code** : Internal display functions use ` __is_*_empty ` predicates for PreModel, public predicates for Model
8793
8894### 🔧 Internal Changes
8995
90- - ** New methods ** : Added ` is_variable() ` and ` is_control_free() ` methods in ` time_dependence.jl ` and ` model.jl `
91- - ** Display refactoring ** : Replaced inline ` v_dim > 0 ` with ` is_variable( ocp) ` in ` print.jl `
92- - ** Display refactoring ** : Replaced inline ` u_dim > 0 ` with ` ! is_control_free(ocp) ` in ` print.jl `
93- - ** New tests ** : Added comprehensive test suite in ` test_variable_control_checks.jl ` with 20 tests
96+ - ** Predicate refactoring ** : Removed ` __is_*_set ` methods for ` Model ` (only ` __is_*_empty ` remains)
97+ - ** PreModel access ** : Display code uses direct field access ( ` ocp.autonomous ` ) and internal predicates ( ` __is_variable_empty ` , ` __is_control_empty ` )
98+ - ** Model access ** : Public predicates ( ` is_variable ` , ` is_control_free ` , ` is_autonomous ` ) work for Model only
99+ - ** Test updates ** : Migrated tests to use internal predicates for PreModel, public predicates for Model
94100
95101## [ 0.9.14] - 2026-04-12
96102
0 commit comments