ArticleslgStudy

science

Path ordering (term rewriting)

Path ordering (term rewriting) is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Path ordering (term rewriting) rather than just read about it. In short: In theoretical computer science, in particular in term rewriting, a path ordering is a well-founded strict total order (>) on the set of all terms such that f(...) > g(s1,...,sn) if f .> g and f(...) > si for i=1,...,n, where (.>) is a user-given total precedence order on the set of all function symbols. Intuitively, a term f(...) is bigger than any term g(...) built from terms si smaller than f(...) using a lower-p…

Key takeaways

  • Path ordering (term rewriting) belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Path ordering (term rewriting) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Path ordering (term rewriting) from memory before moving on to harder problems.

Reference excerpt

In theoretical computer science, in particular in term rewriting, a path ordering is a well-founded strict total order (>) on the set of all terms such that

f(...) > g(s1,...,sn) if f .> g and f(...) > si for i=1,...,n, where (.>) is a user-given total precedence order on the set of all function symbols. Intuitively, a term f(...) is bigger than any term g(...) built from terms si smaller than f(...) using a lower-precedence root symbol g. In particular, by structural induction, a term f(...) is bigger than any term containing only symbols smaller than f. A path ordering is often used as reduction ordering in term rewriting, in particular in the Knuth–Bendix completion algorithm. As an example, a term rewriting system for "multiplying out" mathematical expressions could contain a rule x*(y+z) → (x*y) + (x*z). In order to prove termination, a reduction ordering (>) must be found with respect to which the term x*(y+z) is greater than the term (x*y)+(x*z). This is not trivial, since the former term contains both fewer function symbols and fewer variables than the latter. However, setting the precedence (*) .> (+), a path ordering can be used, since both x*(y+z) > x*y and x*(y+z) > x*z is easy to achieve. There may also be systems for certain general recursive functions, for example a system for the Ackermann function may contain the rule A(a+, b+) → A(a, A(a+, b)), where b+ denotes the successor of b. Given two terms s and t, with a root symbol f and g, respectively, to decide their relation their root symbols are compared first.

If f <. g, then s can dominate t only if one of s's subterms does. If f .> g, then s dominates t if s dominates each of t's subterms. If f = g, then the immediate subterms of s and t need to be compared recursively. Depending on the particular method, different variations of path orderings exist. The latter variations include:

the multiset path ordering (mpo), originally called recursive path ordering (rpo) the lexicographic path ordering (lpo) a combination of mpo and lpo, called recursive path ordering by Dershowitz, Jouannaud (1990) Dershowitz, Okada (1988) list more variants, and relate them to Ackermann's system of ordinal notations. In particular, an upper bound given on the order types of recursive path orderings with n function symbols is φ(n,0), using Veblen's function for large countable ordinals.

Formal definitions The multiset path ordering (>) can be defined as follows:

where

(≥) denotes the reflexive closure of the mpo (>), { s1,...,sm } denotes the multiset of s’s subterms, similar for t, and (>>) denotes the multiset extension of (>), defined by { s1,...,sm } >> { t1,...,tn } if { t1,...,tn } can be obtained from { s1,...,sm } by deleting at least one element, or by replacing an element by a multiset of strictly smaller (w.r.t. the mpo) elements. More generally, an order functional is a function O mapping an ordering to another one, and satisfying the following properties:

If (>) is transitive, then so is O(>). If (>) is irreflexive, then so is O(>). If s > t, then f(...,s,...) O(>) f(...,t,...). O is continuous on relations, i.e. if R0, R1, R2, R3, ... is an infinite sequence of relations, then O(∪∞i=0 Ri) = ∪∞i=0 O(Ri). The multiset extension, mapping (>) above to (>>) above is one example of an order functional: (>>)=O(>). Another order functional is the lexicographic extension, leading to the lexicographic path ordering.

References

Worked examples

Example 1 — a first encounter with Path ordering (term rewriting)

Start with the simplest possible case. Write down what Path ordering (term rewriting) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Path ordering (term rewriting) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Path ordering (term rewriting) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Path ordering (term rewriting)

In research
Path ordering (term rewriting) appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Path ordering (term rewriting) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Path ordering (term rewriting) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Order theory, Rewriting systems, so understanding it makes those chapters shorter.
In everyday life
Look for Path ordering (term rewriting) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Path ordering (term rewriting)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Path ordering (term rewriting) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Path ordering (term rewriting) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Path ordering (term rewriting) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Path ordering (term rewriting) in simple terms?

In theoretical computer science, in particular in term rewriting, a path ordering is a well-founded strict total order (>) on the set of all terms such that f(...) > g(s1,...,sn) if f .> g and f(...) > si for i=1,...,n, where (.>) is a user-given total precedence order on the set of all function sy…

Why does Path ordering (term rewriting) matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Path ordering (term rewriting)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Path ordering (term rewriting).

Tags

  • Order theory
  • Rewriting systems

Keep exploring