dpsanders / ReversePropagation.jl

MIT License
52 stars 6 forks source link

Don't assign to constants #71

Open dpsanders opened 6 months ago

dpsanders commented 6 months ago
julia> ex = x^2 + y^2
x^2 + y^2

julia> C = ReversePropagation.forward_backward_expr(ex, vars)
(quote
    _l = (^)(x, 2)
    _m = (^)(y, 2)
    _n = (+)(_l, _m)
    _value3 = _n
    _n = (intersect)(_n, _constraint3)
    (_n, _l, _m) = (ReversePropagation.rev)(+, _n, _l, _m)
    (_m, y, 2) = (ReversePropagation.rev)(^, _m, y, 2)
    (_l, x, 2) = (ReversePropagation.rev)(^, _l, x, 2)
end, _value3, _constraint3)

The assignment to constants is incorrect.