1
1
use std:: time:: Duration ;
2
2
3
- use argus_core :: prelude :: * ;
3
+ use argus :: expr :: * ;
4
4
use pyo3:: prelude:: * ;
5
5
use pyo3:: pyclass:: CompareOp ;
6
6
@@ -62,7 +62,7 @@ pub struct ConstInt;
62
62
impl ConstInt {
63
63
#[ new]
64
64
fn new ( val : i64 ) -> ( Self , PyNumExpr ) {
65
- ( Self , Box :: new ( NumExpr :: IntLit ( argus_core :: expr:: IntLit ( val) ) ) . into ( ) )
65
+ ( Self , Box :: new ( NumExpr :: IntLit ( argus :: expr:: IntLit ( val) ) ) . into ( ) )
66
66
}
67
67
}
68
68
@@ -79,7 +79,7 @@ pub struct ConstUInt;
79
79
impl ConstUInt {
80
80
#[ new]
81
81
fn new ( val : u64 ) -> ( Self , PyNumExpr ) {
82
- ( Self , Box :: new ( NumExpr :: UIntLit ( argus_core :: expr:: UIntLit ( val) ) ) . into ( ) )
82
+ ( Self , Box :: new ( NumExpr :: UIntLit ( argus :: expr:: UIntLit ( val) ) ) . into ( ) )
83
83
}
84
84
}
85
85
@@ -91,10 +91,7 @@ pub struct ConstFloat;
91
91
impl ConstFloat {
92
92
#[ new]
93
93
fn new ( val : f64 ) -> ( Self , PyNumExpr ) {
94
- (
95
- Self ,
96
- Box :: new ( NumExpr :: FloatLit ( argus_core:: expr:: FloatLit ( val) ) ) . into ( ) ,
97
- )
94
+ ( Self , Box :: new ( NumExpr :: FloatLit ( argus:: expr:: FloatLit ( val) ) ) . into ( ) )
98
95
}
99
96
}
100
97
@@ -106,10 +103,7 @@ pub struct VarInt;
106
103
impl VarInt {
107
104
#[ new]
108
105
fn new ( name : String ) -> ( Self , PyNumExpr ) {
109
- (
110
- Self ,
111
- Box :: new ( NumExpr :: IntVar ( argus_core:: expr:: IntVar { name } ) ) . into ( ) ,
112
- )
106
+ ( Self , Box :: new ( NumExpr :: IntVar ( argus:: expr:: IntVar { name } ) ) . into ( ) )
113
107
}
114
108
}
115
109
@@ -121,10 +115,7 @@ pub struct VarUInt;
121
115
impl VarUInt {
122
116
#[ new]
123
117
fn new ( name : String ) -> ( Self , PyNumExpr ) {
124
- (
125
- Self ,
126
- Box :: new ( NumExpr :: UIntVar ( argus_core:: expr:: UIntVar { name } ) ) . into ( ) ,
127
- )
118
+ ( Self , Box :: new ( NumExpr :: UIntVar ( argus:: expr:: UIntVar { name } ) ) . into ( ) )
128
119
}
129
120
}
130
121
@@ -136,10 +127,7 @@ pub struct VarFloat;
136
127
impl VarFloat {
137
128
#[ new]
138
129
fn new ( name : String ) -> ( Self , PyNumExpr ) {
139
- (
140
- Self ,
141
- Box :: new ( NumExpr :: FloatVar ( argus_core:: expr:: FloatVar { name } ) ) . into ( ) ,
142
- )
130
+ ( Self , Box :: new ( NumExpr :: FloatVar ( argus:: expr:: FloatVar { name } ) ) . into ( ) )
143
131
}
144
132
}
145
133
@@ -152,7 +140,7 @@ impl Negate {
152
140
#[ new]
153
141
fn new ( arg : PyNumExpr ) -> ( Self , PyNumExpr ) {
154
142
let arg = arg. 0 ;
155
- ( Self , Box :: new ( NumExpr :: Neg ( argus_core :: expr:: Neg { arg } ) ) . into ( ) )
143
+ ( Self , Box :: new ( NumExpr :: Neg ( argus :: expr:: Neg { arg } ) ) . into ( ) )
156
144
}
157
145
}
158
146
@@ -167,7 +155,7 @@ impl Add {
167
155
#[ new]
168
156
fn new ( args : Vec < PyNumExpr > ) -> ( Self , PyNumExpr ) {
169
157
let args: Vec < NumExpr > = args. into_iter ( ) . map ( |arg| * arg. 0 ) . collect ( ) ;
170
- ( Self , Box :: new ( NumExpr :: Add ( argus_core :: expr:: Add { args } ) ) . into ( ) )
158
+ ( Self , Box :: new ( NumExpr :: Add ( argus :: expr:: Add { args } ) ) . into ( ) )
171
159
}
172
160
}
173
161
@@ -180,7 +168,7 @@ impl Sub {
180
168
fn new ( lhs : PyNumExpr , rhs : PyNumExpr ) -> ( Self , PyNumExpr ) {
181
169
let lhs = lhs. 0 ;
182
170
let rhs = rhs. 0 ;
183
- ( Self , Box :: new ( NumExpr :: Sub ( argus_core :: expr:: Sub { lhs, rhs } ) ) . into ( ) )
171
+ ( Self , Box :: new ( NumExpr :: Sub ( argus :: expr:: Sub { lhs, rhs } ) ) . into ( ) )
184
172
}
185
173
}
186
174
@@ -192,7 +180,7 @@ impl Mul {
192
180
#[ new]
193
181
fn new ( args : Vec < PyNumExpr > ) -> ( Self , PyNumExpr ) {
194
182
let args: Vec < NumExpr > = args. into_iter ( ) . map ( |arg| * arg. 0 ) . collect ( ) ;
195
- ( Self , Box :: new ( NumExpr :: Mul ( argus_core :: expr:: Mul { args } ) ) . into ( ) )
183
+ ( Self , Box :: new ( NumExpr :: Mul ( argus :: expr:: Mul { args } ) ) . into ( ) )
196
184
}
197
185
}
198
186
@@ -207,7 +195,7 @@ impl Div {
207
195
let divisor = divisor. 0 ;
208
196
(
209
197
Self ,
210
- Box :: new ( NumExpr :: Div ( argus_core :: expr:: Div { dividend, divisor } ) ) . into ( ) ,
198
+ Box :: new ( NumExpr :: Div ( argus :: expr:: Div { dividend, divisor } ) ) . into ( ) ,
211
199
)
212
200
}
213
201
}
@@ -220,7 +208,7 @@ impl Abs {
220
208
#[ new]
221
209
fn new ( arg : PyNumExpr ) -> ( Self , PyNumExpr ) {
222
210
let arg = arg. 0 ;
223
- ( Self , Box :: new ( NumExpr :: Abs ( argus_core :: expr:: Abs { arg } ) ) . into ( ) )
211
+ ( Self , Box :: new ( NumExpr :: Abs ( argus :: expr:: Abs { arg } ) ) . into ( ) )
224
212
}
225
213
}
226
214
@@ -254,7 +242,7 @@ pub struct ConstBool;
254
242
impl ConstBool {
255
243
#[ new]
256
244
fn new ( val : bool ) -> ( Self , PyBoolExpr ) {
257
- ( Self , Box :: new ( BoolExpr :: BoolLit ( argus_core :: expr:: BoolLit ( val) ) ) . into ( ) )
245
+ ( Self , Box :: new ( BoolExpr :: BoolLit ( argus :: expr:: BoolLit ( val) ) ) . into ( ) )
258
246
}
259
247
}
260
248
@@ -265,10 +253,7 @@ pub struct VarBool;
265
253
impl VarBool {
266
254
#[ new]
267
255
fn new ( name : String ) -> ( Self , PyBoolExpr ) {
268
- (
269
- Self ,
270
- Box :: new ( BoolExpr :: BoolVar ( argus_core:: expr:: BoolVar { name } ) ) . into ( ) ,
271
- )
256
+ ( Self , Box :: new ( BoolExpr :: BoolVar ( argus:: expr:: BoolVar { name } ) ) . into ( ) )
272
257
}
273
258
}
274
259
@@ -284,10 +269,7 @@ impl Cmp {
284
269
let op = op. 0 ;
285
270
let lhs = lhs. 0 ;
286
271
let rhs = rhs. 0 ;
287
- (
288
- Self ,
289
- Box :: new ( BoolExpr :: Cmp ( argus_core:: expr:: Cmp { op, lhs, rhs } ) ) . into ( ) ,
290
- )
272
+ ( Self , Box :: new ( BoolExpr :: Cmp ( argus:: expr:: Cmp { op, lhs, rhs } ) ) . into ( ) )
291
273
}
292
274
}
293
275
@@ -332,7 +314,7 @@ impl Not {
332
314
#[ new]
333
315
fn new ( arg : PyBoolExpr ) -> ( Self , PyBoolExpr ) {
334
316
let arg = arg. 0 ;
335
- ( Self , PyBoolExpr ( Box :: new ( BoolExpr :: Not ( argus_core :: expr:: Not { arg } ) ) ) )
317
+ ( Self , PyBoolExpr ( Box :: new ( BoolExpr :: Not ( argus :: expr:: Not { arg } ) ) ) )
336
318
}
337
319
}
338
320
@@ -344,10 +326,7 @@ impl And {
344
326
#[ new]
345
327
fn new ( args : Vec < PyBoolExpr > ) -> ( Self , PyBoolExpr ) {
346
328
let args: Vec < BoolExpr > = args. into_iter ( ) . map ( |arg| * arg. 0 ) . collect ( ) ;
347
- (
348
- Self ,
349
- PyBoolExpr ( Box :: new ( BoolExpr :: And ( argus_core:: expr:: And { args } ) ) ) ,
350
- )
329
+ ( Self , PyBoolExpr ( Box :: new ( BoolExpr :: And ( argus:: expr:: And { args } ) ) ) )
351
330
}
352
331
}
353
332
@@ -359,7 +338,7 @@ impl Or {
359
338
#[ new]
360
339
fn new ( args : Vec < PyBoolExpr > ) -> ( Self , PyBoolExpr ) {
361
340
let args: Vec < BoolExpr > = args. into_iter ( ) . map ( |arg| * arg. 0 ) . collect ( ) ;
362
- ( Self , PyBoolExpr ( Box :: new ( BoolExpr :: Or ( argus_core :: expr:: Or { args } ) ) ) )
341
+ ( Self , PyBoolExpr ( Box :: new ( BoolExpr :: Or ( argus :: expr:: Or { args } ) ) ) )
363
342
}
364
343
}
365
344
@@ -371,10 +350,7 @@ impl Next {
371
350
#[ new]
372
351
fn new ( arg : PyBoolExpr ) -> ( Self , PyBoolExpr ) {
373
352
let arg = arg. 0 ;
374
- (
375
- Self ,
376
- PyBoolExpr ( Box :: new ( BoolExpr :: Next ( argus_core:: expr:: Next { arg } ) ) ) ,
377
- )
353
+ ( Self , PyBoolExpr ( Box :: new ( BoolExpr :: Next ( argus:: expr:: Next { arg } ) ) ) )
378
354
}
379
355
}
380
356
@@ -395,7 +371,7 @@ impl Always {
395
371
} ;
396
372
(
397
373
Self ,
398
- PyBoolExpr ( Box :: new ( BoolExpr :: Always ( argus_core :: expr:: Always { arg, interval } ) ) ) ,
374
+ PyBoolExpr ( Box :: new ( BoolExpr :: Always ( argus :: expr:: Always { arg, interval } ) ) ) ,
399
375
)
400
376
}
401
377
}
@@ -417,7 +393,7 @@ impl Eventually {
417
393
} ;
418
394
(
419
395
Self ,
420
- PyBoolExpr ( Box :: new ( BoolExpr :: Eventually ( argus_core :: expr:: Eventually {
396
+ PyBoolExpr ( Box :: new ( BoolExpr :: Eventually ( argus :: expr:: Eventually {
421
397
arg,
422
398
interval,
423
399
} ) ) ) ,
@@ -443,11 +419,7 @@ impl Until {
443
419
} ;
444
420
(
445
421
Self ,
446
- PyBoolExpr ( Box :: new ( BoolExpr :: Until ( argus_core:: expr:: Until {
447
- lhs,
448
- rhs,
449
- interval,
450
- } ) ) ) ,
422
+ PyBoolExpr ( Box :: new ( BoolExpr :: Until ( argus:: expr:: Until { lhs, rhs, interval } ) ) ) ,
451
423
)
452
424
}
453
425
}
0 commit comments