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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Maxima 5.47.0 Manual: Functions and Variables for Properties</title>
<meta name="description" content="Maxima 5.47.0 Manual: Functions and Variables for Properties">
<meta name="keywords" content="Maxima 5.47.0 Manual: Functions and Variables for Properties">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="maxima_toc.html#Top" rel="start" title="Top">
<link href="maxima_423.html#Function-and-Variable-Index" rel="index" title="Function and Variable Index">
<link href="maxima_toc.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="maxima_60.html#Maxima_0027s-Database" rel="up" title="Maxima's Database">
<link href="maxima_63.html#Functions-and-Variables-for-Facts" rel="next" title="Functions and Variables for Facts">
<link href="maxima_61.html#Introduction-to-Maxima_0027s-Database" rel="previous" title="Introduction to Maxima's Database">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
body {color: black; background: white; margin-left: 8%; margin-right: 13%;
font-family: "FreeSans", sans-serif}
h1 {font-size: 150%; font-family: "FreeSans", sans-serif}
h2 {font-size: 125%; font-family: "FreeSans", sans-serif}
h3 {font-size: 100%; font-family: "FreeSans", sans-serif}
a[href] {color: rgb(0,0,255); text-decoration: none;}
a[href]:hover {background: rgb(220,220,220);}
div.textbox {border: solid; border-width: thin; 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);}
pre.example {border: 1px solid rgb(180,180,180); padding-top: 1em;
padding-bottom: 1em; padding-left: 1em; padding-right: 1em;
background-color: rgb(238,238,255)}
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: 1em; padding-bottom: 1em;
padding-left: 1em; padding-right: 1em; background: rgb(247,242,220)}
img {max-width:80%; max-height: 80%; display: block; margin-left: auto; margin-right: auto}
-->
</style>
<link rel="icon" href="figures/favicon.ico">
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6>"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Functions-and-Variables-for-Properties"></a>
<div class="header">
<p>
Next: <a href="maxima_63.html#Functions-and-Variables-for-Facts" accesskey="n" rel="next">Functions and Variables for Facts</a>, Previous: <a href="maxima_61.html#Introduction-to-Maxima_0027s-Database" accesskey="p" rel="previous">Introduction to Maxima's Database</a>, Up: <a href="maxima_60.html#Maxima_0027s-Database" accesskey="u" rel="up">Maxima's Database</a> [<a href="maxima_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="maxima_423.html#Function-and-Variable-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Functions-and-Variables-for-Properties-1"></a>
<h3 class="section">11.2 Functions and Variables for Properties</h3>
<a name="alphabetic"></a><a name="Item_003a-Database_002fdefvr_002falphabetic"></a><dl>
<dt><a name="index-alphabetic"></a>Property: <strong>alphabetic</strong></dt>
<dd>
<p><code>alphabetic</code> is a property type recognized by <code><a href="#declare">declare</a></code>.<!-- /@w -->
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_31.html#Identifiers">Identifiers</a>.
</p>
<p>Example:
</p>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="bindtest"></a><a name="Item_003a-Database_002fdefvr_002fbindtest"></a><dl>
<dt><a name="index-bindtest"></a>Property: <strong>bindtest</strong></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>
<div class="example">
<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></div>
</dd></dl>
<a name="constant"></a><a name="Item_003a-Database_002fdeffn_002fconstant"></a><dl>
<dt><a name="index-constant"></a>Property: <strong>constant</strong></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·<a href="maxima_424.html#Category_003a-Constants">Constants</a>
·</div></dd></dl>
<a name="constantp"></a><a name="Item_003a-Database_002fdeffn_002fconstantp"></a><dl>
<dt><a name="index-constantp"></a>Function: <strong>constantp</strong> <em>(<var>expr</var>)</em></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_18.html#g_t_0025pi">%pi</a></code>, <code><a href="maxima_18.html#g_t_0025e">%e</a></code>, and <code><a href="maxima_18.html#g_t_0025i">%i</a></code>,<!-- /@w -->
variables bound to a constant or declared constant by <code><a href="#declare">declare</a></code>,<!-- /@w -->
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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Predicate-functions">Predicate functions</a>
·<a href="maxima_424.html#Category_003a-Constants">Constants</a>
·</div></dd></dl>
<a name="declare"></a><a name="Item_003a-Database_002fdeffn_002fdeclare"></a><dl>
<dt><a name="index-declare"></a>Function: <strong>declare</strong> <em>(<var>a_1</var>, <var>p_1</var>, <var>a_2</var>, <var>p_2</var>, …)</em></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><code><a href="maxima_46.html#additive">additive</a></code></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><code><a href="#alphabetic">alphabetic</a></code></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><code><a href="maxima_46.html#antisymmetric">antisymmetric</a></code>, <code><a href="maxima_46.html#commutative">commutative</a></code>, <code><a href="maxima_46.html#symmetric">symmetric</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as a symmetric or antisymmetric
function. <code>commutative</code> is the same as <code>symmetric</code>.
</p>
</dd>
<dt><code><code><a href="#bindtest">bindtest</a></code></code></dt>
<dd><p>Tells Maxima to trigger an error when <var>a_i</var> is evaluated unbound.
</p>
</dd>
<dt><code><code><a href="#constant">constant</a></code></code></dt>
<dd><p>Tells Maxima to consider <var>a_i</var> a symbolic constant.
</p>
</dd>
<dt><code><code><a href="#even">even</a></code>, <code><a href="#odd">odd</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as an even or odd integer variable.
</p>
</dd>
<dt><code><code><a href="maxima_46.html#evenfun">evenfun</a></code>, <code><a href="maxima_46.html#oddfun">oddfun</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as an odd or even function.
</p>
</dd>
<dt><code><code><a href="maxima_43.html#evflag">evflag</a></code></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>.
</p>
</dd>
<dt><code><code><a href="maxima_43.html#evfun">evfun</a></code></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>.
</p>
</dd>
<dt><code><code><a href="#feature">feature</a></code></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><code><a href="#increasing">increasing</a></code>, <code><a href="#decreasing">decreasing</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as an increasing or decreasing
function.
</p>
</dd>
<dt><code><code><a href="#integer">integer</a></code>, <code><a href="#noninteger">noninteger</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as an integer or noninteger variable.
</p>
</dd>
<dt><code><code><a href="#integervalued">integervalued</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as an integer-valued function.
</p>
</dd>
<dt><code><code><a href="maxima_46.html#lassociative">lassociative</a></code>, <code><a href="maxima_46.html#rassociative">rassociative</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as a right-associative or
left-associative function.
</p>
</dd>
<dt><code><code><a href="maxima_46.html#linear">linear</a></code></code></dt>
<dd><p>Equivalent to declaring <var>a_i</var> both <code>outative</code> and
<code>additive</code>.
</p>
</dd>
<dt><code><code><a href="maxima_33.html#mainvar">mainvar</a></code></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><a href="maxima_33.html#ordergreatp">ordergreatp</a></code>.
</p>
</dd>
<dt><code><code><a href="maxima_46.html#multiplicative">multiplicative</a></code></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>
<a name="nary"></a></dd>
<dt><code><code><a href="#nary">nary</a></code></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><code><a href="#nonarray">nonarray</a></code></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><code><a href="#nonscalar">nonscalar</a></code></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><code><a href="maxima_33.html#noun">noun</a></code></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><code><a href="maxima_46.html#outative">outative</a></code></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><code><a href="#posfun">posfun</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as a positive function.
</p>
</dd>
<dt><code><code><a href="#rational">rational</a></code>, <code><a href="#irrational">irrational</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as a rational or irrational real
variable.
</p>
</dd>
<dt><code><code><a href="#real">real</a></code>, <code><a href="#imaginary">imaginary</a></code>, <code><a href="#complex">complex</a></code></code></dt>
<dd><p>Tells Maxima to recognize <var>a_i</var> as a real, pure imaginary, or complex
variable.
</p>
</dd>
<dt><code><code><a href="#scalar">scalar</a></code></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="decreasing"></a><a name="increasing"></a><a name="Item_003a-Database_002fdefvr_002fdecreasing"></a><dl>
<dt><a name="index-decreasing"></a>Property: <strong>decreasing</strong></dt>
<dd><a name="Item_003a-Database_002fdefvr_002fincreasing"></a></dd><dt><a name="index-increasing"></a>Property: <strong>increasing</strong></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="even"></a><a name="odd"></a><a name="Item_003a-Database_002fdefvr_002feven"></a><dl>
<dt><a name="index-even"></a>Property: <strong>even</strong></dt>
<dd><a name="Item_003a-Database_002fdefvr_002fodd"></a></dd><dt><a name="index-odd"></a>Property: <strong>odd</strong></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_13.html#evenp">evenp</a></code>, <code><a href="maxima_13.html#oddp">oddp</a></code>, and <code><a href="maxima_13.html#integerp">integerp</a></code>.
</p>
<p>See also <code><a href="#declare">declare</a></code> and <code><a href="maxima_63.html#askinteger">askinteger</a></code>.
</p>
<p>Example:
</p>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="feature"></a><a name="Item_003a-Database_002fdefvr_002ffeature"></a><dl>
<dt><a name="index-feature"></a>Property: <strong>feature</strong></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_155.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>
<a name="featurep"></a><a name="Item_003a-Database_002fdeffn_002ffeaturep"></a><dl>
<dt><a name="index-featurep"></a>Function: <strong>featurep</strong> <em>(<var>a</var>, <var>f</var>)</em></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>
<div class="example">
<pre class="example">(%i1) declare (j, even)$
(%i2) featurep (j, integer);
(%o2) true
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Predicate-functions">Predicate functions</a>
·<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="features"></a><a name="Item_003a-Database_002fdefvr_002ffeatures"></a><dl>
<dt><a name="index-features"></a>Declaration: <strong>features</strong></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
constant commutative lassociative
rassociative symmetric antisymmetric
integervalued
</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_155.html#status">status</a></code>.
</p>
<p>Example:
</p>
<div class="example">
<pre class="example">(%i1) declare (FOO, feature);
(%o1) done
(%i2) declare (x, FOO);
(%o2) done
(%i3) featurep (x, FOO);
(%o3) true
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="get"></a><a name="Item_003a-Database_002fdeffn_002fget"></a><dl>
<dt><a name="index-get"></a>Function: <strong>get</strong> <em>(<var>a</var>, <var>i</var>)</em></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="integer"></a><a name="noninteger"></a><a name="Item_003a-Database_002fdefvr_002finteger"></a><dl>
<dt><a name="index-integer"></a>Property: <strong>integer</strong></dt>
<dd><a name="Item_003a-Database_002fdefvr_002fnoninteger"></a></dd><dt><a name="index-noninteger"></a>Property: <strong>noninteger</strong></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>
<div class="example">
<pre class="example">(%i1) declare(n, integer, x, noninteger);
(%o1) done
(%i2) askinteger(n);
(%o2) yes
(%i3) askinteger(x);
(%o3) no
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="integervalued"></a><a name="Item_003a-Database_002fdefvr_002fintegervalued"></a><dl>
<dt><a name="index-integervalued"></a>Property: <strong>integervalued</strong></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="nonarray"></a><a name="Item_003a-Database_002fdeffn_002fnonarray"></a><dl>
<dt><a name="index-nonarray"></a>Property: <strong>nonarray</strong></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Expressions">Expressions</a>
·</div></dd></dl>
<a name="nonscalar"></a><a name="Item_003a-Database_002fdefvr_002fnonscalar"></a><dl>
<dt><a name="index-nonscalar"></a>Property: <strong>nonscalar</strong></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·<a href="maxima_424.html#Category_003a-Vectors">Vectors</a>
·<a href="maxima_424.html#Category_003a-Matrices">Matrices</a>
·</div></dd></dl>
<a name="nonscalarp"></a><a name="Item_003a-Database_002fdeffn_002fnonscalarp"></a><dl>
<dt><a name="index-nonscalarp"></a>Function: <strong>nonscalarp</strong> <em>(<var>expr</var>)</em></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>
Categories:<a href="maxima_424.html#Category_003a-Predicate-functions">Predicate functions</a>
·<a href="maxima_424.html#Category_003a-Vectors">Vectors</a>
·<a href="maxima_424.html#Category_003a-Matrices">Matrices</a>
·</div></dd></dl>
<a name="posfun"></a><a name="Item_003a-Database_002fdefvr_002fposfun"></a><dl>
<dt><a name="index-posfun"></a>Property: <strong>posfun</strong></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·<a href="maxima_424.html#Category_003a-Operators">Operators</a>
·</div></dd></dl>
<a name="printprops"></a><a name="Item_003a-Database_002fdeffn_002fprintprops"></a><dl>
<dt><a name="index-printprops"></a>Function: <strong>printprops</strong> <em><br> <tt>printprops</tt> (<var>a</var>, <var>i</var>) <br> <tt>printprops</tt> ([<var>a_1</var>, …, <var>a_n</var>], <var>i</var>) <br> <tt>printprops</tt> (all, <var>i</var>)</em></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_101.html#atvalue">atvalue</a></code>,<!-- /@w -->
<code><a href="maxima_101.html#atomgrad">atomgrad</a></code>, <code><a href="maxima_101.html#gradef">gradef</a></code>, and <code><a href="maxima_162.html#matchdeclare">matchdeclare</a></code>.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·<a href="maxima_424.html#Category_003a-Display-functions">Display functions</a>
·</div></dd></dl>
<a name="properties"></a><a name="Item_003a-Database_002fdeffn_002fproperties"></a><dl>
<dt><a name="index-properties"></a>Function: <strong>properties</strong> <em>(<var>a</var>)</em></dt>
<dd>
<p>Returns a list of the names of all the properties associated with the atom
<var>a</var>.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="props"></a><a name="Item_003a-Database_002fdefvr_002fprops"></a><dl>
<dt><a name="index-props"></a>System variable: <strong>props</strong></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_8.html#infolists">infolists</a></code>, such as specified by <code><a href="maxima_101.html#atvalue">atvalue</a></code>,<!-- /@w -->
<code><a href="maxima_162.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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·<a href="maxima_424.html#Category_003a-Global-variables">Global variables</a>
·</div></dd></dl>
<a name="propvars"></a><a name="Item_003a-Database_002fdeffn_002fpropvars"></a><dl>
<dt><a name="index-propvars"></a>Function: <strong>propvars</strong> <em>(<var>prop</var>)</em></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="put"></a><a name="Item_003a-Database_002fdeffn_002fput"></a><dl>
<dt><a name="index-put"></a>Function: <strong>put</strong> <em>(<var>atom</var>, <var>value</var>, <var>indicator</var>)</em></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="qput"></a><a name="Item_003a-Database_002fdeffn_002fqput"></a><dl>
<dt><a name="index-qput"></a>Function: <strong>qput</strong> <em>(<var>atom</var>, <var>value</var>, <var>indicator</var>)</em></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>
<div class="example">
<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>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="rational"></a><a name="irrational"></a><a name="Item_003a-Database_002fdefvr_002frational"></a><dl>
<dt><a name="index-rational-1"></a>Property: <strong>rational</strong></dt>
<dd><a name="Item_003a-Database_002fdefvr_002firrational"></a></dd><dt><a name="index-irrational"></a>Property: <strong>irrational</strong></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="real"></a><a name="imaginary"></a><a name="complex"></a><a name="Item_003a-Database_002fdefvr_002freal"></a><dl>
<dt><a name="index-real"></a>Property: <strong>real</strong></dt>
<dd><a name="Item_003a-Database_002fdefvr_002fimaginary"></a></dd><dt><a name="index-imaginary"></a>Property: <strong>imaginary</strong></dt>
<dd><a name="Item_003a-Database_002fdefvr_002fcomplex"></a></dd><dt><a name="index-complex"></a>Property: <strong>complex</strong></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="rem"></a><a name="Item_003a-Database_002fdeffn_002frem"></a><dl>
<dt><a name="index-rem"></a>Function: <strong>rem</strong> <em>(<var>atom</var>, <var>indicator</var>)</em></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="remove"></a><a name="Item_003a-Database_002fdeffn_002fremove"></a><dl>
<dt><a name="index-remove"></a>Function: <strong>remove</strong> <em><br> <tt>remove</tt> (<var>a_1</var>, <var>p_1</var>, …, <var>a_n</var>, <var>p_n</var>) <br> <tt>remove</tt> ([<var>a_1</var>, …, <var>a_m</var>], [<var>p_1</var>, …, <var>p_n</var>], …) <br> <tt>remove</tt> ("<var>a</var>", operator) <br> <tt>remove</tt> (<var>a</var>, transfun) <br> <tt>remove</tt> (all, <var>p</var>)</em></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><a href="maxima_170.html#mode_005fdeclare">mode_declare</a></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_41.html#prefix">prefix</a></code>, <code><a href="maxima_41.html#infix">infix</a></code>,<!-- /@w -->
<code><a href="maxima_41.html#function_005fnary">nary</a></code>, <code><a href="maxima_41.html#postfix">postfix</a></code>, <code><a href="maxima_41.html#matchfix">matchfix</a></code>, or
<code><a href="maxima_41.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_159.html#remvalue">remvalue</a></code>, <code><a href="maxima_24.html#remarray">remarray</a></code>, <code><a href="maxima_170.html#remfunction">remfunction</a></code>, and
<code><a href="maxima_162.html#remrule">remrule</a></code>.
</p>
<p><code>remove</code> quotes its arguments.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="scalar"></a><a name="Item_003a-Database_002fdefvr_002fscalar"></a><dl>
<dt><a name="index-scalar"></a>Property: <strong>scalar</strong></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>
Categories:<a href="maxima_424.html#Category_003a-Declarations-and-inferences">Declarations and inferences</a>
·</div></dd></dl>
<a name="scalarp"></a><a name="Item_003a-Database_002fdeffn_002fscalarp"></a><dl>
<dt><a name="index-scalarp"></a>Function: <strong>scalarp</strong> <em>(<var>expr</var>)</em></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>
Categories:<a href="maxima_424.html#Category_003a-Predicate-functions">Predicate functions</a>
·<a href="maxima_424.html#Category_003a-Vectors">Vectors</a>
·<a href="maxima_424.html#Category_003a-Matrices">Matrices</a>
·</div></dd></dl>
<a name="Item_003a-Database_002fnode_002fFunctions-and-Variables-for-Facts"></a><hr>
<div class="header">
<p>
Next: <a href="maxima_63.html#Functions-and-Variables-for-Facts" accesskey="n" rel="next">Functions and Variables for Facts</a>, Previous: <a href="maxima_61.html#Introduction-to-Maxima_0027s-Database" accesskey="p" rel="previous">Introduction to Maxima's Database</a>, Up: <a href="maxima_60.html#Maxima_0027s-Database" accesskey="u" rel="up">Maxima's Database</a> [<a href="maxima_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="maxima_423.html#Function-and-Variable-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|