-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalgebra.h
38 lines (30 loc) · 898 Bytes
/
algebra.h
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
/*
* =====================================================================================
*
* Filename: algebra.h
*
* Description: Declarations for algebraic manipulations of AST
*
* Version: 1.0
* Created: 09/20/2017 03:22:31 PM
* Revision: none
* Compiler: gcc
*
* Author: Brad Theilman (BHT), [email protected]
* Organization:
*
* =====================================================================================
*/
#ifndef ALGEBRA_H
#define ALGEBRA_H
#include "cmplr.h"
/* Function Declarations */
/* Rewrite a - b as a + (-1)*b */
Node *rewrite_minus(Node *);
/* Move integer coefficients to the left of variables */
Node *reorder_coeff(Node *);
/* Apply Distributive Law to expand expressions */
Node *expand(Node *);
/* Evaluate the numerical value of an expression tree */
int evaluate(Node *);
#endif