Skip to content

Symmath is an experiment to represent mathematical terms in Haskell and do things with them - e.g. reduce them to a simpler form, differentiate/integrate them or even solve equations like a full-fledged CAS.

License

Notifications You must be signed in to change notification settings

Spheniscida/symmath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symmath

Travis build status

Well, you've come here and may be askign yourself now: What is this here? A CAS? An equation solver? Some magical math stuff?

The answer is: A bit of everything. We're trying to develop something a software which is able to manipulate mathematical terms and equations.

How do we manipulate them? There's no simple answer to that. It's kind of a framework with the basic data types to represent terms and equations. We're putting some functions around it which may transform such terms, e.g. derivate or simplify them.

If you would like to participate, it's not that hard! Write your own function, add some clauses to the functions... Just take a look at the "Get Started" section below.

Standards and comparison

We use Texas Instruments' TI-nspire CAS calculator as a reference/example for a professional and working CAS. But we try to get better; for example Symmath.Simplify transforms x^y * z^y to (x*z)^y while the TI-nspire does not.

Modularization

Modularization is very important to us; we develop every module in a separate branch (Symmath.Simplify -> pu/simplify, Symmath.Parse -> pu/parse...). Now and then we merge all important branches into next to have a working release with all the cutting-edge features in it.

Testing

As symmath is fairly complex (like, it's not the Linux kernel but there is the possibility of introducing bugs and if they're in our codebase they are hard to discover and to fix). We use HUnit to test our algorithms on correctness and try to check them before checking in new code. Nevertheless our test coverage is quite poor.

If you're developing a feature in a module with existing tests, write one or two tests to cover your new code. Just to avoid having to fix regressions dozens of commits later.

Get Started

The core of Symmath is the SymTerm data type defined in Symmath.Terms. It's basically an abstract syntax tree (AST) type.

The Symmath module all have in common that they somehow create, transform or evaluate this AST; The RPNParse module creates SymTerms from a RPN (reverse polish notation) string, the Derivate module derivates SymTerm, the Simplify module is working hard to simplify SymTerms (e.g.: "x^a * x^a" -> "x^(2a)") and TermToTex converts SymTerms to LaTeX code.

About

Symmath is an experiment to represent mathematical terms in Haskell and do things with them - e.g. reduce them to a simpler form, differentiate/integrate them or even solve equations like a full-fledged CAS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published