@@ -13,11 +13,16 @@ is_transparent_operator(::Type) = false
1313"""
1414 $(TYPEDSIGNATURES)
1515
16- Trait to be implemented for operators which determines whether they are synchronous operators.
17- Synchronous operators must implement `input_timedomain` and `output_timedomain`.
16+ Trait to be implemented for operators which determines whether the operator is applied to
17+ a time-varying quantity and results in a time-varying quantity. For example, `Initial` and
18+ `Pre` are not time-varying since while they are applied to variables, the application
19+ results in a non-discrete-time parameter. `Differential`, `Shift`, `Sample` and `Hold` are
20+ all time-varying operators. All time-varying operators must implement `input_timedomain` and
21+ `output_timedomain`.
1822"""
19- is_synchronous_operator (x) = is_synchronous_operator (typeof (x))
20- is_synchronous_operator (:: Type ) = false
23+ is_timevarying_operator (x) = is_timevarying_operator (typeof (x))
24+ is_timevarying_operator (:: Type{<:Symbolics.Operator} ) = true
25+ is_timevarying_operator (:: Type ) = false
2126
2227"""
2328 function SampleTime()
@@ -61,7 +66,6 @@ struct Shift <: Operator
6166end
6267Shift (steps:: Int ) = new (nothing , steps)
6368normalize_to_differential (s:: Shift ) = Differential (s. t)^ s. steps
64- is_synchronous_operator (:: Type{Shift} ) = true
6569Base. nameof (:: Shift ) = :Shift
6670SymbolicUtils. isbinop (:: Shift ) = false
6771
@@ -148,7 +152,6 @@ struct Sample <: Operator
148152 Sample (clock:: Union{TimeDomain, InferredTimeDomain} = InferredDiscrete ()) = new (clock)
149153end
150154
151- is_synchronous_operator (:: Type{Sample} ) = true
152155is_transparent_operator (:: Type{Sample} ) = true
153156
154157function Sample (arg:: Real )
@@ -204,7 +207,6 @@ struct Hold <: Operator
204207end
205208
206209is_transparent_operator (:: Type{Hold} ) = true
207- is_synchronous_operator (:: Type{Hold} ) = true
208210
209211(D:: Hold )(x) = Term {symtype(x)} (D, Any[x])
210212(D:: Hold )(x:: Num ) = Num (D (value (x)))
0 commit comments