File: stdopers.mpi

package info (click to toggle)
mathpiper 0.0.svn2556-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 7,416 kB
  • ctags: 2,729
  • sloc: java: 21,643; xml: 751; sh: 105; makefile: 5
file content (110 lines) | stat: -rw-r--r-- 2,298 bytes parent folder | download
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

/* stdopers is loaded immediately after MathPiper is started. It contains
 * the definitions of the infix operators, so the parser can already
 * parse expressions containing these operators, even though the
 * function hasn't been defined yet.
 */

Infix("=",90);
Infix("And",1000);
RightAssociative("And");
Infix("Or", 1010);
Prefix("Not", 100);
Infix("<",90);
Infix(">",90);
Infix("<=",90);
Infix(">=",90);
Infix("!=",90);

Infix(":=",10000);
RightAssociative(":=");

Infix("+",70);
Infix("-",70);
RightPrecedence("-",40);
Infix("/",30);
Infix("*",40);
Infix("^",20);
RightAssociative("^");
Prefix("+",50);
Prefix("-",50);
RightPrecedence("-",40);
Bodied("For",60000);
Bodied("Until",60000);
Postfix("++",5);
Postfix("--",5);
Bodied("ForEach",60000);
Infix("<<",10);
Infix(">>",10);
Bodied("D",60000);
Bodied("Deriv",60000);
Infix("X",30);
Infix(".",30);
Infix("o",30);
Postfix("!", 30);
Postfix("!!", 30);
Infix("***", 50);
Bodied("Integrate",60000);

Bodied("Limit",60000);

/* functional operators */
Infix(":",70);
RightAssociative(":");
Infix("@",600);
Infix("/@",600);
Infix("..",600);

Bodied("Taylor",60000);
Bodied("Taylor1",60000);
Bodied("Taylor2",60000);
Bodied("Taylor3",60000);
Bodied("InverseTaylor",60000);

Infix("<--",10000);
Infix("#",9900);

Bodied("TSum",60000);
Bodied("TExplicitSum",60000);
Bodied("TD",5);  /* Tell the MathPiper interpreter that TD is to be used as TD(i)f */

/* Operator to be used for non-evaluating comparisons */
Infix("==",90);
Infix("!==",90);

/* Operators needed for propositional logic theorem prover */
Infix("=>",10000); /* implication, read as 'implies' */


Bodied("if",5);
Infix("else",60000);
RightAssociative("else");
/* Bitwise operations we REALLY need. Perhaps we should define them
   also as MathPiper operators?
 */
Infix("&",50);
Infix("|",50);
Infix("%",50);

/* local pattern replacement operators */
Infix("/:",20000);
Infix("/::",20000);
Infix("<-",10000);

/* Operators used for manual layout */
Infix("<>", OpPrecedence("="));
Infix("<=>", OpPrecedence("="));

/* Operators for Solve: Where and AddTo */
Infix("Where", 11000);
Infix("AddTo", 2000);

Bodied("Function",60000);
Bodied("Macro",60000);

Bodied(Assert, 60000);

// Defining very simple functions, in scripts that can be converted to plugin.
Bodied("Defun",0);