Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplify Regular Expression in Mathematica

I recently found out about Kleene algebra for manipulating and simplifying regular expressions.

I'm wondering if this has been build into any computational software programs like Mathematica? It would be great to have a computational tool for doing unions and concatenations of large expressions and have the computer simplify them.

If you are not aware of any programs with this algebra built in, do you know any programs that allow extending their engines with new algebras?

like image 587
Thomas Ahle Avatar asked Jan 14 '12 00:01

Thomas Ahle


People also ask

What is simplify in Mathematica?

Simplify tries expanding, factoring, and doing many other transformations on expressions, keeping track of the simplest form obtained. Simplify can be used on equations, inequalities, and domain specifications. Quantities that appear algebraically in inequalities are always assumed to be real.

What does N do in Mathematica?

N converts all nonzero numbers to Real or Complex form. N converts each successive argument of any function it encounters to numerical form, unless the head of the function has an attribute such as NHoldAll. You can define numerical values of functions using N[f[args]]:=value and N[f[args],n]:=value.


1 Answers

On http://www.maplesoft.com/msw/program/MSW04FinalProgram.pdf, it states:

One of the basic results of the theory of finite automata is the famous Kleene theorem, which states that a language is acceptable by a finite automaton if and only if it can be represented by a regular expression.

and

The main difficulty of the algorithmic treatment of regular expressions is, however, their simplification. Although several identities are known concerning regular expressions, e.g., the rules of Kleene algebra, there does not exist an effective algorithm for solving the simplification problem of regular expressions.

and

Under the circumstances, the only way left is to develop heuristic algorithms for simplifying regular expressions. For the aut package, this paper outlines the Maple procedures Rsimplify, Rabsorb and Rexpand.

Im wondering if open-source implementations of Kleene Algebra algorithms exist.

like image 144
propaganda Avatar answered Sep 20 '22 03:09

propaganda