Skip to content

A versatile mathematical expression parser and evaluator for computational mathematics. It simplifies understanding, evaluation, and visualization of mathematical expressions.

Notifications You must be signed in to change notification settings

shivatejapecheti/Abstract-Syntax-Tree-Visualization-of-Mathematical-Expressions

Repository files navigation

Abstract-Syntax-Tree-Visualization-of-Mathematical-Expressions

Presented research paper at CSITSS-2023 conference, showcasing expertise in the conference's subject areas. Paper Link

A versatile mathematical expression parser and evaluator for computational mathematics. It simplifies understanding, evaluation, and visualization of expressions. Valuable in education and programming, enabling hands-on learning and quick expression evaluation.

Overview

This project presents a novel method for finding and evaluating mathematical expressions using Abstract Syntax Trees (AST). The approach is adaptable for both academic and professional applications, accurately parsing complex equations and accommodating a variety of mathematical operations. The AST model ensures a hierarchical expression structure, facilitating accurate and efficient evaluation. The project stands out by incorporating interactive graph visualization, simplifying mathematical computations for understanding and application.

Key Features

  • AST-based Parsing: Accurate parsing of mathematical expressions using Abstract Syntax Trees.
  • Interactive Graph Visualization: Visual representation of functions for intuitive understanding.
  • Comprehensive Expression Handling: Accommodates a wide range of functions, variables, and mathematical operations.
  • Error Handling: Robust error management for missing operators, unusual tokens, and syntax problems.

Usage

  1. Lexical Analysis: Tokenizes input mathematical expressions, identifying numbers, operators, functions, brackets, and variables.
  2. Abstract Syntax Tree (AST): Constructs a hierarchical AST representing the expression's structure.
  3. Parsing Technique: Utilizes Recursive Descent Parsing for AST creation, applying grammar rules and maintaining operator precedence.
  4. Evaluation of Expressions: Recursively evaluates AST nodes for accurate numerical and variable results.
  5. Graph Visualization: Introduces graph plots for functions, aiding in understanding and analysis.

Experimental Results

  1. Test Case 0: Basic Mixed Mathematical Expression with Variables:

Input: a + b * (c - d) / e

Test case 0

  1. Test Case 1: Arithmetic, Trigonometric, and Exponential Functions with Variable Handling and Graph Visualization

Input: a + b * c / d - sqrt(25) * exp(2)

Test case 1

  1. Test Case 2: Advanced Mathematical Expressions with Variables and Graph Visualization:

Input: log(175)+2*(5*17)!-sin(x)-cot(y)+exp(10)+cosec(90)

test case 2

Applications

  1. Academia: Useful for educators, students, and researchers for teaching and understanding complex mathematical concepts.
  2. Professionals: Facilitates precise mathematical modeling, simulations, and data analysis.
  3. Developers: A valuable tool for building applications requiring mathematical expression evaluation and visualization.

Conclusion

This research work introduces an efficient and accurate approach to mathematical expression recognition and evaluation. The combination of Recursive Descent Parsing and AST ensures reliability, and the integration of graph visualization enhances understanding. The project's success in handling complex expressions and providing insightful visualizations showcases its potential for diverse applications.

About

A versatile mathematical expression parser and evaluator for computational mathematics. It simplifies understanding, evaluation, and visualization of mathematical expressions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published