rdl 1.1.0 → 1.1.1.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGES.md +25 -0
- data/README.md +104 -64
- data/extras/type_tests/%.rb +171 -0
- data/extras/type_tests/&.rb +159 -0
- data/extras/type_tests/**.rb +222 -0
- data/extras/type_tests/*.rb +177 -0
- data/extras/type_tests/+.rb +170 -0
- data/extras/type_tests/-.rb +171 -0
- data/extras/type_tests/1scomp.rb +157 -0
- data/extras/type_tests/<.rb +170 -0
- data/extras/type_tests/<<.rb +159 -0
- data/extras/type_tests/>>.rb +159 -0
- data/extras/type_tests/[].rb +163 -0
- data/extras/type_tests/^.rb +159 -0
- data/extras/type_tests/abs.rb +155 -0
- data/extras/type_tests/abs2.rb +164 -0
- data/extras/type_tests/angle.rb +157 -0
- data/extras/type_tests/arg.rb +157 -0
- data/extras/type_tests/bit_length.rb +157 -0
- data/extras/type_tests/ceil.rb +157 -0
- data/extras/type_tests/ceilRational.rb +160 -0
- data/extras/type_tests/conj.rb +158 -0
- data/extras/type_tests/defwhere.rb +86 -0
- data/extras/type_tests/denominator.rb +157 -0
- data/extras/type_tests/div.rb +172 -0
- data/extras/type_tests/divslash.rb +179 -0
- data/extras/type_tests/even?.rb +157 -0
- data/extras/type_tests/fdiv.rb +244 -0
- data/extras/type_tests/finite?.rb +157 -0
- data/extras/type_tests/floor.rb +157 -0
- data/extras/type_tests/floorRational.rb +161 -0
- data/extras/type_tests/hash.rb +157 -0
- data/extras/type_tests/imag.rb +158 -0
- data/extras/type_tests/infinite?.rb +157 -0
- data/extras/type_tests/modulo.rb +171 -0
- data/extras/type_tests/nan?.rb +157 -0
- data/extras/type_tests/neg.rb +155 -0
- data/extras/type_tests/next.rb +157 -0
- data/extras/type_tests/next_float.rb +157 -0
- data/extras/type_tests/numerator.rb +157 -0
- data/extras/type_tests/phase.rb +157 -0
- data/extras/type_tests/prev_float.rb +157 -0
- data/extras/type_tests/quo.rb +179 -0
- data/extras/type_tests/rationalize.rb +157 -0
- data/extras/type_tests/rationalizeArg.rb +198 -0
- data/extras/type_tests/real.rb +157 -0
- data/extras/type_tests/real?.rb +157 -0
- data/extras/type_tests/round.rb +157 -0
- data/extras/type_tests/roundArg.rb +169 -0
- data/extras/type_tests/size.rb +157 -0
- data/extras/type_tests/to_c.rb +157 -0
- data/extras/type_tests/to_f.rb +155 -0
- data/extras/type_tests/to_i.rb +157 -0
- data/extras/type_tests/to_r.rb +157 -0
- data/extras/type_tests/to_s.rb +157 -0
- data/extras/type_tests/truncate.rb +157 -0
- data/extras/type_tests/truncateArg.rb +166 -0
- data/extras/type_tests/type tests +1 -0
- data/extras/type_tests/zero?.rb +155 -0
- data/extras/type_tests/|.rb +159 -0
- data/lib/rdl/contracts/and.rb +1 -1
- data/lib/rdl/contracts/flat.rb +2 -2
- data/lib/rdl/contracts/proc.rb +2 -1
- data/lib/rdl/types/.#lexer.rex +1 -0
- data/lib/rdl/types/dependent_arg.rb +47 -0
- data/lib/rdl/types/finitehash.rb +5 -5
- data/lib/rdl/types/generic.rb +3 -3
- data/lib/rdl/types/lexer.rex +5 -2
- data/lib/rdl/types/lexer.rex.rb +3 -0
- data/lib/rdl/types/method.rb +144 -15
- data/lib/rdl/types/nominal.rb +1 -1
- data/lib/rdl/types/parser.racc +6 -1
- data/lib/rdl/types/parser.tab.rb +272 -245
- data/lib/rdl/types/tuple.rb +1 -1
- data/lib/rdl/types/type_inferencer.rb +7 -7
- data/lib/rdl/wrap.rb +16 -11
- data/rdl.gemspec +3 -3
- data/test/test_dsl.rb +4 -5
- data/test/test_le.rb +5 -5
- data/test/test_lib_types.rb +34 -34
- data/test/test_member.rb +3 -3
- data/test/test_type_contract.rb +63 -1
- data/test/test_types.rb +2 -0
- data/types/ruby-2.x/_aliases.rb +2 -2
- data/types/ruby-2.x/bigdecimal.rb +246 -12
- data/types/ruby-2.x/bignum.rb +253 -0
- data/types/ruby-2.x/complex.rb +111 -22
- data/types/ruby-2.x/fixnum.rb +238 -31
- data/types/ruby-2.x/float.rb +217 -35
- data/types/ruby-2.x/integer.rb +17 -16
- data/types/ruby-2.x/numeric.rb +31 -21
- data/types/ruby-2.x/rational.rb +196 -18
- metadata +67 -4
data/types/ruby-2.x/integer.rb
CHANGED
@@ -1,31 +1,32 @@
|
|
1
|
-
class Integer
|
1
|
+
class Integer < Numeric
|
2
2
|
rdl_nowrap
|
3
3
|
|
4
|
-
|
5
|
-
type :chr, '(
|
6
|
-
type :denominator, '() ->
|
7
|
-
|
4
|
+
type :ceil, '() -> Integer'
|
5
|
+
type :chr, '(Encoding) -> String'
|
6
|
+
type :denominator, '() -> Fixnum'
|
7
|
+
post(:denominator) { |r,x| r == 1 }
|
8
|
+
type :downto, '(Integer) { (Integer) -> %any } -> Integer'
|
8
9
|
type :downto, '(Integer limit) -> Enumerator<Integer>'
|
9
10
|
type :even?, '() -> %bool'
|
10
11
|
type :gcd, '(Integer) -> Integer'
|
11
12
|
type :gcdlcm, '(Integer) -> [Integer, Integer]'
|
12
|
-
|
13
|
+
type :floor, '() -> Integer'
|
13
14
|
type :integer?, '() -> TrueClass'
|
14
15
|
type :lcm, '(Integer) -> Integer'
|
15
16
|
type :next, '() -> Integer'
|
16
|
-
type :numerator, '() ->
|
17
|
+
type :numerator, '() -> Integer'
|
17
18
|
type :odd?, '() -> %bool'
|
18
|
-
type :ord, '() ->
|
19
|
+
type :ord, '() -> Integer'
|
19
20
|
type :pred, '() -> Integer'
|
20
|
-
type :rationalize, '(
|
21
|
-
type :round, '(
|
22
|
-
|
23
|
-
type :times, '() { (Integer) -> %any } ->
|
21
|
+
type :rationalize, '(Numeric) -> Rational'
|
22
|
+
type :round, '(Numeric) -> Numeric'
|
23
|
+
type :succ, '() -> Integer'
|
24
|
+
type :times, '() { (Integer) -> %any } -> Integer'
|
24
25
|
type :times, '() -> Enumerator<Integer>'
|
25
26
|
type :to_i, '() -> Integer'
|
26
|
-
|
27
|
+
type :to_int, '() -> Integer'
|
27
28
|
type :to_r, '() -> Rational'
|
28
|
-
|
29
|
-
type :upto, '(Integer
|
30
|
-
type :upto, '(Integer
|
29
|
+
type :truncate, '() -> Integer'
|
30
|
+
type :upto, '(Integer) { (Integer) -> %any } -> Integer'
|
31
|
+
type :upto, '(Integer) -> Enumerator<Integer>'
|
31
32
|
end
|
data/types/ruby-2.x/numeric.rb
CHANGED
@@ -1,44 +1,54 @@
|
|
1
1
|
class Numeric
|
2
2
|
rdl_nowrap
|
3
3
|
|
4
|
-
type
|
4
|
+
type :%, '(Numeric) -> Numeric'
|
5
|
+
pre(:%) { |x| x!=0}
|
6
|
+
type :+, '(Numeric) -> Numeric'
|
5
7
|
type :-, '() -> Numeric'
|
6
|
-
type :<=>, '(Numeric) ->
|
8
|
+
type :<=>, '(Numeric) -> Object'
|
9
|
+
post(:<=>) { |r,x| r == -1 || r==0 || r==1 || r==nil}
|
7
10
|
type :abs, '() -> Numeric'
|
8
|
-
|
9
|
-
type :
|
10
|
-
|
11
|
+
post(:abs) { |r,x| r >= 0 }
|
12
|
+
type :abs2, '() -> Numeric'
|
13
|
+
post(:abs2) { |r,x| r >= 0 }
|
14
|
+
type :angle, '() -> Numeric'
|
15
|
+
type :arg, '() -> Numeric'
|
11
16
|
type :ceil, '() -> Integer'
|
12
17
|
type :coerce, '(Numeric) -> [Numeric, Numeric]'
|
13
|
-
type :conj, '() ->
|
14
|
-
|
18
|
+
type :conj, '() -> Numeric'
|
19
|
+
type :conjugate, '() -> Numeric'
|
15
20
|
type :denominator, '() -> Integer'
|
16
|
-
post(:denominator) { |r,
|
21
|
+
post(:denominator) { |r,x| r >= 0 }
|
17
22
|
type :div, '(Numeric) -> Integer'
|
23
|
+
pre(:div) { |x| x!=0}
|
18
24
|
type :divmod, '(Numeric) -> [Numeric, Numeric]'
|
25
|
+
pre(:divmod) { |x| x!=0 }
|
19
26
|
type :eql?, '(Numeric) -> %bool'
|
20
|
-
type :fdiv, '(Numeric) ->
|
27
|
+
type :fdiv, '(Numeric) -> Numeric'
|
21
28
|
type :floor, '() -> Integer'
|
22
29
|
type :i, '() -> Complex'
|
23
|
-
type :imag, '() ->
|
24
|
-
|
25
|
-
# initialize_copy can't be invoked
|
30
|
+
type :imag, '() -> Numeric'
|
31
|
+
type :imaginary, '() -> Numeric'
|
26
32
|
type :integer?, '() -> %bool'
|
27
33
|
type :magnitude, '() -> Numeric'
|
28
34
|
type :modulo, '(Numeric) -> %real'
|
35
|
+
pre(:modulo) { |x| x!=0 }
|
29
36
|
type :nonzero?, '() -> self or nil'
|
30
37
|
type :numerator, '() -> Integer'
|
31
|
-
type :phase, '() ->
|
38
|
+
type :phase, '() -> Numeric'
|
32
39
|
type :polar, '() -> [Numeric, Numeric]'
|
33
|
-
type :quo, '(
|
34
|
-
type :
|
35
|
-
type :real
|
36
|
-
type :rect, '() -> [Numeric,
|
37
|
-
|
40
|
+
type :quo, '(Numeric) -> Numeric'
|
41
|
+
type :real, '() -> Numeric'
|
42
|
+
type :real?, '() -> Numeric'
|
43
|
+
type :rect, '() -> [Numeric, Numeric]'
|
44
|
+
type :rectangular, '() -> [Numeric, Numeric]'
|
38
45
|
type :remainder, '(Numeric) -> %real'
|
39
|
-
type :round, '(
|
40
|
-
|
41
|
-
|
46
|
+
type :round, '(Numeric) -> Numeric'
|
47
|
+
type :singleton_method_added, '(Symbol) -> TypeError'
|
48
|
+
type :step, '(Numeric) { (Numeric) -> %any } -> Numeric'
|
49
|
+
type :step, '(Numeric) -> Enumerator<Numeric>'
|
50
|
+
type :step, '(Numeric, Numeric) { (Numeric) -> %any } -> Numeric'
|
51
|
+
type :step, '(Numeric, Numeric) -> Enumerator<Numeric>'
|
42
52
|
type :to_c, '() -> Complex'
|
43
53
|
type :to_int, '() -> Integer'
|
44
54
|
type :truncate, '() -> Integer'
|
data/types/ruby-2.x/rational.rb
CHANGED
@@ -1,31 +1,209 @@
|
|
1
|
-
class Rational
|
1
|
+
class Rational < Numeric
|
2
2
|
rdl_nowrap
|
3
3
|
|
4
|
-
type
|
5
|
-
|
6
|
-
type
|
7
|
-
|
8
|
-
type
|
9
|
-
|
10
|
-
type
|
4
|
+
type :%, '(Integer) -> Rational'
|
5
|
+
pre(:%) { |x| x!=0}
|
6
|
+
type :%, '(Float) -> Float'
|
7
|
+
pre(:%) { |x| x!=0&&!x.nan?}
|
8
|
+
type :%, '(Rational) -> Rational'
|
9
|
+
pre(:%) { |x| x!=0}
|
10
|
+
type :%, '(BigDecimal) -> BigDecimal'
|
11
|
+
pre(:%) { |x| x!=0&&!x.nan?}
|
12
|
+
|
13
|
+
type :*, '(Integer) -> Rational'
|
14
|
+
type :*, '(Float) -> Float'
|
15
|
+
type :*, '(Rational) -> Rational'
|
16
|
+
type :*, '(BigDecimal) -> BigDecimal'
|
17
|
+
type :*, '(Complex) -> Complex'
|
18
|
+
pre(:*) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end} #can't have a complex with part BigDecimal, other part infinity/NAN
|
19
|
+
|
20
|
+
type :+, '(Integer) -> Rational'
|
21
|
+
type :+, '(Float) -> Float'
|
22
|
+
type :+, '(Rational) -> Rational'
|
23
|
+
type :+, '(BigDecimal) -> BigDecimal'
|
24
|
+
type :+, '(Complex) -> Complex'
|
25
|
+
|
26
|
+
type :-, '(Integer) -> Rational'
|
27
|
+
type :-, '(Float) -> Float'
|
28
|
+
type :-, '(Rational) -> Rational'
|
29
|
+
type :-, '(BigDecimal) -> BigDecimal'
|
30
|
+
type :-, '(Complex) -> Complex'
|
31
|
+
|
32
|
+
type :-, '() -> Rational'
|
33
|
+
|
34
|
+
type :**, '(Integer) -> Numeric'
|
35
|
+
type :**, '(Float) -> Numeric'
|
36
|
+
type :**, '(Rational) -> Numeric'
|
37
|
+
type :**, '(BigDecimal) -> BigDecimal'
|
38
|
+
pre(:**) { |x| x!=BigDecimal::INFINITY && if self<0 then x<=-1||x>=0 else true end}
|
39
|
+
post(:**) { |r,x| r.real?}
|
40
|
+
type :**, '(Complex) -> Complex'
|
41
|
+
pre(:**) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end}
|
42
|
+
|
43
|
+
type :/, '(Integer) -> Rational'
|
44
|
+
pre(:/) { |x| x!=0}
|
45
|
+
type :/, '(Float) -> Float'
|
46
|
+
pre(:/) { |x| x!=0}
|
47
|
+
type :/, '(Rational) -> Rational'
|
48
|
+
pre(:/) { |x| x!=0}
|
49
|
+
type :/, '(BigDecimal) -> BigDecimal'
|
50
|
+
pre(:/) { |x| x!=0}
|
51
|
+
type :/, '(Complex) -> Complex'
|
52
|
+
pre(:/) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
53
|
+
|
54
|
+
type :<, '(Integer) -> %bool'
|
55
|
+
type :<, '(Float) -> %bool'
|
56
|
+
pre(:<) { |x| !x.nan?}
|
57
|
+
type :<, '(Rational) -> %bool'
|
58
|
+
type :<, '(BigDecimal) -> %bool'
|
59
|
+
pre(:<) { |x| !x.nan?}
|
60
|
+
|
61
|
+
type :<=, '(Integer) -> %bool'
|
62
|
+
type :<=, '(Float) -> %bool'
|
63
|
+
pre(:<=) { |x| !x.nan?}
|
64
|
+
type :<=, '(Rational) -> %bool'
|
65
|
+
type :<=, '(BigDecimal) -> %bool'
|
66
|
+
pre(:<=) { |x| !x.nan?}
|
67
|
+
|
68
|
+
type :>, '(Integer) -> %bool'
|
69
|
+
type :>, '(Float) -> %bool'
|
70
|
+
pre(:>) { |x| !x.nan?}
|
71
|
+
type :>, '(Rational) -> %bool'
|
72
|
+
type :>, '(BigDecimal) -> %bool'
|
73
|
+
pre(:>) { |x| !x.nan?}
|
74
|
+
|
75
|
+
type :>=, '(Integer) -> %bool'
|
76
|
+
type :>=, '(Float) -> %bool'
|
77
|
+
pre(:>=) { |x| !x.nan?}
|
78
|
+
type :>=, '(Rational) -> %bool'
|
79
|
+
type :>=, '(BigDecimal) -> %bool'
|
80
|
+
pre(:>=) { |x| !x.nan?}
|
81
|
+
|
82
|
+
type :<=>, '(Integer) -> Object'
|
83
|
+
post(:<=>) { |r,x| r == -1 || r==0 || r==1}
|
84
|
+
type :<=>, '(Float) -> Object'
|
85
|
+
post(:<=>) { |r,x| r == -1 || r==0 || r==1}
|
86
|
+
type :<=>, '(Rational) -> Object'
|
87
|
+
post(:<=>) { |r,x| r == -1 || r==0 || r==1}
|
88
|
+
type :<=>, '(BigDecimal) -> Object'
|
89
|
+
post(:<=>) { |r,x| r == -1 || r==0 || r==1}
|
90
|
+
|
91
|
+
type :==, '(Object) -> %bool'
|
92
|
+
|
93
|
+
type :abs, '() -> Rational'
|
94
|
+
post(:abs) { |r,x| r >= 0 }
|
95
|
+
|
96
|
+
type :abs2, '() -> Rational'
|
97
|
+
post(:abs2) { |r,x| r >= 0 }
|
98
|
+
|
99
|
+
type :angle, '() -> Numeric'
|
100
|
+
post(:angle) { |r,x| r == 0 || r == Math::PI}
|
101
|
+
|
102
|
+
type :arg, '() -> Numeric'
|
103
|
+
post(:arg) { |r,x| r == 0 || r == Math::PI}
|
104
|
+
|
105
|
+
type :div, '(Fixnum) -> Integer'
|
106
|
+
pre(:div) { |x| x!=0}
|
107
|
+
type :div, '(Bignum) -> Integer'
|
108
|
+
pre(:div) { |x| x!=0}
|
109
|
+
type :div, '(Float) -> Integer'
|
110
|
+
pre(:div) { |x| x!=0 && !x.nan?}
|
111
|
+
type :div, '(Rational) -> Integer'
|
112
|
+
pre(:div) { |x| x!=0}
|
113
|
+
type :div, '(BigDecimal) -> Integer'
|
114
|
+
pre(:div) { |x| x!=0 && !x.nan?}
|
115
|
+
|
116
|
+
type :modulo, '(Integer) -> Rational'
|
117
|
+
pre(:modulo) { |x| x!=0}
|
118
|
+
type :modulo, '(Float) -> Float'
|
119
|
+
pre(:modulo) { |x| x!=0&&!x.nan?}
|
120
|
+
type :modulo, '(Rational) -> Rational'
|
121
|
+
pre(:modulo) { |x| x!=0}
|
122
|
+
type :modulo, '(BigDecimal) -> BigDecimal'
|
123
|
+
pre(:modulo) { |x| x!=0&&!x.nan?}
|
124
|
+
|
11
125
|
type :ceil, '() -> Integer'
|
12
|
-
type :ceil, '(
|
126
|
+
type :ceil, '(Integer) -> Numeric'
|
127
|
+
|
13
128
|
type :denominator, '() -> Integer'
|
14
|
-
post(:denominator) { |r,
|
15
|
-
|
129
|
+
post(:denominator) { |r,x| r > 0 }
|
130
|
+
|
131
|
+
type :divmod, '(%real) -> [%real, %real]'
|
132
|
+
pre(:divmod) { |x| x!=0 && if x.is_a?(BigDecimal) then !x.nan? else true end}
|
133
|
+
|
134
|
+
type :equal?, '(Object) -> %bool'
|
135
|
+
|
136
|
+
type :fdiv, '(Integer) -> Float'
|
137
|
+
type :fdiv, '(Float) -> Float'
|
138
|
+
type :fdiv, '(Rational) -> Float'
|
139
|
+
type :fdiv, '(BigDecimal) -> Float'
|
140
|
+
type :fdiv, '(Complex) -> Float'
|
141
|
+
pre(:fdiv) { |x| x.imaginary==0 && x.real.class != Float}
|
142
|
+
|
16
143
|
type :floor, '() -> Integer'
|
17
|
-
|
144
|
+
|
145
|
+
type :floor, '(Integer) -> Numeric'
|
146
|
+
|
147
|
+
type :hash, '() -> Integer'
|
148
|
+
|
18
149
|
type :inspect, '() -> String'
|
150
|
+
|
19
151
|
type :numerator, '() -> Integer'
|
20
|
-
|
21
|
-
type :
|
22
|
-
|
152
|
+
|
153
|
+
type :phase, '() -> Numeric'
|
154
|
+
|
155
|
+
type :quo, '(Integer) -> Rational'
|
156
|
+
pre(:quo) { |x| x!=0}
|
157
|
+
type :quo, '(Float) -> Float'
|
158
|
+
pre(:quo) { |x| x!=0}
|
159
|
+
type :quo, '(Rational) -> Rational'
|
160
|
+
pre(:quo) { |x| x!=0}
|
161
|
+
type :quo, '(BigDecimal) -> BigDecimal'
|
162
|
+
pre(:quo) { |x| x!=0}
|
163
|
+
type :quo, '(Complex) -> Complex'
|
164
|
+
pre(:quo) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
165
|
+
|
166
|
+
type :rationalize, '() -> Rational'
|
167
|
+
|
168
|
+
type :rationalize, '(Numeric) -> Rational'
|
169
|
+
pre(:quo) { |x| if x.is_a?(Float) then x!=Float::INFINITY && !x.nan? else true end}
|
170
|
+
|
23
171
|
type :round, '() -> Integer'
|
24
|
-
|
172
|
+
|
173
|
+
type :round, '(Integer) -> Numeric'
|
174
|
+
|
25
175
|
type :to_f, '() -> Float'
|
176
|
+
pre(:to_f) { self<=Float::MAX}
|
177
|
+
|
26
178
|
type :to_i, '() -> Integer'
|
27
|
-
|
179
|
+
|
180
|
+
type :to_r, '() -> Rational'
|
181
|
+
|
28
182
|
type :to_s, '() -> String'
|
183
|
+
|
29
184
|
type :truncate, '() -> Integer'
|
30
|
-
|
185
|
+
|
186
|
+
type :truncate, '(Integer) -> Rational'
|
187
|
+
|
188
|
+
type :zero?, '() -> %bool'
|
189
|
+
|
190
|
+
type :conj, '() -> Rational'
|
191
|
+
type :conjugate, '() -> Rational'
|
192
|
+
|
193
|
+
type :imag, '() -> Fixnum'
|
194
|
+
post(:imag) { |r,x| r == 0 }
|
195
|
+
type :imaginary, '() -> Fixnum'
|
196
|
+
post(:imaginary) { |r,x| r == 0 }
|
197
|
+
|
198
|
+
type :real, '() -> Rational'
|
199
|
+
|
200
|
+
type :real?, '() -> TrueClass'
|
201
|
+
|
202
|
+
type :to_c, '() -> Complex'
|
203
|
+
post(:to_c) { |r,x| r.imaginary == 0 }
|
204
|
+
|
205
|
+
type :coerce, '(Integer) -> [Rational, Rational]'
|
206
|
+
type :coerce, '(Float) -> [Float, Float]'
|
207
|
+
type :coerce, '(Rational) -> [Rational, Rational]'
|
208
|
+
type :coerce, '(Complex) -> [Numeric, Numeric]'
|
31
209
|
end
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeffrey S. Foster
|
8
8
|
- Brianna M. Ren
|
9
9
|
- T. Stephen Strickland
|
10
10
|
- Alexander T. Yu
|
11
|
+
- Milod Kazerounian
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2016-
|
15
|
+
date: 2016-05-21 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: require_all
|
@@ -48,10 +49,69 @@ extra_rdoc_files: []
|
|
48
49
|
files:
|
49
50
|
- ".gitignore"
|
50
51
|
- ".travis.yml"
|
52
|
+
- CHANGES.md
|
51
53
|
- LICENSE
|
52
54
|
- README.md
|
53
55
|
- Rakefile
|
54
56
|
- bin/rdl_query
|
57
|
+
- extras/type_tests/%.rb
|
58
|
+
- extras/type_tests/&.rb
|
59
|
+
- extras/type_tests/**.rb
|
60
|
+
- extras/type_tests/*.rb
|
61
|
+
- extras/type_tests/+.rb
|
62
|
+
- extras/type_tests/-.rb
|
63
|
+
- extras/type_tests/1scomp.rb
|
64
|
+
- extras/type_tests/<.rb
|
65
|
+
- extras/type_tests/<<.rb
|
66
|
+
- extras/type_tests/>>.rb
|
67
|
+
- extras/type_tests/[].rb
|
68
|
+
- extras/type_tests/^.rb
|
69
|
+
- extras/type_tests/abs.rb
|
70
|
+
- extras/type_tests/abs2.rb
|
71
|
+
- extras/type_tests/angle.rb
|
72
|
+
- extras/type_tests/arg.rb
|
73
|
+
- extras/type_tests/bit_length.rb
|
74
|
+
- extras/type_tests/ceil.rb
|
75
|
+
- extras/type_tests/ceilRational.rb
|
76
|
+
- extras/type_tests/conj.rb
|
77
|
+
- extras/type_tests/defwhere.rb
|
78
|
+
- extras/type_tests/denominator.rb
|
79
|
+
- extras/type_tests/div.rb
|
80
|
+
- extras/type_tests/divslash.rb
|
81
|
+
- extras/type_tests/even?.rb
|
82
|
+
- extras/type_tests/fdiv.rb
|
83
|
+
- extras/type_tests/finite?.rb
|
84
|
+
- extras/type_tests/floor.rb
|
85
|
+
- extras/type_tests/floorRational.rb
|
86
|
+
- extras/type_tests/hash.rb
|
87
|
+
- extras/type_tests/imag.rb
|
88
|
+
- extras/type_tests/infinite?.rb
|
89
|
+
- extras/type_tests/modulo.rb
|
90
|
+
- extras/type_tests/nan?.rb
|
91
|
+
- extras/type_tests/neg.rb
|
92
|
+
- extras/type_tests/next.rb
|
93
|
+
- extras/type_tests/next_float.rb
|
94
|
+
- extras/type_tests/numerator.rb
|
95
|
+
- extras/type_tests/phase.rb
|
96
|
+
- extras/type_tests/prev_float.rb
|
97
|
+
- extras/type_tests/quo.rb
|
98
|
+
- extras/type_tests/rationalize.rb
|
99
|
+
- extras/type_tests/rationalizeArg.rb
|
100
|
+
- extras/type_tests/real.rb
|
101
|
+
- extras/type_tests/real?.rb
|
102
|
+
- extras/type_tests/round.rb
|
103
|
+
- extras/type_tests/roundArg.rb
|
104
|
+
- extras/type_tests/size.rb
|
105
|
+
- extras/type_tests/to_c.rb
|
106
|
+
- extras/type_tests/to_f.rb
|
107
|
+
- extras/type_tests/to_i.rb
|
108
|
+
- extras/type_tests/to_r.rb
|
109
|
+
- extras/type_tests/to_s.rb
|
110
|
+
- extras/type_tests/truncate.rb
|
111
|
+
- extras/type_tests/truncateArg.rb
|
112
|
+
- extras/type_tests/type tests
|
113
|
+
- extras/type_tests/zero?.rb
|
114
|
+
- extras/type_tests/|.rb
|
55
115
|
- gemfiles/Gemfile.travis
|
56
116
|
- lib/rails_types.rb
|
57
117
|
- lib/rdl.rb
|
@@ -63,7 +123,9 @@ files:
|
|
63
123
|
- lib/rdl/contracts/proc.rb
|
64
124
|
- lib/rdl/query.rb
|
65
125
|
- lib/rdl/switch.rb
|
126
|
+
- lib/rdl/types/.#lexer.rex
|
66
127
|
- lib/rdl/types/annotated_arg.rb
|
128
|
+
- lib/rdl/types/dependent_arg.rb
|
67
129
|
- lib/rdl/types/dots_query.rb
|
68
130
|
- lib/rdl/types/finitehash.rb
|
69
131
|
- lib/rdl/types/generic.rb
|
@@ -121,6 +183,7 @@ files:
|
|
121
183
|
- types/ruby-2.x/benchmark.rb
|
122
184
|
- types/ruby-2.x/bigdecimal.rb
|
123
185
|
- types/ruby-2.x/bigmath.rb
|
186
|
+
- types/ruby-2.x/bignum.rb
|
124
187
|
- types/ruby-2.x/class.rb
|
125
188
|
- types/ruby-2.x/complex.rb
|
126
189
|
- types/ruby-2.x/coverage.rb
|
@@ -173,9 +236,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
173
236
|
version: '0'
|
174
237
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
175
238
|
requirements:
|
176
|
-
- - "
|
239
|
+
- - ">"
|
177
240
|
- !ruby/object:Gem::Version
|
178
|
-
version:
|
241
|
+
version: 1.3.1
|
179
242
|
requirements: []
|
180
243
|
rubyforge_project:
|
181
244
|
rubygems_version: 2.5.1
|