Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outsource Properties module #493

Merged
merged 2 commits into from
Feb 24, 2019
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
26 changes: 26 additions & 0 deletions src/Properties/Properties.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
__precompile__()
"""
Module for defining and checking properties.
"""
module Properties

using LazySets

# ==============================
# Property struct and evaluation
# ==============================
include("Property.jl")
export Property,
check_property

include("LinearConstraintProperty.jl")
export LinearConstraintProperty,
Clause

include("IntersectionProperty.jl")
export IntersectionProperty

include("SubsetProperty.jl")
export SubsetProperty

end # module
File renamed without changes.
3 changes: 2 additions & 1 deletion src/ReachSets/ContinuousPost/BFFPSV18/check_property.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import LazySets.CacheMinkowskiSum
using LazySets: CacheMinkowskiSum
import ..Properties: check_property

"""
check_property(S, property, options)
Expand Down
27 changes: 5 additions & 22 deletions src/ReachSets/ReachSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ AUTHORS:
"""
module ReachSets

using ..Utils
using LazySets, MathematicalSystems, HybridSystems
using Expokit, Optim, ProgressMeter
using ..Utils, ..Properties
using LazySets, MathematicalSystems, HybridSystems, Expokit, Optim,
ProgressMeter

# fix namespace conflicts with MathematicalSystems
using LazySets: LinearMap
Expand All @@ -107,27 +107,10 @@ include("discretize.jl")

export discretize

# ==============================
# Property struct and evaluation
# ==============================
include("Properties/Property.jl")
export Property,
inout_map_property

include("Properties/LinearConstraintProperty.jl")
export LinearConstraintProperty,
Clause

include("Properties/IntersectionProperty.jl")
export IntersectionProperty

include("Properties/SubsetProperty.jl")
export SubsetProperty

# ==========================
# Property checking results
# ==========================
include("Properties/CheckSolution.jl")
include("CheckSolution.jl")

export CheckSolution

Expand All @@ -153,7 +136,7 @@ export available_algorithms_check,
# ====================================================
# Algorithms to find a threshold for property checking
# ====================================================
include("Properties/tune.jl")
include("tune.jl")
export tune_δ

# =====================
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/Reachability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ include("Utils/Utils.jl")
include("Options/dictionary.jl")
include("Options/validation.jl")
include("Options/default_options.jl")
include("Properties/Properties.jl")
include("ReachSets/ReachSets.jl")
include("Transformations/Transformations.jl")

@reexport using Reachability.Utils,
Reachability.ReachSets,
Reachability.Properties,
Reachability.Transformations

export project,
Expand Down
4 changes: 2 additions & 2 deletions test/Properties/unit_tune.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Reachability.ReachSets: BFFPSV18
using Reachability.ReachSets: tune_δ

#===== Projectile model =====
We test the line plot!(x->x, x->-24*x+375, 0., 50., line=2., color="red", linestyle=:solid, legend=:none)
Expand All @@ -17,4 +17,4 @@ algorithm(N, δ) =
op=BFFPSV18(:δ => δ, :vars => [1, 3], :partition=>[1:2, 3:4])
).satisfied

Reachability.tune_δ(algorithm, time_horizon, prec, initial_δ)
tune_δ(algorithm, time_horizon, prec, initial_δ)
2 changes: 0 additions & 2 deletions test/ReachSets/unit_discretization.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Reachability.ReachSets.discretize

let # preventing global scope
# ===================================================================
# Discretization of a continuous-time system without input (ZeroSet)
Expand Down
3 changes: 0 additions & 3 deletions test/Reachability/solve_continuous.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# ===============================
# Test minimal (default) options
# ===============================
using Reachability, MathematicalSystems
using Reachability.ReachSets: BFFPSV18
using LinearAlgebra, SparseArrays

# linear ODE: x' = Ax
A = [ 0.0509836 0.168159 0.95246 0.33644
Expand Down
2 changes: 0 additions & 2 deletions test/Systems/alltests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
using MathematicalSystems

@time @testset "Systems.NonDeterministicInput" begin include("unit_NonDeterministicInput.jl") end
@time @testset "Systems.System" begin include("unit_System.jl") end
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env julia
using LazySets, Reachability, MathematicalSystems
using LazySets, Reachability, MathematicalSystems,
LinearAlgebra, SparseArrays

# fix namespace conflicts with MathematicalSystems
import LazySets.LinearMap
Expand Down