@@ -6,20 +6,20 @@ struct Var <: IR
66 id:: String
77end
88
9- struct Const <: IR
9+ struct Literal <: IR
1010 value:: Real
1111end
1212
1313struct Mat <: IR
14- id:: Union{Var,Const }
14+ id:: Union{Var,Literal }
1515end
1616
1717struct Vec <: IR
18- id:: Union{Var,Const }
18+ id:: Union{Var,Literal }
1919end
2020
2121struct Scal <: IR
22- id:: Union{Var,Const }
22+ id:: Union{Var,Literal }
2323end
2424
2525struct Identity <: IR end
@@ -102,7 +102,7 @@ function _get_variables(arg::Var)
102102 return arg. id
103103end
104104
105- function _get_variables (arg:: Const )
105+ function _get_variables (arg:: Literal )
106106 return _get_variables (arg. value)
107107end
108108
@@ -221,21 +221,21 @@ function to_ir(arg::Literal)
221221
222222 if length (ids) == 2
223223 if flip (ids[1 ]) == ids[2 ]
224- return ir. Trace (ir. Mat (ir. Const (arg. value)))
224+ return ir. Trace (ir. Mat (ir. Literal (arg. value)))
225225 elseif typeof (ids[1 ]) == Upper && typeof (ids[2 ]) == Lower
226- return ir. Mat (ir. Const (arg. value))
226+ return ir. Mat (ir. Literal (arg. value))
227227 elseif typeof (ids[1 ]) == Lower && typeof (ids[2 ]) == Upper
228- return ir. Transpose (ir. Mat (ir. Const (arg. value)))
228+ return ir. Transpose (ir. Mat (ir. Literal (arg. value)))
229229 end
230230 elseif length (ids) == 1
231231 if typeof (ids[1 ]) == Upper
232- return ir. Vec (ir. Const (arg. value))
232+ return ir. Vec (ir. Literal (arg. value))
233233 elseif typeof (ids[1 ]) == Lower
234- return ir. Transpose (ir. Vec (ir. Const (arg. value)))
234+ return ir. Transpose (ir. Vec (ir. Literal (arg. value)))
235235 end
236236 end
237237
238- return ir. Scal (ir. Const (arg. value))
238+ return ir. Scal (ir. Literal (arg. value))
239239end
240240
241241function to_ir (arg:: KrD )
@@ -259,21 +259,21 @@ function to_ir(arg::Zero)
259259
260260 if length (ids) == 2
261261 if typeof (ids[1 ]) == Upper && typeof (ids[2 ]) == Lower
262- return ir. Mat (ir. Const (0 ))
262+ return ir. Mat (ir. Literal (0 ))
263263 elseif typeof (ids[1 ]) == Lower && typeof (ids[2 ]) == Upper
264- return ir. Transpose (ir. Mat (ir. Const (0 )))
264+ return ir. Transpose (ir. Mat (ir. Literal (0 )))
265265 end
266266 elseif length (ids) == 1
267267 if typeof (ids[1 ]) == Upper
268- return ir. Vec (ir. Const (0 ))
268+ return ir. Vec (ir. Literal (0 ))
269269 elseif typeof (ids[1 ]) == Lower
270- return ir. Transpose (ir. Vec (ir. Const (0 )))
270+ return ir. Transpose (ir. Vec (ir. Literal (0 )))
271271 end
272272 end
273273end
274274
275275function to_ir (arg:: Real )
276- return ir. Scal (ir. Const (arg))
276+ return ir. Scal (ir. Literal (arg))
277277end
278278
279279function to_ir (arg:: UnaryOperation{Abs} )
@@ -370,9 +370,9 @@ function to_ir(arg::BinaryOperation{Mult})
370370 )
371371 elseif all (typeof .(terms) .== KrD)
372372 if typeof (target_indices[1 ]) == Upper
373- return ir. Vec (ir. Const (1 ))
373+ return ir. Vec (ir. Literal (1 ))
374374 else
375- return ir. Transpose (ir. Vec (ir. Const (1 )))
375+ return ir. Transpose (ir. Vec (ir. Literal (1 )))
376376 end
377377 elseif arg. arg1 isa Literal || arg. arg2 isa Literal
378378 tensor = if arg. arg1 isa Literal
0 commit comments