JuliaReach / Reachability.jl

Reachability and Safety of Nondeterministic Dynamical Systems
MIT License
50 stars 4 forks source link

Fix ambiguity in broadcasted with IntervalBox #619

Closed schillic closed 5 years ago

schillic commented 5 years ago

The following error occurred without changing anything in our code base.

Reachability.solve_continuous: Error During Test at /home/travis/build/JuliaReach/Reachability.jl/test/Reachability/alltests.jl:2
  Got exception outside of a @test
  LoadError: MethodError: Base.Broadcast.broadcasted(::typeof(+), ::IntervalArithmetic.IntervalBox{2,Float64}, ::IntervalArithmetic.IntervalBox{2,Float64}) is ambiguous. Candidates:
    broadcasted(f, X::IntervalArithmetic.IntervalBox, Y::IntervalArithmetic.IntervalBox) in IntervalArithmetic at /home/travis/.julia/packages/IntervalArithmetic/9q80F/src/multidim/arithmetic.jl:27
    broadcasted(f, X::IntervalArithmetic.IntervalBox, y) in IntervalArithmetic at /home/travis/.julia/packages/IntervalArithmetic/9q80F/src/multidim/arithmetic.jl:28
    broadcasted(f, x, Y::IntervalArithmetic.IntervalBox) in IntervalArithmetic at /home/travis/.julia/packages/IntervalArithmetic/9q80F/src/multidim/arithmetic.jl:29
    broadcasted(f::Union{typeof(*), typeof(+), typeof(muladd)}, arg1, arg2, args...) in DiffEqBase at /home/travis/.julia/packages/DiffEqBase/EFqMn/src/diffeqfastbc.jl:54
  Possible fix, define
    broadcasted(::Union{typeof(*), typeof(+), typeof(muladd)}, ::IntervalArithmetic.IntervalBox, ::IntervalArithmetic.IntervalBox)
  Stacktrace:
   [1] #validated_integ#31(::Int64, ::Bool, ::Function, ::Function, ::Function, ::Array{Float64,1}, ::IntervalArithmetic.IntervalBox{2,Float64}, ::Float64, ::Float64, ::Int64, ::Int64, ::Float64) at /home/travis/.julia/packages/TaylorModels/DXLdP/src/validatedODEs.jl:277
   [2] (::getfield(TaylorModels, Symbol("#kw##validated_integ")))(::NamedTuple{(:maxsteps, :check_property),Tuple{Int64,getfield(Reachability.ReachSets, Symbol("##61#62"))}}, ::typeof(TaylorModels.validated_integ), ::Function, ::Array{Float64,1}, ::IntervalArithmetic.IntervalBox{2,Float64}, ::Float64, ::Float64, ::Int64, ::Int64, ::Float64) at ./none:0
   [3] macro expansion at /home/travis/build/JuliaReach/Reachability.jl/src/ReachSets/ContinuousPost/TMJets/post.jl:51 [inlined]
   [4] macro expansion at /home/travis/build/JuliaReach/Reachability.jl/src/logging.jl:83 [inlined]
   [5] post(::TMJets, ::InitialValueProblem{BlackBoxContinuousSystem{typeof(vanderPol!)},Hyperrectangle{Float64}}, ::Options) at /home/travis/build/JuliaReach/Reachability.jl/src/ReachSets/ContinuousPost/TMJets/post.jl:50
   [6] #solve!#40 at /home/travis/build/JuliaReach/Reachability.jl/src/solve.jl:74 [inlined]
   [7] #solve! at ./none:0 [inlined]
   [8] #solve#39(::TMJets, ::Function, ::InitialValueProblem{BlackBoxContinuousSystem{typeof(vanderPol!)},Hyperrectangle{Float64}}, ::Options) at /home/travis/build/JuliaReach/Reachability.jl/src/solve.jl:53
   [9] (::getfield(Reachability, Symbol("#kw##solve")))(::NamedTuple{(:op,),Tuple{TMJets}}, ::typeof(solve), ::InitialValueProblem{BlackBoxContinuousSystem{typeof(vanderPol!)},Hyperrectangle{Float64}}, ::Options) at ./none:0
   [10] top-level scope at none:0
   [11] include at ./boot.jl:317 [inlined]
   [12] include_relative(::Module, ::String) at ./loading.jl:1044
   [13] include(::Module, ::String) at ./sysimg.jl:29
   [14] include(::String) at ./client.jl:392
   [15] macro expansion at /home/travis/build/JuliaReach/Reachability.jl/test/Reachability/alltests.jl:2 [inlined]
   [16] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Test/src/Test.jl:1083 [inlined]
   [17] macro expansion at /home/travis/build/JuliaReach/Reachability.jl/test/Reachability/alltests.jl:2 [inlined]
   [18] top-level scope at ./util.jl:156 [inlined]
   [19] top-level scope at ./none:0
   [20] include at ./boot.jl:317 [inlined]
   [21] include_relative(::Module, ::String) at ./loading.jl:1044
   [22] include(::Module, ::String) at ./sysimg.jl:29
   [23] include(::String) at ./client.jl:392
   [24] top-level scope at none:0
   [25] include at ./boot.jl:317 [inlined]
   [26] include_relative(::Module, ::String) at ./loading.jl:1044
   [27] include(::Module, ::String) at ./sysimg.jl:29
   [28] include(::String) at ./client.jl:392
   [29] top-level scope at none:0
   [30] eval(::Module, ::Any) at ./boot.jl:319
   [31] exec_options(::Base.JLOptions) at ./client.jl:243
   [32] _start() at ./client.jl:425
  in expression starting at /home/travis/build/JuliaReach/Reachability.jl/test/Reachability/solve_continuous.jl:216
Test Summary:                 | Pass  Error  Total
Reachability.solve_continuous |    7      1      8
ERROR: LoadError: LoadError: Some tests did not pass: 7 passed, 0 failed, 1 errored, 0 broken.

This is probably an external problem. We should extract a minimal example and report it. It is, however, not clear what caused this because the package IntervalArithmetic was not changed during the last weeks, but a few days ago everything still worked.

schillic commented 5 years ago

Reported in https://github.com/JuliaIntervals/TaylorModels.jl/issues/39.