Term rewriting is a general model of computation that investigates a wide range of (potentially non-deterministic) methods of replacing subterms of syntactic expression, more precisely an element of a term-algebra (over some set of variables) with other terms.
Questions tagged [term-rewriting]
74 questions
14
votes
2 answers
Confluence proof for a simple rewriting system
Assume we have a simple language that consists of the terms:
$\mathtt{true}$
$\mathtt{false}$
if $t_1,t_2,t_3$ are terms then so is $\mathtt{if}\: t_1 \:\mathtt{then}\: t_2 \:\mathtt{else}\: t_3$
Now assume the following logical evaluation…
codd
- 701
- 3
- 14
13
votes
3 answers
Why Term Rewriting?
I've done a bit of googleing and have come up a bit short.
I am wondering what are the main reasons for computing scientists, programmers,
to study term rewriting, and/or term graph rewriting.
As far as I can tell, it just helps for basic reasoning…
Musa Al-hassy
- 894
- 1
- 5
- 9
11
votes
1 answer
Is it possible to derive a string in this rewriting system?
Rewriting system is a set of rules in the form of $A \leftrightarrow B$.
If we apply that rule to a string $w$ we replace any substring $A$ in $w$ with a substring $B$ and vice versa.
Given a starting string $AAABB$ can we derive $BAAB$ in the…
Daniil
- 2,207
- 19
- 24
10
votes
2 answers
Confluence of beta expansion
Let $\to_\beta$ be $\beta$-reduction in the $\lambda$-calculus. Define $\beta$-expansion $\leftarrow_\beta$ by $t'\leftarrow_\beta t \iff t\to_\beta t'$.
Is $\leftarrow_\beta$ confluent? In other words, do we have that for any $l,d,r$, if $l…
xavierm02
- 1,255
- 6
- 14
9
votes
1 answer
Term Rewriting vs Unification
How is term rewriting different from unification, and what's the difference between term rewriting languages and logic programming, like Prolog?
MWB
- 515
- 3
- 11
8
votes
1 answer
Intuitive explanation of neutral / normal form in lambda calculus
It is possible to distinguish Normal terms which don't contain beta redex as a sub-expression, from others like so
data WithBound a = Var | Other a
data Normal a
= Neutral (Neutral a)
| Abstract (Normal (WithBound a))
data Neutral a
=…
nicolas
- 325
- 1
- 6
8
votes
2 answers
TAPL: Explanation and example(s) for satisfied
This question arises from my reading of "Types and Programming Languages" (WorldCat) by Benjamin C. Pierce.
On page 36 is the definition for satisfied
A rule is satisfied by a relation if, for each instance of the rule,
either the conclusion is…
Guy Coder
- 5,181
- 2
- 30
- 65
7
votes
1 answer
Simplest Turing-complete ruleset for Markov algorithm
Is there an example of a particular ruleset for a Markov algorithm that is Turing-complete? If so, what is the simplest example of such a ruleset?
user76284
- 436
- 2
- 12
7
votes
1 answer
Reduction rule for IF?
I'm working through Simon Peyton Jones' "The Implementation of Functional Programming Languages" and on page 20 I see:
IF TRUE ((λp.p) 3) ↔ IF TRUE 3 (per β red) (1)
↔ (λx.IF TRUE 3 x) (per η red) (2)
…
galaxybeing
- 71
- 1
6
votes
1 answer
Properties of a term rewrite rule
While doing some bibliography on term-rewriting, I often found these two properties to define a term rewrite rule (see for example here and this one):
A term rewrite rule is a pair $\langle l,r\rangle$ of terms, written $l \rightarrow r$, such…
noutoff
- 63
- 5
6
votes
1 answer
call by value: what is a value?
In the 'call by value' evaluation of lambda-calculus, I am bit confused with 'value'.
On page 57 of the book Types and Programming languages, it is said:
The definition of call by value, in which only outermost redexes are reduced and where a…
alim
- 1,044
- 7
- 24
6
votes
2 answers
Universal binary rewriting system
What is the simplest example of a rewriting system from binary strings to binary strings
$$f:\Sigma^*\rightarrow\Sigma^*\qquad\Sigma=\{0,1\}$$
that can perform universal computation? Binary string rewriting systems in general can compute any…
user76284
- 436
- 2
- 12
6
votes
2 answers
The meaning of modulo in “formula modulo a background theory”
I have been reading some papers where I keep reading stuff like “first-order formula modulo a background theory”. Does anyone know what modulo means in this case ? Is it something like “with respect to”?
Cemre
- 163
- 4
6
votes
2 answers
Elegant algorithm to semi-decide if two lambda calculus terms are equivalent
Given two lambda terms $t_1$ and $t_2$, it is semi-decidable if they are equivalent (i.e. can be rewritten as each other using alpha, beta, and eta conversions). An algorithm to do this is to try every sequence of rewrites starting with $t_1$, and…
Christopher King
- 788
- 1
- 5
- 19
5
votes
1 answer
How was Idris' `rewrite` implemented?
I know in Agda, rewrite is a syntax sugar that desugars to a with abstraction.
For example, if we have (I'm using the Data.Vec from the standard…
ice1000
- 980
- 6
- 35