Skip to content

Commit c386495

Browse files
authored
Fix print of 1 inequality (#48)
1 parent ecb86a5 commit c386495

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,27 @@ julia> using SemialgebraicSets, TypedPolynomials
3232
julia> @polyvar x y;
3333

3434
julia> @set x^2 + y^2 <= 1 # Euclidean ball
35+
Basic semialgebraic Set defined by no equality
36+
1 inequality
37+
1 - y^2 - x^2 0
38+
39+
40+
julia> basic_semialgebraic_set(FullSpace(), [1 - x^2 - y^2])
41+
Basic semialgebraic Set defined by no equality
42+
1 inequality
43+
1 - y^2 - x^2 0
3544

3645
julia> @set y^2 == x^3 - x && x <= 0 # Cutting the algebraic variety https://en.wikipedia.org/wiki/Algebraic_variety#/media/File:Elliptic_curve2.png
37-
Basic semialgebraic Set defined by 1 equalitty
46+
Basic semialgebraic Set defined by 1 equality
3847
x + y^2 - x^3 = 0
39-
1 inequalitty
48+
1 inequality
4049
-x 0
4150

4251

4352
julia> basic_semialgebraic_set(algebraic_set([y^2- x^3 - x]), [-x])
44-
Basic semialgebraic Set defined by 1 equalitty
53+
Basic semialgebraic Set defined by 1 equality
4554
-x + y^2 - x^3 = 0
46-
1 inequalitty
55+
1 inequality
4756
-x 0
4857
```
4958

src/variety.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function _show_els(io::IO, name, n, els, sign)
149149
if n == 0
150150
println(io, "no $(name)y")
151151
elseif n == 1
152-
println(io, "1 $(name)ty")
152+
println(io, "1 $(name)y")
153153
else
154154
println(io, "$n $(name)ies")
155155
end

test/macro.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function runtests()
8989
_test_polynomial_API(T, (x, y))
9090
@test sprint(show, T) == "{ (x, y) | x - x^2 = 0, -y + y^2 ≥ 0 }"
9191
@test sprint(show, MIME"text/plain"(), T) ==
92-
"Basic semialgebraic Set defined by 1 equalitty\n x - x^2 = 0\n1 inequalitty\n -y + y^2 ≥ 0\n"
92+
"Basic semialgebraic Set defined by 1 equality\n x - x^2 = 0\n1 inequality\n -y + y^2 ≥ 0\n"
9393
end
9494
end
9595
@testset "Basic with no equality" begin
@@ -124,10 +124,10 @@ Algebraic Set defined by no equality
124124
_test_polynomial_API(S, (x,))
125125
@test sprint(show, S) == "{ (x) | -1 + x = 0, -x + x^2 ≥ 0 }"
126126
@test sprint(show, MIME"text/plain"(), S) ==
127-
"Basic semialgebraic Set defined by 1 equalitty\n -1 + x = 0\n1 inequalitty\n -x + x^2 ≥ 0\n"
127+
"Basic semialgebraic Set defined by 1 equality\n -1 + x = 0\n1 inequality\n -x + x^2 ≥ 0\n"
128128
@test sprint(show, S.V) == "{ (x) | -1 + x = 0 }"
129129
@test sprint(show, MIME"text/plain"(), S.V) ==
130-
"Algebraic Set defined by 1 equalitty\n -1 + x = 0\n"
130+
"Algebraic Set defined by 1 equality\n -1 + x = 0\n"
131131

132132
S = @set x == 1 && x y && 2 == y
133133
_test_polynomial_API(S, (x, y))

0 commit comments

Comments
 (0)