control-toolbox / control-toolbox/CTParser.jl
[Dev] semantic tests during cost parsing
- Dominant language
- Julia
- Stars
- 3
- Forks
- 0
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 2
Description
@ocots the semantic test below, currently done in `onepass.jl` during the (syntaxic) pattern matching, should be deferred to `p_lagrange!`. i'm changing it unless you remember why you or me put it here. same thing for other kinds of costs.
NB. no need to make a fix in CTBase, i'm updating it directly in CTParser.onepass
```julia
# lagrange cost
:(∫($e1) → min) => p_lagrange!(p, ocp, e1, :min; log)
:(-∫($e1) → min) => p_lagrange!(p, ocp, :(-$e1), :min; log)
:($e1 * ∫($e2) → min) => if has(e1, p.t)
(return __throw("time $(p.t) must not appear in $e1", p.lnum, p.line))
```
Contributor guide
Assessment
This issue has not been assessed yet.