1
$\begingroup$

Is there an easy to use software that implements term-rewriting? Or do I need to write my own parser for it?

I am looking for something that will take in a fixed set of user-specified rules and will be able to reduce arbitrary terms under those rules. Is there a standard tool for doing such rewrites?

$\endgroup$
2
$\begingroup$

PLT Redex has support for term rewriting. You'll find that most of the examples are focused on small-step operational semantics for programming languages, but in general the system allows for arbitrary rewriting, including non-determinism. It also has a bunch of nice features, like randomized testing of properties, alpha-equivalence, steppers for visualising/debugging, and excellent graphical output.

If you want higher-order syntax, you might be interested in something like ELPI.

For a super-lightweight prolog-style programming, you might be interested in miniKanren.

$\endgroup$
0
0
$\begingroup$

The computer language Prolog has a term parser built in, and you can represent re-write rules in Prolog clauses, see

https://www.youtube.com/watch?v=b2Px7cu2a68

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.