Skip to content

Commit a40884c

Browse files
committed
allow Symbolics v7
1 parent e4f516d commit a40884c

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ Polyhedra = "0.7 - 0.8"
3939
RecipesBase = "1"
4040
StaticArrays = "1"
4141
SymEngine = "0.7 - 0.13"
42-
Symbolics = "6.1"
42+
Symbolics = "6.1 - 7"
4343
TaylorModels = "0.6 - 0.8"

src/Sets/HalfSpace/ishalfspace.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,18 @@ end # load_SymEngine_ishalfspace
6565

6666
function load_Symbolics_ishalfspace()
6767
return quote
68-
using .Symbolics: Symbolic
68+
if isdefined(Symbolics, :Symbolic)
69+
import .Symbolics: Symbolic
70+
const BasicSymbolic = Symbolic
71+
else
72+
import .Symbolics: BasicSymbolic
73+
const BasicSymbolic = BasicSymbolic
74+
end
6975

7076
# returns `(true, sexpr)` if expr represents a half-space,
7177
# where sexpr is the simplified expression sexpr := LHS - RHS <= 0
7278
# otherwise, returns `(false, expr)`
73-
function _ishalfspace(expr::Symbolic)
79+
function _ishalfspace(expr::BasicSymbolic)
7480
got_halfspace = true
7581

7682
# find sense and normalize

src/Sets/Hyperplane/ishyperplanar.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,18 @@ end # load_SymEngine_ishyperplanar
6464

6565
function load_Symbolics_ishyperplanar()
6666
return quote
67-
using .Symbolics: Symbolic
67+
if isdefined(Symbolics, :Symbolic)
68+
import .Symbolics: Symbolic
69+
const BasicSymbolic = Symbolic
70+
else
71+
import .Symbolics: BasicSymbolic
72+
const BasicSymbolic = BasicSymbolic
73+
end
6874

6975
# returns `(true, sexpr)` if expr represents a hyperplane,
7076
# where sexpr is the simplified expression sexpr := LHS - RHS == 0
7177
# otherwise returns `(false, expr)`
72-
function _ishyperplanar(expr::Symbolic)
78+
function _ishyperplanar(expr::BasicSymbolic)
7379
got_hyperplane = Symbolics.operation(expr) == ==
7480
if got_hyperplane
7581
# simplify to the form a*x + b == 0

test/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ CDDLib = "3391f64e-dcde-5f30-b752-e11513730f60"
44
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
55
Expokit = "a1e7a1ef-7a5d-5822-a38c-be74e1bb89f4"
66
ExponentialUtilities = "d4d017d3-3776-5f7e-afef-a10c40355c18"
7-
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
87
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
8+
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
99
IntervalConstraintProgramming = "138f1668-1576-5ad7-91b9-7425abbf3153"
1010
IntervalMatrices = "5c1f47dc-42dd-5697-8aaa-4d102d140ba9"
1111
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
@@ -32,8 +32,8 @@ CDDLib = "0.6 - 0.10"
3232
Distributions = "0.19 - 0.25"
3333
Expokit = "0.2"
3434
ExponentialUtilities = "1"
35-
GeometryBasics = "0.3 - 0.5"
3635
GR = "0"
36+
GeometryBasics = "0.3 - 0.5"
3737
IntervalConstraintProgramming = "0.9 - 0.13"
3838
IntervalMatrices = "0.8 - 0.12"
3939
Ipopt = "1"
@@ -46,6 +46,6 @@ SCS = "1, 2"
4646
SetProg = "0.3 - 0.4"
4747
StaticArrays = "0.12, 1"
4848
SymEngine = "0.7 - 0.13"
49-
Symbolics = "1 - 5.30, 6.1"
49+
Symbolics = "1 - 5.30, 6.1 - 7"
5050
TaylorModels = "0.0.1, 0.1 - 0.8"
5151
WriteVTK = "1"

0 commit comments

Comments
 (0)