Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ end
# Close to single assignment form
mutable struct FlatAST
top # topmost variable(s)
input_variables::Set{Symbol}
input_variables::Vector{Symbol}
intermediate::Vector{Symbol} # generated vars
code # ::Vector{Assignment}
variables::Vector{Symbol} # cleaned version of input_variables
Expand All @@ -76,7 +76,7 @@ function Base.show(io::IO, flatAST::FlatAST)
println(io, "code: ", flatAST.code)
end

FlatAST() = FlatAST([], Set{Symbol}(), [], [], [])
FlatAST() = FlatAST([], [], [], [], [])

export FlatAST

Expand Down
4 changes: 1 addition & 3 deletions src/code_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ function forward_backward(flatAST::FlatAST)

# @show flatAST.input_variables
# @show flatAST.intermediate


input = sort(collect(flatAST.input_variables))
input = collect(flatAST.input_variables)

# @show flatAST.top

Expand Down
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ end
C2 = Contractor([x, y, z], y+z)
@test C2(A,X) == IntervalBox(0.5..1.5, 0.5..0.5, 0.5..0.5)

vars = @variables x1 x3 x2

C = Contractor(vars, x1+x2)
@test C(A, X) == IntervalBox(0.5..0.5, 0.5..1.5, 0.5..0.5)

end

@testset "Contractor is created by function name " begin
Expand Down