/usr/share/doc/maxima-doc/html/maxima_11.html is in maxima-doc 5.32.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on January, 10 2014 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>
-->
<head>
<title>Maxima 5.32.1 Manual: 11. Maximas Database</title>
<meta name="description" content="Maxima 5.32.1 Manual: 11. Maximas Database">
<meta name="keywords" content="Maxima 5.32.1 Manual: 11. Maximas Database">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
color: black;
background: white;
margin-left: 8%;
margin-right: 13%;
}
h1
{
margin-left: +8%;
font-size: 150%;
font-family: sans-serif
}
h2
{
font-size: 125%;
font-family: sans-serif
}
h3
{
font-size: 100%;
font-family: sans-serif
}
h2,h3,h4,h5,h6 { margin-left: +4%; }
div.textbox
{
border: solid;
border-width: thin;
/* width: 100%; */
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em
}
div.titlebox
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em;
background: rgb(200,255,255);
font-family: sans-serif
}
div.synopsisbox
{
border: none;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 2em;
padding-right: 2em;
background: rgb(255,220,255);
/*background: rgb(200,255,255); */
/* font-family: fixed */
}
pre.example
{
border: 1px solid gray;
padding-top: 1em;
padding-bottom: 1em;
padding-left: 1em;
padding-right: 1em;
/* background: rgb(247,242,180); */ /* kind of sandy */
/* background: rgb(200,255,255); */ /* sky blue */
background-color: #F1F5F9; /* light blue-gray */
/* font-family: "Lucida Console", monospace */
}
div.spacerbox
{
border: none;
padding-top: 2em;
padding-bottom: 2em
}
div.image
{
margin: 0;
padding: 1em;
text-align: center;
}
div.categorybox
{
border: 1px solid gray;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 1em;
padding-right: 1em;
background: rgb(247,242,220);
}
-->
</style>
<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Maximas-Database"></a>
<a name="SEC56"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_10.html#SEC55" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC57" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima_10.html#SEC47" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_82.html#SEC380" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 11. Maximas Database </h1>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC57">11.1 Introduction to Maximas Database</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC58">11.2 Functions and Variables for Properties</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC59">11.3 Functions and Variables for Facts</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC60">11.4 Functions and Variables for Predicates</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<p><a name="Item_003a-Introduction-to-Maximas-Database"></a>
</p><hr size="6">
<a name="Introduction-to-Maximas-Database"></a>
<a name="SEC57"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC56" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC58" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC56" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC56" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_82.html#SEC380" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 11.1 Introduction to Maximas Database </h2>
<p><a name="Item_003a-Functions-and-Variables-for-Properties"></a>
</p><hr size="6">
<a name="Functions-and-Variables-for-Properties"></a>
<a name="SEC58"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC57" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC59" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC56" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC56" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_82.html#SEC380" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 11.2 Functions and Variables for Properties </h2>
<p><a name="alphabetic"></a>
<a name="Item_003a-alphabetic"></a>
</p><dl>
<dt><u>Property:</u> <b>alphabetic</b>
<a name="IDX416"></a>
</dt>
<dd><p><code>alphabetic</code> is a property type recognized by <code><a href="#declare">declare</a></code>.
The expression <code>declare(<var>s</var>, alphabetic)</code> tells Maxima to recognize
as alphabetic all of the characters in <var>s</var>, which must be a string.
</p>
<p>See also <a href="maxima_6.html#SEC32">Identifiers</a>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) xx\~yy\`\@ : 1729;
(%o1) 1729
(%i2) declare ("~`@", alphabetic);
(%o2) done
(%i3) xx~yy`@ + @yy`xx + `xx@@yy~;
(%o3) `xx@@yy~ + @yy`xx + 1729
(%i4) listofvars (%);
(%o4) [@yy`xx, `xx@@yy~]
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="bindtest"></a>
<a name="Item_003a-bindtest"></a>
</p><dl>
<dt><u>Property:</u> <b>bindtest</b>
<a name="IDX417"></a>
</dt>
<dd><p>The command <code>declare(<var>x</var>, bindtest</code>) tells Maxima to trigger an error
when the symbol <var>x</var> is evaluated unbound.
</p>
<pre class="example">(%i1) aa + bb;
(%o1) bb + aa
(%i2) declare (aa, bindtest);
(%o2) done
(%i3) aa + bb;
aa unbound variable
-- an error. Quitting. To debug this try debugmode(true);
(%i4) aa : 1234;
(%o4) 1234
(%i5) aa + bb;
(%o5) bb + 1234
</pre></dd></dl>
<p><a name="constant"></a>
<a name="Item_003a-constant"></a>
</p><dl>
<dt><u>Property:</u> <b>constant</b>
<a name="IDX418"></a>
</dt>
<dd><p><code>declare(<var>a</var>, constant)</code> declares <var>a</var> to be a constant. The
declaration of a symbol to be constant does not prevent the assignment of a
nonconstant value to the symbol.
</p>
<p>See <code><a href="#constantp">constantp</a></code> and <code><a href="#declare">declare</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) declare(c, constant);
(%o1) done
(%i2) constantp(c);
(%o2) true
(%i3) c : x;
(%o3) x
(%i4) constantp(c);
(%o4) false
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences} ·
@ref{Category: Constants}
</div>
</p></dd></dl>
<p><a name="constantp"></a>
<a name="Item_003a-constantp"></a>
</p><dl>
<dt><u>Function:</u> <b>constantp</b><i> (<var>expr</var>)</i>
<a name="IDX419"></a>
</dt>
<dd><p>Returns <code>true</code> if <var>expr</var> is a constant expression, otherwise returns
<code>false</code>.
</p>
<p>An expression is considered a constant expression if its arguments are
numbers (including rational numbers, as displayed with <code>/R/</code>),
symbolic constants such as <code><a href="maxima_5.html#g_t_0025pi">%pi</a></code>, <code><a href="maxima_5.html#g_t_0025e">%e</a></code>, and <code><a href="maxima_5.html#g_t_0025i">%i</a></code>,
variables bound to a constant or declared constant by <code><a href="#declare">declare</a></code>,
or functions whose arguments are constant.
</p>
<p><code>constantp</code> evaluates its arguments.
</p>
<p>See the property <code><a href="#constant">constant</a></code> which declares a symbol to be constant.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) constantp (7 * sin(2));
(%o1) true
(%i2) constantp (rat (17/29));
(%o2) true
(%i3) constantp (%pi * sin(%e));
(%o3) true
(%i4) constantp (exp (x));
(%o4) false
(%i5) declare (x, constant);
(%o5) done
(%i6) constantp (exp (x));
(%o6) true
(%i7) constantp (foo (x) + bar (%e) + baz (2));
(%o7) false
(%i8)
</pre>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Constants}
</div>
</p></dd></dl>
<p><a name="declare"></a>
<a name="Item_003a-declare"></a>
</p><dl>
<dt><u>Function:</u> <b>declare</b><i> (<var>a_1</var>, <var>p_1</var>, <var>a_2</var>, <var>p_2</var>, …)</i>
<a name="IDX420"></a>
</dt>
<dd><p>Assigns the atom or list of atoms <var>a_i</var> the property or list of properties
<var>p_i</var>. When <var>a_i</var> and/or <var>p_i</var> are lists, each of the atoms gets
all of the properties.
</p>
<p><code>declare</code> quotes its arguments. <code>declare</code> always returns <code>done</code>.
</p>
<p>As noted in the description for each declaration flag, for some flags
<code>featurep(<var>object</var>, <var>feature</var>)</code> returns <code>true</code> if <var>object</var>
has been declared to have <var>feature</var>.
</p>
<p>For more information about the features system, see <code><a href="#features">features</a></code>. To
remove a property from an atom, use <code><a href="#remove">remove</a></code>.
</p>
<p><code>declare</code> recognizes the following properties:
</p>
<dl compact="compact">
<dt> <code>additive</code></dt>
<dd><p> Tells Maxima to simplify <var>a_i</var> expressions by the substitution
<code><var>a_i</var>(x + y + z + ...)</code> <code>--></code>
<code><var>a_i</var>(x) + <var>a_i</var>(y) + <var>a_i</var>(z) + ...</code>.
The substitution is carried out on the first argument only.
</p>
</dd>
<dt> <code>alphabetic</code></dt>
<dd><p> Tells Maxima to recognize all characters in <var>a_i</var> (which must be a
string) as alphabetic characters.
</p>
</dd>
<dt> <code>antisymmetric, commutative, symmetric</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as a symmetric or antisymmetric
function. <code><a href="maxima_9.html#commutative">commutative</a></code> is the same as <code>symmetric</code>.
</p>
</dd>
<dt> <code>bindtest</code></dt>
<dd><p> Tells Maxima to trigger an error when <var>a_i</var> is evaluated unbound.
</p>
</dd>
<dt> <code>constant</code></dt>
<dd><p> Tells Maxima to consider <var>a_i</var> a symbolic constant.
</p>
</dd>
<dt> <code>even, odd</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as an even or odd integer variable.
</p>
</dd>
<dt> <code>evenfun, oddfun</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as an odd or even function.
</p>
</dd>
<dt> <code>evflag</code></dt>
<dd><p> Makes <var>a_i</var> known to the <code>ev</code> function so that <var>a_i</var> is bound
to <code>true</code> during the execution of <code>ev</code> when <var>a_i</var> appears as
a flag argument of <code>ev</code>. See <code><a href="maxima_8.html#evflag">evflag</a></code>.
</p>
</dd>
<dt> <code>evfun</code></dt>
<dd><p> Makes <var>a_i</var> known to <code>ev</code> so that the function named by <var>a_i</var>
is applied when <var>a_i</var> appears as a flag argument of <code>ev</code>.
See <code><a href="maxima_8.html#evfun">evfun</a></code>.
</p>
</dd>
<dt> <code>feature</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as the name of a feature.
Other atoms may then be declared to have the <var>a_i</var> property.
</p>
</dd>
<dt> <code>increasing, decreasing</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as an increasing or decreasing
function.
</p>
</dd>
<dt> <code>integer, noninteger</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as an integer or noninteger variable.
</p>
</dd>
<dt> <code>integervalued</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as an integer-valued function.
</p>
</dd>
<dt> <code>lassociative, rassociative</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as a right-associative or
left-associative function.
</p>
</dd>
<dt> <code>linear</code></dt>
<dd><p> Equivalent to declaring <var>a_i</var> both <code>outative</code> and
<code>additive</code>.
</p>
</dd>
<dt> <code>mainvar</code></dt>
<dd><p> Tells Maxima to consider <var>a_i</var> a "main variable". A main variable
succeeds all other constants and variables in the canonical ordering of
Maxima expressions, as determined by <code>ordergreatp</code>.
</p>
</dd>
<dt> <code>multiplicative</code></dt>
<dd><p> Tells Maxima to simplify <var>a_i</var> expressions by the substitution
<code><var>a_i</var>(x * y * z * ...)</code> <code>--></code>
<code><var>a_i</var>(x) * <var>a_i</var>(y) * <var>a_i</var>(z) * ...</code>.
The substitution is carried out on the first argument only.
</p>
</dd>
<dt> <code>nary</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as an n-ary function.
</p>
<p> The <code>nary</code> declaration is not the same as calling the <code>nary</code>
function. The sole effect of <code>declare(foo, nary)</code> is to instruct the
Maxima simplifier to flatten nested expressions, for example, to simplify
<code>foo(x, foo(y, z))</code> to <code>foo(x, y, z)</code>.
</p>
</dd>
<dt> <code>nonarray</code></dt>
<dd><p> Tells Maxima to consider <var>a_i</var> not an array. This declaration
prevents multiple evaluation of a subscripted variable name.
</p>
</dd>
<dt> <code>nonscalar</code></dt>
<dd><p> Tells Maxima to consider <var>a_i</var> a nonscalar variable. The usual
application is to declare a variable as a symbolic vector or matrix.
</p>
</dd>
<dt> <code>noun</code></dt>
<dd><p> Tells Maxima to parse <var>a_i</var> as a noun. The effect of this is to
replace instances of <var>a_i</var> with <code>'<var>a_i</var></code> or
<code>nounify(<var>a_i</var>)</code>, depending on the context.
</p>
</dd>
<dt> <code>outative</code></dt>
<dd><p> Tells Maxima to simplify <var>a_i</var> expressions by pulling constant factors
out of the first argument.
</p>
<p> When <var>a_i</var> has one argument, a factor is considered constant if it is
a literal or declared constant.
</p>
<p> When <var>a_i</var> has two or more arguments, a factor is considered constant
if the second argument is a symbol and the factor is free of the second
argument.
</p>
</dd>
<dt> <code>posfun</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as a positive function.
</p>
</dd>
<dt> <code>rational, irrational</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as a rational or irrational real
variable.
</p>
</dd>
<dt> <code>real, imaginary, complex</code></dt>
<dd><p> Tells Maxima to recognize <var>a_i</var> as a real, pure imaginary, or complex
variable.
</p>
</dd>
<dt> <code>scalar</code></dt>
<dd><p> Tells Maxima to consider <var>a_i</var> a scalar variable.
</p>
</dd>
</dl>
<p>Examples of the usage of the properties are available in the documentation
for each separate description of a property.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="decreasing"></a>
<a name="increasing"></a>
<a name="Item_003a-decreasing"></a>
</p><dl>
<dt><u>Property:</u> <b>decreasing</b>
<a name="IDX421"></a>
</dt>
<dt><u>Property:</u> <b>increasing</b>
<a name="IDX422"></a>
</dt>
<dd><p>The commands <code>declare(<var>f</var>, decreasing)</code> or
<code>declare(<var>f</var>, increasing)</code> tell Maxima to recognize the function
<var>f</var> as an decreasing or increasing function.
</p>
<p>See also <code><a href="#declare">declare</a></code> for more properties.
</p>
<p>Example:
</p>
<pre class="example">(%i1) assume(a > b);
(%o1) [a > b]
(%i2) is(f(a) > f(b));
(%o2) unknown
(%i3) declare(f, increasing);
(%o3) done
(%i4) is(f(a) > f(b));
(%o4) true
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="even"></a>
<a name="odd"></a>
<a name="Item_003a-even"></a>
</p><dl>
<dt><u>Property:</u> <b>even</b>
<a name="IDX423"></a>
</dt>
<dt><u>Property:</u> <b>odd</b>
<a name="IDX424"></a>
</dt>
<dd><p><code>declare(<var>a</var>, even)</code> or <code>declare(<var>a</var>, odd)</code> tells Maxima to
recognize the symbol <var>a</var> as an even or odd integer variable. The
properties <code>even</code> and <code>odd</code> are not recognized by the functions
<code><a href="maxima_5.html#evenp">evenp</a></code>, <code><a href="maxima_5.html#oddp">oddp</a></code>, and <code><a href="maxima_5.html#integerp">integerp</a></code>.
</p>
<p>See also <code><a href="#declare">declare</a></code> and <code><a href="#askinteger">askinteger</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) declare(n, even);
(%o1) done
(%i2) askinteger(n, even);
(%o2) yes
(%i3) askinteger(n);
(%o3) yes
(%i4) evenp(n);
(%o4) false
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="feature"></a>
<a name="Item_003a-feature"></a>
</p><dl>
<dt><u>Property:</u> <b>feature</b>
<a name="IDX425"></a>
</dt>
<dd><p>Maxima understands two distinct types of features, system features and features
which apply to mathematical expressions. See also <code><a href="maxima_32.html#status">status</a></code> for information
about system features. See also <code><a href="#features">features</a></code> and <code><a href="#featurep">featurep</a></code> for
information about mathematical features.
</p>
<p><code>feature</code> itself is not the name of a function or variable.
</p></dd></dl>
<p><a name="featurep"></a>
<a name="Item_003a-featurep"></a>
</p><dl>
<dt><u>Function:</u> <b>featurep</b><i> (<var>a</var>, <var>f</var>)</i>
<a name="IDX426"></a>
</dt>
<dd><p>Attempts to determine whether the object <var>a</var> has the feature <var>f</var> on the
basis of the facts in the current database. If so, it returns <code>true</code>,
else <code>false</code>.
</p>
<p>Note that <code>featurep</code> returns <code>false</code> when neither <var>f</var>
nor the negation of <var>f</var> can be established.
</p>
<p><code>featurep</code> evaluates its argument.
</p>
<p>See also <code><a href="#declare">declare</a></code> and <code><a href="#features">features</a></code>.
</p>
<pre class="example">(%i1) declare (j, even)$
(%i2) featurep (j, integer);
(%o2) true
</pre>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="features"></a>
<a name="Item_003a-features"></a>
</p><dl>
<dt><u>Declaration:</u> <b>features</b>
<a name="IDX427"></a>
</dt>
<dd><p>Maxima recognizes certain mathematical properties of functions and variables.
These are called "features".
</p>
<p><code>declare (<var>x</var>, <var>foo</var>)</code> gives the property <var>foo</var>
to the function or variable <var>x</var>.
</p>
<p><code>declare (<var>foo</var>, feature)</code> declares a new feature <var>foo</var>.
For example,
<code>declare ([red, green, blue], feature)</code>
declares three new features, <code>red</code>, <code>green</code>, and <code>blue</code>.
</p>
<p>The predicate <code>featurep (<var>x</var>, <var>foo</var>)</code>
returns <code>true</code> if <var>x</var> has the <var>foo</var> property,
and <code>false</code> otherwise.
</p>
<p>The infolist <code>features</code> is a list of known features. These are
</p>
<pre class="verbatim"> integer noninteger even
odd rational irrational
real imaginary complex
analytic increasing decreasing
oddfun evenfun posfun
commutative lassociative rassociative
symmetric antisymmetric
</pre>
<p>plus any user-defined features.
</p>
<p><code>features</code> is a list of mathematical features. There is also a list of
non-mathematical, system-dependent features. See <code><a href="maxima_32.html#status">status</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) declare (FOO, feature);
(%o1) done
(%i2) declare (x, FOO);
(%o2) done
(%i3) featurep (x, FOO);
(%o3) true
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="get"></a>
<a name="Item_003a-get"></a>
</p><dl>
<dt><u>Function:</u> <b>get</b><i> (<var>a</var>, <var>i</var>)</i>
<a name="IDX428"></a>
</dt>
<dd><p>Retrieves the user property indicated by <var>i</var> associated with
atom <var>a</var> or returns <code>false</code> if <var>a</var> doesn't have property <var>i</var>.
</p>
<p><code>get</code> evaluates its arguments.
</p>
<p>See also <code><a href="#put">put</a></code> and <code><a href="#qput">qput</a></code>.
</p>
<pre class="example">(%i1) put (%e, 'transcendental, 'type);
(%o1) transcendental
(%i2) put (%pi, 'transcendental, 'type)$
(%i3) put (%i, 'algebraic, 'type)$
(%i4) typeof (expr) := block ([q],
if numberp (expr)
then return ('algebraic),
if not atom (expr)
then return (maplist ('typeof, expr)),
q: get (expr, 'type),
if q=false
then errcatch (error(expr,"is not numeric.")) else q)$
(%i5) typeof (2*%e + x*%pi);
x is not numeric.
(%o5) [[transcendental, []], [algebraic, transcendental]]
(%i6) typeof (2*%e + %pi);
(%o6) [transcendental, [algebraic, transcendental]]
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="integer"></a>
<a name="noninteger"></a>
<a name="Item_003a-integer"></a>
</p><dl>
<dt><u>Property:</u> <b>integer</b>
<a name="IDX429"></a>
</dt>
<dt><u>Property:</u> <b>noninteger</b>
<a name="IDX430"></a>
</dt>
<dd><p><code>declare(<var>a</var>, integer)</code> or <code>declare(<var>a</var>, noninteger)</code> tells
Maxima to recognize <var>a</var> as an integer or noninteger variable.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) declare(n, integer, x, noninteger);
(%o1) done
(%i2) askinteger(n);
(%o2) yes
(%i3) askinteger(x);
(%o3) no
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="integervalued"></a>
<a name="Item_003a-integervalued"></a>
</p><dl>
<dt><u>Property:</u> <b>integervalued</b>
<a name="IDX431"></a>
</dt>
<dd><p><code>declare(<var>f</var>, integervalued)</code> tells Maxima to recognize <var>f</var> as an
integer-valued function.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) exp(%i)^f(x);
%i f(x)
(%o1) (%e )
(%i2) declare(f, integervalued);
(%o2) done
(%i3) exp(%i)^f(x);
%i f(x)
(%o3) %e
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="nonarray"></a>
<a name="Item_003a-nonarray"></a>
</p><dl>
<dt><u>Property:</u> <b>nonarray</b>
<a name="IDX432"></a>
</dt>
<dd><p>The command <code>declare(a, nonarray)</code> tells Maxima to consider <var>a</var> not
an array. This declaration prevents multiple evaluation, if <var>a</var> is a
subscripted variable.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) a:'b$ b:'c$ c:'d$
(%i4) a[x];
(%o4) d
x
(%i5) declare(a, nonarray);
(%o5) done
(%i6) a[x];
(%o6) a
x
</pre>
<div class=categorybox>
·
<p>@ref{Category: Expressions}
</div>
</p></dd></dl>
<p><a name="nonscalar"></a>
<a name="Item_003a-nonscalar"></a>
</p><dl>
<dt><u>Property:</u> <b>nonscalar</b>
<a name="IDX433"></a>
</dt>
<dd><p>Makes atoms behave as does a list or matrix with respect to the dot operator.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences} ·
@ref{Category: Vectors} ·
@ref{Category: Matrices}
</div>
</p></dd></dl>
<p><a name="nonscalarp"></a>
<a name="Item_003a-nonscalarp"></a>
</p><dl>
<dt><u>Function:</u> <b>nonscalarp</b><i> (<var>expr</var>)</i>
<a name="IDX434"></a>
</dt>
<dd><p>Returns <code>true</code> if <var>expr</var> is a non-scalar, i.e., it contains
atoms declared as non-scalars, lists, or matrices.
</p>
<p>See also the predicate function <code><a href="#scalarp">scalarp</a></code> and <code><a href="#declare">declare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Vectors} ·
@ref{Category: Matrices}
</div>
</p></dd></dl>
<p><a name="posfun"></a>
<a name="Item_003a-posfun"></a>
</p><dl>
<dt><u>Property:</u> <b>posfun</b>
<a name="IDX435"></a>
</dt>
<dd><p><code>declare (f, posfun)</code> declares <code>f</code> to be a positive function.
<code>is (f(x) > 0)</code> yields <code>true</code>.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences} ·
@ref{Category: Operators}
</div>
</p></dd></dl>
<p><a name="printprops"></a>
<a name="Item_003a-printprops"></a>
</p><dl>
<dt><u>Function:</u> <b>printprops</b><i> (<var>a</var>, <var>i</var>)</i>
<a name="IDX436"></a>
</dt>
<dt><u>Function:</u> <b>printprops</b><i> ([<var>a_1</var>, …, <var>a_n</var>], <var>i</var>)</i>
<a name="IDX437"></a>
</dt>
<dt><u>Function:</u> <b>printprops</b><i> (all, <var>i</var>)</i>
<a name="IDX438"></a>
</dt>
<dd><p>Displays the property with the indicator <var>i</var> associated with the atom
<var>a</var>. <var>a</var> may also be a list of atoms or the atom <code>all</code> in which
case all of the atoms with the given property will be used. For example,
<code>printprops ([f, g], atvalue)</code>. <code>printprops</code> is for properties that
cannot otherwise be displayed, i.e. for <code><a href="maxima_18.html#atvalue">atvalue</a></code>,
<code><a href="maxima_18.html#atomgrad">atomgrad</a></code>, <code><a href="maxima_18.html#gradef">gradef</a></code>, and <code><a href="maxima_34.html#matchdeclare">matchdeclare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences} ·
@ref{Category: Display functions}
</div>
</p></dd></dl>
<p><a name="properties"></a>
<a name="Item_003a-properties"></a>
</p><dl>
<dt><u>Function:</u> <b>properties</b><i> (<var>a</var>)</i>
<a name="IDX439"></a>
</dt>
<dd><p>Returns a list of the names of all the properties associated with the atom
<var>a</var>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="props"></a>
<a name="Item_003a-props"></a>
</p><dl>
<dt><u>System variable:</u> <b>props</b>
<a name="IDX440"></a>
</dt>
<dd><p>Default value: <code>[]</code>
</p>
<p><code>props</code> are atoms which have any property other than those explicitly
mentioned in <code><a href="maxima_4.html#infolists">infolists</a></code>, such as specified by <code><a href="maxima_18.html#atvalue">atvalue</a></code>,
<code><a href="maxima_34.html#matchdeclare">matchdeclare</a></code>, etc., as well as properties specified in the
<code><a href="#declare">declare</a></code> function.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences} ·
@ref{Category: Global variables}
</div>
</p></dd></dl>
<p><a name="propvars"></a>
<a name="Item_003a-propvars"></a>
</p><dl>
<dt><u>Function:</u> <b>propvars</b><i> (<var>prop</var>)</i>
<a name="IDX441"></a>
</dt>
<dd><p>Returns a list of those atoms on the <code><a href="#props">props</a></code> list which
have the property indicated by <var>prop</var>. Thus <code>propvars (atvalue)</code>
returns a list of atoms which have atvalues.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="put"></a>
<a name="Item_003a-put"></a>
</p><dl>
<dt><u>Function:</u> <b>put</b><i> (<var>atom</var>, <var>value</var>, <var>indicator</var>)</i>
<a name="IDX442"></a>
</dt>
<dd><p>Assigns <var>value</var> to the property (specified by <var>indicator</var>) of
<var>atom</var>. <var>indicator</var> may be the name of any property, not just a
system-defined property.
</p>
<p><code><a href="#rem">rem</a></code> reverses the effect of <code>put</code>.
</p>
<p><code>put</code> evaluates its arguments.
<code>put</code> returns <var>value</var>.
</p>
<p>See also <code><a href="#qput">qput</a></code> and <code><a href="#get">get</a></code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) put (foo, (a+b)^5, expr);
5
(%o1) (b + a)
(%i2) put (foo, "Hello", str);
(%o2) Hello
(%i3) properties (foo);
(%o3) [[user properties, str, expr]]
(%i4) get (foo, expr);
5
(%o4) (b + a)
(%i5) get (foo, str);
(%o5) Hello
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="qput"></a>
<a name="Item_003a-qput"></a>
</p><dl>
<dt><u>Function:</u> <b>qput</b><i> (<var>atom</var>, <var>value</var>, <var>indicator</var>)</i>
<a name="IDX443"></a>
</dt>
<dd><p>Assigns <var>value</var> to the property (specified by <var>indicator</var>) of
<var>atom</var>. This is the same as <code><a href="#put">put</a></code>, except that the arguments are
quoted.
</p>
<p>See also <code><a href="#get">get</a></code>.
</p>
<p>Example:
</p>
<pre class="example">(%i1) foo: aa$
(%i2) bar: bb$
(%i3) baz: cc$
(%i4) put (foo, bar, baz);
(%o4) bb
(%i5) properties (aa);
(%o5) [[user properties, cc]]
(%i6) get (aa, cc);
(%o6) bb
(%i7) qput (foo, bar, baz);
(%o7) bar
(%i8) properties (foo);
(%o8) [value, [user properties, baz]]
(%i9) get ('foo, 'baz);
(%o9) bar
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="rational"></a>
<a name="irrational"></a>
<a name="Item_003a-rational"></a>
</p><dl>
<dt><u>Property:</u> <b>rational</b>
<a name="IDX444"></a>
</dt>
<dt><u>Property:</u> <b>irrational</b>
<a name="IDX445"></a>
</dt>
<dd><p><code>declare(<var>a</var>, rational)</code> or <code>declare(<var>a</var>, irrational)</code> tells
Maxima to recognize <var>a</var> as a rational or irrational real variable.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="real"></a>
<a name="imaginary"></a>
<a name="complex"></a>
<a name="Item_003a-real"></a>
</p><dl>
<dt><u>Property:</u> <b>real</b>
<a name="IDX446"></a>
</dt>
<dt><u>Property:</u> <b>imaginary</b>
<a name="IDX447"></a>
</dt>
<dt><u>Property:</u> <b>complex</b>
<a name="IDX448"></a>
</dt>
<dd><p><code>declare(<var>a</var>, real)</code>, <code>declare(<var>a</var>, imaginary)</code>, or
<code>declare(<var>a</var>, complex)</code> tells Maxima to recognize <var>a</var> as a real,
pure imaginary, or complex variable.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="rem"></a>
<a name="Item_003a-rem"></a>
</p><dl>
<dt><u>Function:</u> <b>rem</b><i> (<var>atom</var>, <var>indicator</var>)</i>
<a name="IDX449"></a>
</dt>
<dd><p>Removes the property indicated by <var>indicator</var> from <var>atom</var>.
<code>rem</code> reverses the effect of <code><a href="#put">put</a></code>.
</p>
<p><code>rem</code> returns <code>done</code> if <var>atom</var> had an <var>indicator</var> property
when <code>rem</code> was called, or <code>false</code> if it had no such property.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="remove"></a>
<a name="Item_003a-remove"></a>
</p><dl>
<dt><u>Function:</u> <b>remove</b><i> (<var>a_1</var>, <var>p_1</var>, …, <var>a_n</var>, <var>p_n</var>)</i>
<a name="IDX450"></a>
</dt>
<dt><u>Function:</u> <b>remove</b><i> ([<var>a_1</var>, …, <var>a_m</var>], [<var>p_1</var>, …, <var>p_n</var>], …)</i>
<a name="IDX451"></a>
</dt>
<dt><u>Function:</u> <b>remove</b><i> ("<var>a</var>", operator)</i>
<a name="IDX452"></a>
</dt>
<dt><u>Function:</u> <b>remove</b><i> (<var>a</var>, transfun)</i>
<a name="IDX453"></a>
</dt>
<dt><u>Function:</u> <b>remove</b><i> (all, <var>p</var>)</i>
<a name="IDX454"></a>
</dt>
<dd><p>Removes properties associated with atoms.
</p>
<p><code>remove (<var>a_1</var>, <var>p_1</var>, ..., <var>a_n</var>, <var>p_n</var>)</code>
removes property <code>p_k</code> from atom <code>a_k</code>.
</p>
<p><code>remove ([<var>a_1</var>, ..., <var>a_m</var>], [<var>p_1</var>, ..., <var>p_n</var>], ...)</code>
removes properties <code><var>p_1</var>, ..., <var>p_n</var></code>
from atoms <var>a_1</var>, …, <var>a_m</var>.
There may be more than one pair of lists.
</p>
<p><code>remove (all, <var>p</var>)</code> removes the property <var>p</var> from all atoms which
have it.
</p>
<p>The removed properties may be system-defined properties such as
<code>function</code>, <code>macro</code>, or <code>mode_declare</code>.
<code>remove</code> does not remove properties defined by <code><a href="#put">put</a></code>.
</p>
<p>A property may be <code>transfun</code> to remove
the translated Lisp version of a function.
After executing this, the Maxima version of the function is executed
rather than the translated version.
</p>
<p><code>remove ("<var>a</var>", operator)</code> or, equivalently,
<code>remove ("<var>a</var>", op)</code> removes from <var>a</var> the operator properties
declared by <code><a href="maxima_7.html#prefix">prefix</a></code>, <code><a href="maxima_7.html#infix">infix</a></code>,
<code><a href="maxima_7.html#function_005fnary">nary</a></code>, <code><a href="maxima_7.html#postfix">postfix</a></code>, <code><a href="maxima_7.html#matchfix">matchfix</a></code>, or
<code><a href="maxima_7.html#nofix">nofix</a></code>. Note that the name of the operator must be written as a quoted
string.
</p>
<p><code>remove</code> always returns <code>done</code> whether or not an atom has a specified
property. This behavior is unlike the more specific remove functions
<code><a href="maxima_33.html#remvalue">remvalue</a></code>, <code><a href="maxima_5.html#remarray">remarray</a></code>, <code><a href="maxima_36.html#remfunction">remfunction</a></code>, and
<code><a href="maxima_34.html#remrule">remrule</a></code>.
</p>
<p><code>remove</code> quotes its arguments.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="scalar"></a>
<a name="Item_003a-scalar"></a>
</p><dl>
<dt><u>Property:</u> <b>scalar</b>
<a name="IDX455"></a>
</dt>
<dd><p><code>declare(<var>a</var>, scalar)</code> tells Maxima to consider <var>a</var> a scalar
variable.
</p>
<p>See also <code><a href="#declare">declare</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="scalarp"></a>
<a name="Item_003a-scalarp"></a>
</p><dl>
<dt><u>Function:</u> <b>scalarp</b><i> (<var>expr</var>)</i>
<a name="IDX456"></a>
</dt>
<dd><p>Returns <code>true</code> if <var>expr</var> is a number, constant, or variable declared
<code><a href="#scalar">scalar</a></code> with <code><a href="#declare">declare</a></code>, or composed entirely of numbers,
constants, and such variables, but not containing matrices or lists.
</p>
<p>See also the predicate function <code><a href="#nonscalarp">nonscalarp</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Vectors} ·
@ref{Category: Matrices}
</div>
</p></dd></dl>
<p><a name="Item_003a-Functions-and-Variables-for-Facts"></a>
</p><hr size="6">
<a name="Functions-and-Variables-for-Facts"></a>
<a name="SEC59"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC58" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC60" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC56" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC56" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_82.html#SEC380" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 11.3 Functions and Variables for Facts </h2>
<p><a name="activate"></a>
<a name="Item_003a-activate"></a>
</p><dl>
<dt><u>Function:</u> <b>activate</b><i> (<var>context_1</var>, …, <var>context_n</var>)</i>
<a name="IDX457"></a>
</dt>
<dd><p>Activates the contexts <var>context_1</var>, …, <var>context_n</var>.
The facts in these contexts are then available to
make deductions and retrieve information.
The facts in these contexts are not listed by <code>facts ()</code>.
</p>
<p>The variable <code><a href="#activecontexts">activecontexts</a></code> is the list
of contexts which are active by way of the <code>activate</code> function.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="activecontexts"></a>
<a name="Item_003a-activecontexts"></a>
</p><dl>
<dt><u>System variable:</u> <b>activecontexts</b>
<a name="IDX458"></a>
</dt>
<dd><p>Default value: <code>[]</code>
</p>
<p><code>activecontexts</code> is a list of the contexts which are active
by way of the <code><a href="#activate">activate</a></code> function, as opposed to being active because
they are subcontexts of the current context.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="askinteger"></a>
<a name="Item_003a-askinteger"></a>
</p><dl>
<dt><u>Function:</u> <b>askinteger</b><i> (<var>expr</var>, integer)</i>
<a name="IDX459"></a>
</dt>
<dt><u>Function:</u> <b>askinteger</b><i> (<var>expr</var>)</i>
<a name="IDX460"></a>
</dt>
<dt><u>Function:</u> <b>askinteger</b><i> (<var>expr</var>, even)</i>
<a name="IDX461"></a>
</dt>
<dt><u>Function:</u> <b>askinteger</b><i> (<var>expr</var>, odd)</i>
<a name="IDX462"></a>
</dt>
<dd><p><code>askinteger (<var>expr</var>, integer)</code> attempts to determine from the
<code>assume</code> database whether <var>expr</var> is an integer.
<code>askinteger</code> prompts the user if it cannot tell otherwise,
and attempt to install the information in the database if possible.
<code>askinteger (<var>expr</var>)</code> is equivalent to
<code>askinteger (<var>expr</var>, integer)</code>.
</p>
<p><code>askinteger (<var>expr</var>, even)</code> and <code>askinteger (<var>expr</var>, odd)</code>
likewise attempt to determine if <var>expr</var> is an even integer or odd integer,
respectively.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="asksign"></a>
<a name="Item_003a-asksign"></a>
</p><dl>
<dt><u>Function:</u> <b>asksign</b><i> (<var>expr</var>)</i>
<a name="IDX463"></a>
</dt>
<dd><p>First attempts to determine whether the specified
expression is positive, negative, or zero. If it cannot, it asks the
user the necessary questions to complete its deduction. The user's
answer is recorded in the data base for the duration of the current
computation. The return value of <code>asksign</code> is one of <code>pos</code>,
<code>neg</code>, or <code>zero</code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="assume"></a>
<a name="Item_003a-assume"></a>
</p><dl>
<dt><u>Function:</u> <b>assume</b><i> (<var>pred_1</var>, …, <var>pred_n</var>)</i>
<a name="IDX464"></a>
</dt>
<dd><p>Adds predicates <var>pred_1</var>, …, <var>pred_n</var> to the current context.
If a predicate is inconsistent or redundant with the predicates in the current
context, it is not added to the context. The context accumulates predicates
from each call to <code>assume</code>.
</p>
<p><code>assume</code> returns a list whose elements are the predicates added to the
context or the atoms <code>redundant</code> or <code>inconsistent</code> where applicable.
</p>
<p>The predicates <var>pred_1</var>, …, <var>pred_n</var> can only be expressions
with the relational operators <code>< <= equal notequal >=</code> and <code>></code>.
Predicates cannot be literal equality <code>=</code> or literal inequality <code>#</code>
expressions, nor can they be predicate functions such as <code>integerp</code>.
</p>
<p>Compound predicates of the form <code><var>pred_1</var> and ... and <var>pred_n</var></code>
are recognized, but not <code><var>pred_1</var> or ... or <var>pred_n</var></code>.
<code>not <var>pred_k</var></code> is recognized if <var>pred_k</var> is a relational predicate.
Expressions of the form <code>not (<var>pred_1</var> and <var>pred_2</var>)</code>
and <code>not (<var>pred_1</var> or <var>pred_2</var>)</code> are not recognized.
</p>
<p>Maxima's deduction mechanism is not very strong;
there are many obvious consequences which cannot be determined by <code><a href="#is">is</a></code>.
This is a known weakness.
</p>
<p><code>assume</code> does not handle predicates with complex numbers. If a predicate
contains a complex number <code>assume</code> returns <code>inconsistent</code> or
<code>redunant</code>.
</p>
<p><code>assume</code> evaluates its arguments.
</p>
<p>See also <code><a href="#is">is</a></code>, <code><a href="#facts">facts</a></code>, <code><a href="#forget">forget</a></code>,
<code><a href="#context">context</a></code>, and <code><a href="#declare">declare</a></code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) assume (xx > 0, yy < -1, zz >= 0);
(%o1) [xx > 0, yy < - 1, zz >= 0]
(%i2) assume (aa < bb and bb < cc);
(%o2) [bb > aa, cc > bb]
(%i3) facts ();
(%o3) [xx > 0, - 1 > yy, zz >= 0, bb > aa, cc > bb]
(%i4) is (xx > yy);
(%o4) true
(%i5) is (yy < -yy);
(%o5) true
(%i6) is (sinh (bb - aa) > 0);
(%o6) true
(%i7) forget (bb > aa);
(%o7) [bb > aa]
(%i8) prederror : false;
(%o8) false
(%i9) is (sinh (bb - aa) > 0);
(%o9) unknown
(%i10) is (bb^2 < cc^2);
(%o10) unknown
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="assumescalar"></a>
<a name="Item_003a-assumescalar"></a>
</p><dl>
<dt><u>Option variable:</u> <b>assumescalar</b>
<a name="IDX465"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p><code>assumescalar</code> helps govern whether expressions <code>expr</code>
for which <code>nonscalarp (expr)</code> is <code>false</code>
are assumed to behave like scalars for certain transformations.
</p>
<p>Let <code>expr</code> represent any expression other than a list or a matrix,
and let <code>[1, 2, 3]</code> represent any list or matrix.
Then <code>expr . [1, 2, 3]</code> yields <code>[expr, 2 expr, 3 expr]</code>
if <code>assumescalar</code> is <code>true</code>, or <code>scalarp (expr)</code> is
<code>true</code>, or <code>constantp (expr)</code> is <code>true</code>.
</p>
<p>If <code>assumescalar</code> is <code>true</code>, such
expressions will behave like scalars only for commutative
operators, but not for noncommutative multiplication <code>.</code>.
</p>
<p>When <code>assumescalar</code> is <code>false</code>, such
expressions will behave like non-scalars.
</p>
<p>When <code>assumescalar</code> is <code>all</code>, such expressions will behave like
scalars for all the operators listed above.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="assume_005fpos"></a>
<a name="Item_003a-assume_005fpos"></a>
</p><dl>
<dt><u>Option variable:</u> <b>assume_pos</b>
<a name="IDX466"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>assume_pos</code> is <code>true</code> and the sign of a parameter <var>x</var>
cannot be determined from the current context
or other considerations,
<code>sign</code> and <code>asksign (<var>x</var>)</code> return <code>true</code>.
This may forestall some automatically-generated <code>asksign</code> queries,
such as may arise from <code>integrate</code> or other computations.
</p>
<p>By default, a parameter is <var>x</var> such that <code>symbolp (<var>x</var>)</code>
or <code>subvarp (<var>x</var>)</code>.
The class of expressions considered parameters can be modified to some extent
via the variable <code>assume_pos_pred</code>.
</p>
<p><code>sign</code> and <code>asksign</code> attempt to deduce the sign of expressions
from the sign of operands within the expression.
For example, if <code>a</code> and <code>b</code> are both positive,
then <code>a + b</code> is also positive.
</p>
<p>However, there is no way to bypass all <code>asksign</code> queries.
In particular, when the <code>asksign</code> argument is a
difference <code><var>x</var> - <var>y</var></code> or a logarithm <code>log(<var>x</var>)</code>,
<code>asksign</code> always requests an input from the user,
even when <code>assume_pos</code> is <code>true</code> and <code>assume_pos_pred</code> is
a function which returns <code>true</code> for all arguments.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="assume_005fpos_005fpred"></a>
<a name="Item_003a-assume_005fpos_005fpred"></a>
</p><dl>
<dt><u>Option variable:</u> <b>assume_pos_pred</b>
<a name="IDX467"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>assume_pos_pred</code> is assigned the name of a function
or a lambda expression of one argument <var>x</var>,
that function is called to determine
whether <var>x</var> is considered a parameter for the purpose of <code>assume_pos</code>.
<code>assume_pos_pred</code> is ignored when <code>assume_pos</code> is <code>false</code>.
</p>
<p>The <code>assume_pos_pred</code> function is called by <code>sign</code> and <code>asksign</code>
with an argument <var>x</var>
which is either an atom, a subscripted variable, or a function call expression.
If the <code>assume_pos_pred</code> function returns <code>true</code>,
<var>x</var> is considered a parameter for the purpose of <code>assume_pos</code>.
</p>
<p>By default, a parameter is <var>x</var> such that <code>symbolp (<var>x</var>)</code>
or <code>subvarp (<var>x</var>)</code>.
</p>
<p>See also <code><a href="#assume">assume</a></code> and <code><a href="#assume_005fpos">assume_pos</a></code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) assume_pos: true$
(%i2) assume_pos_pred: symbolp$
(%i3) sign (a);
(%o3) pos
(%i4) sign (a[1]);
(%o4) pnz
(%i5) assume_pos_pred: lambda ([x], display (x), true)$
(%i6) asksign (a);
x = a
(%o6) pos
(%i7) asksign (a[1]);
x = a
1
(%o7) pos
(%i8) asksign (foo (a));
x = foo(a)
(%o8) pos
(%i9) asksign (foo (a) + bar (b));
x = foo(a)
x = bar(b)
(%o9) pos
(%i10) asksign (log (a));
x = a
Is a - 1 positive, negative, or zero?
p;
(%o10) pos
(%i11) asksign (a - b);
x = a
x = b
x = a
x = b
Is b - a positive, negative, or zero?
p;
(%o11) neg
</pre>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="context"></a>
<a name="Item_003a-context"></a>
</p><dl>
<dt><u>Option variable:</u> <b>context</b>
<a name="IDX468"></a>
</dt>
<dd><p>Default value: <code>initial</code>
</p>
<p><code>context</code> names the collection of facts maintained by <code><a href="#assume">assume</a></code> and
<code><a href="#forget">forget</a></code>. <code>assume</code> adds facts to the collection named by
<code>context</code>, while <code>forget</code> removes facts.
</p>
<p>Binding <code>context</code> to a name <var>foo</var> changes the current context to
<var>foo</var>. If the specified context <var>foo</var> does not yet exist,
it is created automatically by a call to <code><a href="#newcontext">newcontext</a></code>.
The specified context is activated automatically.
</p>
<p>See <code><a href="#contexts">contexts</a></code> for a general description of the context mechanism.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="contexts"></a>
<a name="Item_003a-contexts"></a>
</p><dl>
<dt><u>Option variable:</u> <b>contexts</b>
<a name="IDX469"></a>
</dt>
<dd><p>Default value: <code>[initial, global]</code>
</p>
<p><code>contexts</code> is a list of the contexts which
currently exist, including the currently active context.
</p>
<p>The context mechanism makes it possible for a user to bind together
and name a collection of facts, called a context.
Once this is done, the user can have Maxima assume or forget large numbers
of facts merely by activating or deactivating their context.
</p>
<p>Any symbolic atom can be a context, and the facts contained in that
context will be retained in storage until destroyed one by one
by calling <code><a href="#forget">forget</a></code> or destroyed as a whole by calling <code><a href="maxima_4.html#kill">kill</a></code>
to destroy the context to which they belong.
</p>
<p>Contexts exist in a hierarchy, with the root always being
the context <code>global</code>, which contains information about Maxima that some
functions need. When in a given context, all the facts in that
context are "active" (meaning that they are used in deductions and
retrievals) as are all the facts in any context which is a subcontext
of the active context.
</p>
<p>When a fresh Maxima is started up, the user is in a
context called <code>initial</code>, which has <code>global</code> as a subcontext.
</p>
<p>See also <code><a href="#facts">facts</a></code>, <code><a href="#newcontext">newcontext</a></code>, <code><a href="#supcontext">supcontext</a></code>,
<code><a href="#killcontext">killcontext</a></code>, <code><a href="#activate">activate</a></code>, <code><a href="#deactivate">deactivate</a></code>,
<code><a href="#assume">assume</a></code>, and <code><a href="#forget">forget</a></code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="deactivate"></a>
<a name="Item_003a-deactivate"></a>
</p><dl>
<dt><u>Function:</u> <b>deactivate</b><i> (<var>context_1</var>, …, <var>context_n</var>)</i>
<a name="IDX470"></a>
</dt>
<dd><p>Deactivates the specified contexts <var>context_1</var>, …, <var>context_n</var>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="facts"></a>
<a name="Item_003a-facts"></a>
</p><dl>
<dt><u>Function:</u> <b>facts</b><i> (<var>item</var>)</i>
<a name="IDX471"></a>
</dt>
<dt><u>Function:</u> <b>facts</b><i> ()</i>
<a name="IDX472"></a>
</dt>
<dd><p>If <var>item</var> is the name of a context, <code>facts (<var>item</var>)</code> returns a
list of the facts in the specified context.
</p>
<p>If <var>item</var> is not the name of a context, <code>facts (<var>item</var>)</code> returns a
list of the facts known about <var>item</var> in the current context. Facts that
are active, but in a different context, are not listed.
</p>
<p><code>facts ()</code> (i.e., without an argument) lists the current context.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="forget"></a>
<a name="Item_003a-forget"></a>
</p><dl>
<dt><u>Function:</u> <b>forget</b><i> (<var>pred_1</var>, …, <var>pred_n</var>)</i>
<a name="IDX473"></a>
</dt>
<dt><u>Function:</u> <b>forget</b><i> (<var>L</var>)</i>
<a name="IDX474"></a>
</dt>
<dd><p>Removes predicates established by <code><a href="#assume">assume</a></code>.
The predicates may be expressions equivalent to (but not necessarily identical
to) those previously assumed.
</p>
<p><code>forget (<var>L</var>)</code>, where <var>L</var> is a list of predicates,
forgets each item on the list.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="is"></a>
<a name="Item_003a-is"></a>
</p><dl>
<dt><u>Function:</u> <b>is</b><i> (<var>expr</var>)</i>
<a name="IDX475"></a>
</dt>
<dd><p>Attempts to determine whether the predicate <var>expr</var> is provable from the
facts in the <code>assume</code> database.
</p>
<p>If the predicate is provably <code>true</code> or <code>false</code>, <code>is</code> returns
<code>true</code> or <code>false</code>, respectively. Otherwise, the return value is
governed by the global flag <code><a href="maxima_37.html#prederror">prederror</a></code>. When <code>prederror</code> is
<code>true</code>, <code>is</code> complains with an error message. Otherwise, <code>is</code>
returns <code>unknown</code>.
</p>
<p><code>ev(<var>expr</var>, pred)</code> (which can be written <code><var>expr</var>, pred</code> at
the interactive prompt) is equivalent to <code>is(<var>expr</var>)</code>.
</p>
<p>See also <code><a href="#assume">assume</a></code>, <code><a href="#facts">facts</a></code>, and <code><a href="#maybe">maybe</a></code>.
</p>
<p>Examples:
</p>
<p><code>is</code> causes evaluation of predicates.
</p>
<pre class="example">(%i1) %pi > %e;
(%o1) %pi > %e
(%i2) is (%pi > %e);
(%o2) true
</pre>
<p><code>is</code> attempts to derive predicates from the <code>assume</code> database.
</p>
<pre class="example">(%i1) assume (a > b);
(%o1) [a > b]
(%i2) assume (b > c);
(%o2) [b > c]
(%i3) is (a < b);
(%o3) false
(%i4) is (a > c);
(%o4) true
(%i5) is (equal (a, c));
(%o5) false
</pre>
<p>If <code>is</code> can neither prove nor disprove a predicate from the <code>assume</code>
database, the global flag <code>prederror</code> governs the behavior of <code>is</code>.
</p>
<pre class="example">(%i1) assume (a > b);
(%o1) [a > b]
(%i2) prederror: true$
(%i3) is (a > 0);
Maxima was unable to evaluate the predicate:
a > 0
-- an error. Quitting. To debug this try debugmode(true);
(%i4) prederror: false$
(%i5) is (a > 0);
(%o5) unknown
</pre>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="killcontext"></a>
<a name="Item_003a-killcontext"></a>
</p><dl>
<dt><u>Function:</u> <b>killcontext</b><i> (<var>context_1</var>, …, <var>context_n</var>)</i>
<a name="IDX476"></a>
</dt>
<dd><p>Kills the contexts <var>context_1</var>, …, <var>context_n</var>.
</p>
<p>If one of the contexts is the current context, the new current context will
become the first available subcontext of the current context which has not been
killed. If the first available unkilled context is <code>global</code> then
<code>initial</code> is used instead. If the <code>initial</code> context is killed, a
new, empty <code>initial</code> context is created.
</p>
<p><code>killcontext</code> refuses to kill a context which is
currently active, either because it is a subcontext of the current
context, or by use of the function <code><a href="#activate">activate</a></code>.
</p>
<p><code>killcontext</code> evaluates its arguments.
<code>killcontext</code> returns <code>done</code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="maybe"></a>
<a name="Item_003a-maybe"></a>
</p><dl>
<dt><u>Function:</u> <b>maybe</b><i> (<var>expr</var>)</i>
<a name="IDX477"></a>
</dt>
<dd><p>Attempts to determine whether the predicate <var>expr</var> is provable from the
facts in the <code>assume</code> database.
</p>
<p>If the predicate is provably <code>true</code> or <code>false</code>, <code>maybe</code> returns
<code>true</code> or <code>false</code>, respectively. Otherwise, <code>maybe</code> returns
<code>unknown</code>.
</p>
<p><code>maybe</code> is functionally equivalent to <code>is</code> with
<code>prederror: false</code>, but the result is computed without actually assigning
a value to <code>prederror</code>.
</p>
<p>See also <code><a href="#assume">assume</a></code>, <code><a href="#facts">facts</a></code>, and <code><a href="#is">is</a></code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) maybe (x > 0);
(%o1) unknown
(%i2) assume (x > 1);
(%o2) [x > 1]
(%i3) maybe (x > 0);
(%o3) true
</pre>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="newcontext"></a>
<a name="Item_003a-newcontext"></a>
</p><dl>
<dt><u>Function:</u> <b>newcontext</b><i> (<var>name</var>)</i>
<a name="IDX478"></a>
</dt>
<dd><p>Creates a new, empty context, called <var>name</var>, which
has <code>global</code> as its only subcontext. The newly-created context
becomes the currently active context.
</p>
<p><code>newcontext</code> evaluates its argument.
<code>newcontext</code> returns <var>name</var>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="sign"></a>
<a name="Item_003a-sign"></a>
</p><dl>
<dt><u>Function:</u> <b>sign</b><i> (<var>expr</var>)</i>
<a name="IDX479"></a>
</dt>
<dd><p>Attempts to determine the sign of <var>expr</var> on the basis of the facts in the
current data base. It returns one of the following answers: <code>pos</code>
(positive), <code>neg</code> (negative), <code>zero</code>, <code>pz</code> (positive or zero),
<code>nz</code> (negative or zero), <code>pn</code> (positive or negative), or <code>pnz</code>
(positive, negative, or zero, i.e. nothing known).
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="supcontext"></a>
<a name="Item_003a-supcontext"></a>
</p><dl>
<dt><u>Function:</u> <b>supcontext</b><i> (<var>name</var>, <var>context</var>)</i>
<a name="IDX480"></a>
</dt>
<dt><u>Function:</u> <b>supcontext</b><i> (<var>name</var>)</i>
<a name="IDX481"></a>
</dt>
<dd><p>Creates a new context, called <var>name</var>, which has <var>context</var> as a
subcontext. <var>context</var> must exist.
</p>
<p>If <var>context</var> is not specified, the current context is assumed.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="Item_003a-Functions-and-Variables-for-Predicates"></a>
</p><hr size="6">
<a name="Functions-and-Variables-for-Predicates"></a>
<a name="SEC60"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC59" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC56" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC56" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_82.html#SEC380" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 11.4 Functions and Variables for Predicates </h2>
<p><a name="charfun"></a>
<a name="Item_003a-charfun"></a>
</p><dl>
<dt><u>Function:</u> <b>charfun</b><i> (<var>p</var>)</i>
<a name="IDX482"></a>
</dt>
<dd><p>Return 0 when the predicate <var>p</var> evaluates to <code>false</code>; return 1 when
the predicate evaluates to <code>true</code>. When the predicate evaluates to
something other than <code>true</code> or <code>false</code> (unknown), return a noun form.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) charfun (x < 1);
(%o1) charfun(x < 1)
(%i2) subst (x = -1, %);
(%o2) 1
(%i3) e : charfun ('"and" (-1 < x, x < 1))$
(%i4) [subst (x = -1, e), subst (x = 0, e), subst (x = 1, e)];
(%o4) [0, 1, 0]
</pre>
<div class=categorybox>
·
<p>@ref{Category: Mathematical functions}
</div>
</p></dd></dl>
<p><a name="compare"></a>
<a name="Item_003a-compare"></a>
</p><dl>
<dt><u>Function:</u> <b>compare</b><i> (<var>x</var>, <var>y</var>)</i>
<a name="IDX483"></a>
</dt>
<dd><p>Return a comparison operator <var>op</var> (<code><</code>, <code><=</code>, <code>></code>, <code>>=</code>,
<code>=</code>, or <code>#</code>) such that <code>is (<var>x</var> <var>op</var> <var>y</var>)</code> evaluates
to <code>true</code>; when either <var>x</var> or <var>y</var> depends on <code>%i</code> and
<code><var>x</var> # <var>y</var></code>, return <code>notcomparable</code>; when there is no such
operator or Maxima isn't able to determine the operator, return <code>unknown</code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) compare (1, 2);
(%o1) <
(%i2) compare (1, x);
(%o2) unknown
(%i3) compare (%i, %i);
(%o3) =
(%i4) compare (%i, %i + 1);
(%o4) notcomparable
(%i5) compare (1/x, 0);
(%o5) #
(%i6) compare (x, abs(x));
(%o6) <=
</pre>
<p>The function <code>compare</code> doesn't try to determine whether the real domains of
its arguments are nonempty; thus
</p>
<pre class="example">(%i1) compare (acos (x^2 + 1), acos (x^2 + 1) + 1);
(%o1) <
</pre>
<p>The real domain of <code>acos (x^2 + 1)</code> is empty.
</p>
<div class=categorybox>
·
<p>@ref{Category: Declarations and inferences}
</div>
</p></dd></dl>
<p><a name="equal"></a>
<a name="Item_003a-equal"></a>
</p><dl>
<dt><u>Function:</u> <b>equal</b><i> (<var>a</var>, <var>b</var>)</i>
<a name="IDX484"></a>
</dt>
<dd><p>Represents equivalence, that is, equal value.
</p>
<p>By itself, <code>equal</code> does not evaluate or simplify.
The function <code><a href="#is">is</a></code> attempts to evaluate <code>equal</code> to a Boolean value.
<code>is(equal(<var>a</var>, <var>b</var>))</code> returns <code>true</code> (or <code>false</code>) if
and only if <var>a</var> and <var>b</var> are equal (or not equal) for all possible
values of their variables, as determined by evaluating
<code>ratsimp(<var>a</var> - <var>b</var>)</code>; if <code><a href="maxima_14.html#ratsimp">ratsimp</a></code> returns 0, the two
expressions are considered equivalent. Two expressions may be equivalent even
if they are not syntactically equal (i.e., identical).
</p>
<p>When <code>is</code> fails to reduce <code>equal</code> to <code>true</code> or <code>false</code>, the
result is governed by the global flag <code><a href="maxima_37.html#prederror">prederror</a></code>. When <code>prederror</code>
is <code>true</code>, <code>is</code> complains with an error message. Otherwise, <code>is</code>
returns <code>unknown</code>.
</p>
<p>In addition to <code>is</code>, some other operators evaluate <code>equal</code> and
<code>notequal</code> to <code>true</code> or <code>false</code>, namely <code><a href="maxima_37.html#if">if</a></code>,
<code><a href="maxima_7.html#and">and</a></code>, <code><a href="maxima_7.html#or">or</a></code>, and <code><a href="maxima_7.html#not">not</a></code>.
</p>
<p>The negation of <code>equal</code> is <code><a href="#notequal">notequal</a></code>.
</p>
<p>Examples:
</p>
<p>By itself, <code>equal</code> does not evaluate or simplify.
</p>
<pre class="example">(%i1) equal (x^2 - 1, (x + 1) * (x - 1));
2
(%o1) equal(x - 1, (x - 1) (x + 1))
(%i2) equal (x, x + 1);
(%o2) equal(x, x + 1)
(%i3) equal (x, y);
(%o3) equal(x, y)
</pre>
<p>The function <code>is</code> attempts to evaluate <code>equal</code> to a Boolean value.
<code>is(equal(<var>a</var>, <var>b</var>))</code> returns <code>true</code> when
<code>ratsimp(<var>a</var> - <var>b</var>)</code> returns 0. Two expressions may be equivalent
even if they are not syntactically equal (i.e., identical).
</p>
<pre class="example">(%i1) ratsimp (x^2 - 1 - (x + 1) * (x - 1));
(%o1) 0
(%i2) is (equal (x^2 - 1, (x + 1) * (x - 1)));
(%o2) true
(%i3) is (x^2 - 1 = (x + 1) * (x - 1));
(%o3) false
(%i4) ratsimp (x - (x + 1));
(%o4) - 1
(%i5) is (equal (x, x + 1));
(%o5) false
(%i6) is (x = x + 1);
(%o6) false
(%i7) ratsimp (x - y);
(%o7) x - y
(%i8) is (equal (x, y));
(%o8) unknown
(%i9) is (x = y);
(%o9) false
</pre>
<p>When <code>is</code> fails to reduce <code>equal</code> to <code>true</code> or <code>false</code>,
the result is governed by the global flag <code>prederror</code>.
</p>
<pre class="example">(%i1) [aa : x^2 + 2*x + 1, bb : x^2 - 2*x - 1];
2 2
(%o1) [x + 2 x + 1, x - 2 x - 1]
(%i2) ratsimp (aa - bb);
(%o2) 4 x + 2
(%i3) prederror : true;
(%o3) true
(%i4) is (equal (aa, bb));
Maxima was unable to evaluate the predicate:
2 2
equal(x + 2 x + 1, x - 2 x - 1)
-- an error. Quitting. To debug this try debugmode(true);
(%i5) prederror : false;
(%o5) false
(%i6) is (equal (aa, bb));
(%o6) unknown
</pre>
<p>Some operators evaluate <code>equal</code> and <code>notequal</code> to <code>true</code> or
<code>false</code>.
</p>
<pre class="example">(%i1) if equal (y, y - 1) then FOO else BAR;
(%o1) BAR
(%i2) eq_1 : equal (x, x + 1);
(%o2) equal(x, x + 1)
(%i3) eq_2 : equal (y^2 + 2*y + 1, (y + 1)^2);
2 2
(%o3) equal(y + 2 y + 1, (y + 1) )
(%i4) [eq_1 and eq_2, eq_1 or eq_2, not eq_1];
(%o4) [false, true, true]
</pre>
<p>Because <code>not <var>expr</var></code> causes evaluation of <var>expr</var>,
<code>not equal(<var>a</var>, <var>b</var>)</code> is equivalent to
<code>is(notequal(<var>a</var>, <var>b</var>))</code>.
</p>
<pre class="example">(%i1) [notequal (2*z, 2*z - 1), not equal (2*z, 2*z - 1)];
(%o1) [notequal(2 z, 2 z - 1), true]
(%i2) is (notequal (2*z, 2*z - 1));
(%o2) true
</pre>
<div class=categorybox>
·
<p>@ref{Category: Operators}
</div>
</p></dd></dl>
<p><a name="notequal"></a>
<a name="Item_003a-notequal"></a>
</p><dl>
<dt><u>Function:</u> <b>notequal</b><i> (<var>a</var>, <var>b</var>)</i>
<a name="IDX485"></a>
</dt>
<dd><p>Represents the negation of <code>equal(<var>a</var>, <var>b</var>)</code>.
</p>
<p>Examples:
</p>
<pre class="example">(%i1) equal (a, b);
(%o1) equal(a, b)
(%i2) maybe (equal (a, b));
(%o2) unknown
(%i3) notequal (a, b);
(%o3) notequal(a, b)
(%i4) not equal (a, b);
(%o4) notequal(a, b)
(%i5) maybe (notequal (a, b));
(%o5) unknown
(%i6) assume (a > b);
(%o6) [a > b]
(%i7) equal (a, b);
(%o7) equal(a, b)
(%i8) maybe (equal (a, b));
(%o8) false
(%i9) notequal (a, b);
(%o9) notequal(a, b)
(%i10) maybe (notequal (a, b));
(%o10) true
</pre>
<div class=categorybox>
·
<p>@ref{Category: Operators}
</div>
</p></dd></dl>
<p><a name="unknown"></a>
<a name="Item_003a-unknown"></a>
</p><dl>
<dt><u>Function:</u> <b>unknown</b><i> (<var>expr</var>)</i>
<a name="IDX486"></a>
</dt>
<dd><p>Returns <code>true</code> if and only if <var>expr</var> contains an operator or function
not recognized by the Maxima simplifier.
</p>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions} ·
@ref{Category: Simplification functions}
</div>
</p></dd></dl>
<p><a name="zeroequiv"></a>
<a name="Item_003a-zeroequiv"></a>
</p><dl>
<dt><u>Function:</u> <b>zeroequiv</b><i> (<var>expr</var>, <var>v</var>)</i>
<a name="IDX487"></a>
</dt>
<dd><p>Tests whether the expression <var>expr</var> in the variable <var>v</var> is equivalent
to zero, returning <code>true</code>, <code>false</code>, or <code>dontknow</code>.
</p>
<p><code>zeroequiv</code> has these restrictions:
</p>
<ol>
<li>
Do not use functions that Maxima does not know how to
differentiate and evaluate.
</li><li>
If the expression has poles on the real line, there may be errors
in the result (but this is unlikely to occur).
</li><li>
If the expression contains functions which are not solutions to first order
differential equations (e.g. Bessel functions) there may be incorrect results.
</li><li>
The algorithm uses evaluation at randomly chosen points for carefully selected
subexpressions. This is always a somewhat hazardous business, although the
algorithm tries to minimize the potential for error.
</li></ol>
<p>For example <code>zeroequiv (sin(2 * x) - 2 * sin(x) * cos(x), x)</code> returns
<code>true</code> and <code>zeroequiv (%e^x + x, x)</code> returns <code>false</code>.
On the other hand <code>zeroequiv (log(a * b) - log(a) - log(b), a)</code> returns
<code>dontknow</code> because of the presence of an extra parameter <code>b</code>.
</p>
<div class=categorybox>
·
<p>@ref{Category: Predicate functions}
</div>
</p></dd></dl>
<p><a name="Item_003a-Plotting"></a>
</p><hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC56" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima_12.html#SEC61" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_82.html#SEC380" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>root</em> on <em>January, 10 2014</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
</font>
<br>
</p>
</body>
</html>
|