ArticleslgStudy

computer science

Normal form (abstract rewriting)

Normal form (abstract rewriting) is a computer 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 Normal form (abstract rewriting) rather than just read about it. In short: In abstract rewriting, an object is in normal form if it cannot be rewritten any further, i.e. it is irreducible. Depending on the rewriting system, an object may rewrite to several normal forms or none at all.

Normal form (abstract rewriting) — main illustration
Normal form (abstract rewriting) — illustration

Key takeaways

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

Reference excerpt

In abstract rewriting, an object is in normal form if it cannot be rewritten any further, i.e. it is irreducible. Depending on the rewriting system, an object may rewrite to several normal forms or none at all. Many properties of rewriting systems relate to normal forms.

Definitions Stated formally, if (A,→) is an abstract rewriting system, x∈A is in normal form if no y∈A exists such that x→y, i.e. x is an irreducible term. An object a is weakly normalizing if there exists at least one particular sequence of rewrites starting from a that eventually yields a normal form. A rewriting system has the weak normalization property or is (weakly) normalizing (WN) if every object is weakly normalizing. An object a is strongly normalizing if every sequence of rewrites starting from a eventually terminates with a normal form. A rewriting system is strongly normalizing, terminating, noetherian, or has the (strong) normalization property (SN), if each of its objects is strongly normalizing. A rewriting system has the normal form property (NF) if for all objects a and normal forms b, b can be reached from a by a series of rewrites and inverse rewrites only if a reduces to b. A rewriting system has the unique normal form property (UN) if for all normal forms a, b ∈ S, a can be reached from b by a series of rewrites and inverse rewrites only if a is equal to b. A rewriting system has the unique normal form property with respect to reduction (UN→) if for every term reducing to normal forms a and b, a is equal to b.

Results This section presents some well known results. First, SN implies WN. Confluence (abbreviated CR) implies NF implies UN implies UN→. The reverse implications do not generally hold. {a→b,a→c,c→c,d→c,d→e} is UN→ but not UN as b=e and b,e are normal forms. {a→b,a→c,b→b} is UN but not NF as b=c, c is a normal form, and b does not reduce to c. {a→b,a→c,b→b,c→c} is NF as there are no normal forms, but not CR as a reduces to b and c, and b,c have no common reduct. WN and UN→ imply confluence. Hence CR, NF, UN, and UN→ coincide if WN holds.

Examples One example is that simplifying arithmetic expressions produces a number - in arithmetic, all numbers are normal forms. A remarkable fact is that all arithmetic expressions have a unique value, so the rewriting system is strongly normalizing and confluent:

(3 + 5) * (1 + 2) ⇒ 8 * (1 + 2) ⇒ 8 * 3 ⇒ 24 (3 + 5) * (1 + 2) ⇒ (3 + 5) * 3 ⇒ 3*3 + 5*3 ⇒ 9 + 5*3 ⇒ 9 + 15 ⇒ 24 Examples of non-normalizing systems (not weakly or strongly) include counting to infinity (1 ⇒ 2 ⇒ 3 ⇒ ...) and loops such as the transformation function of the Collatz conjecture (1 ⇒ 2 ⇒ 4 ⇒ 1 ⇒ ..., it is an open problem if there are any other loops of the Collatz transformation). Another example is the single-rule system { r(x,y) → r(y,x) }, which has no normalizing properties since from any term, e.g. r(4,2) a single rewrite sequence starts, viz. r(4,2) → r(2,4) → r(4,2) → r(2,4) → ..., which is infinitely long. This leads to the idea of rewriting "modulo commutativity" where a term is in normal form if no rules but commutativity apply.

The system {b → a, b → c, c → b, c → d} (pictured) is an example of a weakly normalizing but not strongly normalizing system. a and d are normal forms, and b and c can be reduced to a or d, but the infinite reduction b → c → b → c → ... means that neither b nor c is strongly normalizing.

Untyped lambda calculus The pure untyped lambda calculus does not satisfy the strong normalization property, and not even the weak normalization property. Consider the term λ x . x x x {\displaystyle \lambda x.xxx} (application is left associative). It has the following rewrite rule: For any term t {\displaystyle t} ,

( λ x . x x x ) t → t t t {\displaystyle (\mathbf {\lambda } x.xxx)t\rightarrow ttt}

But consider what happens when we apply λ x . x x x {\displaystyle \lambda x.xxx} to itself:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Normal form (abstract rewriting)

Start with the simplest possible case. Write down what Normal form (abstract rewriting) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer 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 Normal form (abstract 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 Normal form (abstract 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 Normal form (abstract rewriting)

In research
Normal form (abstract rewriting) appears in computer 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 Normal form (abstract 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
Normal form (abstract rewriting) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computability theory, Formal languages, Lambda calculus, so understanding it makes those chapters shorter.
In everyday life
Look for Normal form (abstract 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 “Normal form (abstract rewriting)” →

Affiliate

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

How to study Normal form (abstract rewriting) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Normal form (abstract 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 Normal form (abstract rewriting) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Normal form (abstract rewriting) in simple terms?

In abstract rewriting, an object is in normal form if it cannot be rewritten any further, i.e. it is irreducible. Depending on the rewriting system, an object may rewrite to several normal forms or none at all.

Why does Normal form (abstract rewriting) matter?

Because it connects several computer 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 Normal form (abstract 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 Normal form (abstract rewriting).

Tags

  • Computability theory
  • Formal languages
  • Lambda calculus
  • Logic in computer science
  • Rewriting systems

Keep exploring