@@ -745,6 +745,14 @@ cdef class Basic(object):
745
745
def is_Symbol (self ):
746
746
return False
747
747
748
+ @property
749
+ def is_symbol (self ):
750
+ return False
751
+
752
+ @property
753
+ def is_Dummy (self ):
754
+ return False
755
+
748
756
@property
749
757
def is_Function (self ):
750
758
return False
@@ -765,6 +773,10 @@ cdef class Basic(object):
765
773
def is_Number (self ):
766
774
return False
767
775
776
+ @property
777
+ def is_number (self ):
778
+ return None
779
+
768
780
@property
769
781
def is_Float (self ):
770
782
return False
@@ -777,10 +789,38 @@ cdef class Basic(object):
777
789
def is_Integer (self ):
778
790
return False
779
791
792
+ @property
793
+ def is_integer (self ):
794
+ return False
795
+
796
+ @property
797
+ def is_finite (self ):
798
+ return None
799
+
780
800
@property
781
801
def is_Derivative (self ):
782
802
return False
783
803
804
+ @property
805
+ def is_AlgebraicNumber (self ):
806
+ return False
807
+
808
+ @property
809
+ def is_Relational (self ):
810
+ return False
811
+
812
+ @property
813
+ def is_Equality (self ):
814
+ return False
815
+
816
+ @property
817
+ def is_Boolean (self ):
818
+ return False
819
+
820
+ @property
821
+ def is_Not (self ):
822
+ return False
823
+
784
824
@property
785
825
def is_Matrix (self ):
786
826
return False
@@ -907,6 +947,14 @@ class Symbol(Basic):
907
947
def is_Symbol (self ):
908
948
return True
909
949
950
+ @property
951
+ def is_symbol (self ):
952
+ return True
953
+
954
+ @property
955
+ def is_commutative (self ):
956
+ return True
957
+
910
958
@property
911
959
def func (self ):
912
960
return self .__class__
@@ -998,7 +1046,14 @@ class Boolean(Basic):
998
1046
999
1047
1000
1048
class BooleanAtom (Boolean ):
1001
- pass
1049
+
1050
+ @property
1051
+ def is_Boolean (self ):
1052
+ return True
1053
+
1054
+ @property
1055
+ def is_Atom (self ):
1056
+ return True
1002
1057
1003
1058
1004
1059
class BooleanTrue (BooleanAtom ):
@@ -1022,7 +1077,10 @@ class BooleanFalse(BooleanAtom):
1022
1077
1023
1078
1024
1079
class Relational (Boolean ):
1025
- pass
1080
+
1081
+ @property
1082
+ def is_Relational (self ):
1083
+ return True
1026
1084
1027
1085
Rel = Relational
1028
1086
@@ -1042,6 +1100,10 @@ class Equality(Relational):
1042
1100
s = self .args_as_sage()
1043
1101
return sage.eq(* s)
1044
1102
1103
+ @property
1104
+ def is_Equality (self ):
1105
+ return True
1106
+
1045
1107
func = __class__
1046
1108
1047
1109
@@ -1116,6 +1178,14 @@ cdef class Number(Basic):
1116
1178
def is_Number (self ):
1117
1179
return True
1118
1180
1181
+ @property
1182
+ def is_number (self ):
1183
+ return True
1184
+
1185
+ @property
1186
+ def is_commutative (self ):
1187
+ return True
1188
+
1119
1189
@property
1120
1190
def is_positive (Basic self ):
1121
1191
return deref(symengine.rcp_static_cast_Number(self .thisptr)).is_positive()
@@ -1154,6 +1224,22 @@ class Rational(Number):
1154
1224
def is_Rational (self ):
1155
1225
return True
1156
1226
1227
+ @property
1228
+ def is_rational (self ):
1229
+ return True
1230
+
1231
+ @property
1232
+ def is_real (self ):
1233
+ return True
1234
+
1235
+ @property
1236
+ def is_finite (self ):
1237
+ return True
1238
+
1239
+ @property
1240
+ def is_integer (self ):
1241
+ return False
1242
+
1157
1243
@property
1158
1244
def p (self ):
1159
1245
return self .get_num_den()[0 ]
@@ -1210,6 +1296,10 @@ class Integer(Rational):
1210
1296
def is_Integer (self ):
1211
1297
return True
1212
1298
1299
+ @property
1300
+ def is_integer (self ):
1301
+ return True
1302
+
1213
1303
def __hash__ (Basic self ):
1214
1304
return deref(self .thisptr).hash()
1215
1305
@@ -1298,6 +1388,22 @@ class BasicMeta(type):
1298
1388
1299
1389
class Float (Number ):
1300
1390
1391
+ @property
1392
+ def is_rational (self ):
1393
+ return None
1394
+
1395
+ @property
1396
+ def is_irrational (self ):
1397
+ return None
1398
+
1399
+ @property
1400
+ def is_real (self ):
1401
+ return True
1402
+
1403
+ @property
1404
+ def is_Float (self ):
1405
+ return True
1406
+
1301
1407
def __new__ (cls , num , dps = None , precision = None ):
1302
1408
if cls is not Float:
1303
1409
return super (Float, cls ).__new__(cls )
@@ -1328,10 +1434,6 @@ RealNumber = Float
1328
1434
1329
1435
class RealDouble (Float ):
1330
1436
1331
- @property
1332
- def is_Float (self ):
1333
- return True
1334
-
1335
1437
def __new__ (cls , i ):
1336
1438
cdef double i_ = i
1337
1439
return c2py(symengine.make_rcp_RealDouble(i_))
@@ -1374,10 +1476,6 @@ cdef class ComplexDouble(Number):
1374
1476
1375
1477
class RealMPFR (Float ):
1376
1478
1377
- @property
1378
- def is_Float (self ):
1379
- return True
1380
-
1381
1479
IF HAVE_SYMENGINE_MPFR:
1382
1480
def __new__ (cls , i = None , long prec = 53 , unsigned base = 10 ):
1383
1481
if i is None :
@@ -1458,6 +1556,10 @@ cdef class Complex(Number):
1458
1556
1459
1557
class Infinity (Number ):
1460
1558
1559
+ @property
1560
+ def is_infinite (self ):
1561
+ return True
1562
+
1461
1563
def __new__ (cls ):
1462
1564
return oo
1463
1565
@@ -1471,6 +1573,10 @@ class Infinity(Number):
1471
1573
1472
1574
class NegativeInfinity (Number ):
1473
1575
1576
+ @property
1577
+ def is_infinite (self ):
1578
+ return True
1579
+
1474
1580
def __new__ (cls ):
1475
1581
return - oo
1476
1582
@@ -1484,6 +1590,10 @@ class NegativeInfinity(Number):
1484
1590
1485
1591
class ComplexInfinity (Number ):
1486
1592
1593
+ @property
1594
+ def is_infinite (self ):
1595
+ return True
1596
+
1487
1597
def __new__ (cls ):
1488
1598
return zoo
1489
1599
@@ -1497,6 +1607,22 @@ class ComplexInfinity(Number):
1497
1607
1498
1608
class NaN (Number ):
1499
1609
1610
+ @property
1611
+ def is_rational (self ):
1612
+ return None
1613
+
1614
+ @property
1615
+ def is_integer (self ):
1616
+ return None
1617
+
1618
+ @property
1619
+ def is_real (self ):
1620
+ return None
1621
+
1622
+ @property
1623
+ def is_finite (self ):
1624
+ return None
1625
+
1500
1626
def __new__ (cls ):
1501
1627
return nan
1502
1628
@@ -1784,6 +1910,15 @@ class polygamma(Function):
1784
1910
return sympy.polygamma(* self .args_as_sympy())
1785
1911
1786
1912
class sign (OneArgFunction ):
1913
+
1914
+ @property
1915
+ def is_complex (self ):
1916
+ return True
1917
+
1918
+ @property
1919
+ def is_finite (self ):
1920
+ return True
1921
+
1787
1922
def __new__ (cls , x ):
1788
1923
cdef Basic X = sympify(x)
1789
1924
return c2py(symengine.sign(X.thisptr))
@@ -1977,6 +2112,14 @@ mul = Mul
1977
2112
1978
2113
class Abs (OneArgFunction ):
1979
2114
2115
+ @property
2116
+ def is_real (self ):
2117
+ return True
2118
+
2119
+ @property
2120
+ def is_negative (self ):
2121
+ return False
2122
+
1980
2123
def __new__ (cls , x ):
1981
2124
cdef Basic X = sympify(x)
1982
2125
return c2py(symengine.abs(X.thisptr))
0 commit comments