
- Automata Theory - Applications
- Automata Terminology
- Basics of String in Automata
- Set Theory for Automata
- Finite Sets and Infinite Sets
- Algebraic Operations on Sets
- Relations Sets in Automata Theory
- Graph and Tree in Automata Theory
- Transition Table in Automata
- What is Queue Automata?
- Compound Finite Automata
- Complementation Process in DFA
- Closure Properties in Automata
- Concatenation Process in DFA
- Language and Grammars
- Language and Grammar
- Grammars in Theory of Computation
- Language Generated by a Grammar
- Chomsky Classification of Grammars
- Context-Sensitive Languages
- Finite Automata
- What is Finite Automata?
- Finite Automata Types
- Applications of Finite Automata
- Limitations of Finite Automata
- Two-way Deterministic Finite Automata
- Deterministic Finite Automaton (DFA)
- Non-deterministic Finite Automaton (NFA)
- NDFA to DFA Conversion
- Equivalence of NFA and DFA
- Dead State in Finite Automata
- Minimization of DFA
- Automata Moore Machine
- Automata Mealy Machine
- Moore vs Mealy Machines
- Moore to Mealy Machine
- Mealy to Moore Machine
- Myhill–Nerode Theorem
- Mealy Machine for 1’s Complement
- Finite Automata Exercises
- Complement of DFA
- Regular Expressions
- Regular Expression in Automata
- Regular Expression Identities
- Applications of Regular Expression
- Regular Expressions vs Regular Grammar
- Kleene Closure in Automata
- Arden’s Theorem in Automata
- Convert Regular Expression to Finite Automata
- Conversion of Regular Expression to DFA
- Equivalence of Two Finite Automata
- Equivalence of Two Regular Expressions
- Convert Regular Expression to Regular Grammar
- Convert Regular Grammar to Finite Automata
- Pumping Lemma in Theory of Computation
- Pumping Lemma for Regular Grammar
- Pumping Lemma for Regular Expression
- Pumping Lemma for Regular Languages
- Applications of Pumping Lemma
- Closure Properties of Regular Set
- Closure Properties of Regular Language
- Decision Problems for Regular Languages
- Decision Problems for Automata and Grammars
- Conversion of Epsilon-NFA to DFA
- Regular Sets in Theory of Computation
- Context-Free Grammars
- Context-Free Grammars (CFG)
- Derivation Tree
- Parse Tree
- Ambiguity in Context-Free Grammar
- CFG vs Regular Grammar
- Applications of Context-Free Grammar
- Left Recursion and Left Factoring
- Closure Properties of Context Free Languages
- Simplifying Context Free Grammars
- Removal of Useless Symbols in CFG
- Removal Unit Production in CFG
- Removal of Null Productions in CFG
- Linear Grammar
- Chomsky Normal Form (CNF)
- Greibach Normal Form (GNF)
- Pumping Lemma for Context-Free Grammars
- Decision Problems of CFG
- Pushdown Automata
- Pushdown Automata (PDA)
- Pushdown Automata Acceptance
- Deterministic Pushdown Automata
- Non-deterministic Pushdown Automata
- Construction of PDA from CFG
- CFG Equivalent to PDA Conversion
- Pushdown Automata Graphical Notation
- Pushdown Automata and Parsing
- Two-stack Pushdown Automata
- Turing Machines
- Basics of Turing Machine (TM)
- Representation of Turing Machine
- Examples of Turing Machine
- Turing Machine Accepted Languages
- Variations of Turing Machine
- Multi-tape Turing Machine
- Multi-head Turing Machine
- Multitrack Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- K-dimensional Turing Machine
- Enumerator Turing Machine
- Universal Turing Machine
- Restricted Turing Machine
- Convert Regular Expression to Turing Machine
- Two-stack PDA and Turing Machine
- Turing Machine as Integer Function
- Post–Turing Machine
- Turing Machine for Addition
- Turing Machine for Copying Data
- Turing Machine as Comparator
- Turing Machine for Multiplication
- Turing Machine for Subtraction
- Modifications to Standard Turing Machine
- Linear-Bounded Automata (LBA)
- Church's Thesis for Turing Machine
- Recursively Enumerable Language
- Computability & Undecidability
- Turing Language Decidability
- Undecidable Languages
- Turing Machine and Grammar
- Kuroda Normal Form
- Converting Grammar to Kuroda Normal Form
- Decidability
- Undecidability
- Reducibility
- Halting Problem
- Turing Machine Halting Problem
- Rice's Theorem in Theory of Computation
- Post’s Correspondence Problem (PCP)
- Types of Functions
- Recursive Functions
- Injective Functions
- Surjective Function
- Bijective Function
- Partial Recursive Function
- Total Recursive Function
- Primitive Recursive Function
- μ Recursive Function
- Ackermann’s Function
- Russell’s Paradox
- Gödel Numbering
- Recursive Enumerations
- Kleene's Theorem
- Kleene's Recursion Theorem
- Advanced Concepts
- Matrix Grammars
- Probabilistic Finite Automata
- Cellular Automata
- Reduction of CFG
- Reduction Theorem
- Regular expression to ∈-NFA
- Quotient Operation
- Parikh’s Theorem
- Ladner’s Theorem
Primitive Recursive Functions in Automata Theory
Primitive recursive functions are a subclass of total recursive functions. These functions play an important role formal language and automata theory. They are computable functions that can be constructed using simple operations like zero functions, successor functions, projection functions, and more complex operations such as composition and recursion.
In this chapter, we will cover the basic concepts of primitive recursive functions and provide examples for a better understanding.
Recursive Functions
For a basic recap, first understand the broader category of recursive functions, which include partial and total recursive functions.
Partial and Total Functions
A function is termed partial if it is not defined for all possible inputs, meaning for some inputs, the function might not yield a result. Conversely, a total function is defined for every possible input within a given set, meaning it always produces a result.
Example
Let A and B be sets of positive integers. If a function f(x) is defined as x2, the relation A → B only exists if x belongs to the set of perfect squares like 4, 9, 16, etc. Here, f(16) is defined, but f(20) is undefined, making it a partial function. On the other hand, if we define a function f(x) = x + 1, it is a total function because it is defined for all integers.
Partial and Total Recursive Functions
When it comes to recursive functions −
- Partial recursive functions are those computed by a Turing machine that may not halt for every input, potentially running indefinitely for some cases.
- Total recursive functions are a subset of partial recursive functions for which the Turing machine always halts and returns a result for every input.
Example
The addition of two integers, f(x, y) = x + y, is a total recursive function because it always produces a result regardless of the values of x and y.
Concept of Primitive Recursive Functions
Primitive recursive functions are a further subset of total recursive functions. They are important because they can be defined through a finite number of basic operations, such as composition and recursion, starting from a few basic functions like the zero function, successor function, and projection function.
Defining Primitive Recursive Functions
Formally, a function $\mathrm{f(x_1,\: x_2, \: ...\: ,x_n)}$ is primitive recursive if it can be expressed as follows −
$$\mathrm{f(x_1,\: x_2,\: \dotso \:,x_n \:\: 1,\: 0) \:=\: g(x_1,\: x_2,\: \dotso \:,x_n\: \: 1)}$$
$$\mathrm{f(x_1, \: x_2, \:\dotso,\: x_n \:\: 1,\: y \:+\: 1) \:=\: h(x_1,\: x_2,\: \dotso,\: x_n,\: f(x_1,\: x_2,\: \dotso,\: x_n \:\: 1,\: y))}$$
Where g and h are also primitive recursive functions.
Examples of Primitive Recursive Functions
In this section, let's take a look at some basic examples of primitive recursive functions.
Zero Function
The zero function Z(x) = 0 for all x N (where N is the set of natural numbers) is a basic primitive recursive function. It essentially erases its input and returns zero.
Example
A Turing machine can be designed to simulate this function by moving through the input and replacing every symbol with zero.

Successor Function
The successor function S(x) = x + 1 for all x N is another basic primitive recursive function. It simply increments the value of its input by 1.
Example
A Turing machine simulating the successor function would move to the rightmost position and add a '1' to the input value.

Projection Function
Projection functions are denoted as Pin(x1, x2, , xn) = xi. They return the i-th input from the list of inputs.
Example
A Turing machine can be designed to take a sequence of inputs and output the i-th input by counting and projecting it.
Composing and Recursing Functions
Primitive recursive functions can also be formed by composing these basic functions or by recursion.
Example 1: Adding two numbers is primitive recursive.
$$\mathrm{f(x,\: y) \:=\: x \:+\: y}$$
$$\mathrm{f(x,\: 0) \:=\: x}$$
$$\mathrm{f(x,\: y \:+\: 1) \:=\: f(x,\: y) \:+\: 1 }$$
This function can be constructed from the zero and successor functions, making it primitive recursive.
Example 2: Multiplying two numbers is primitive recursive.
$$\mathrm{f(x,\: y) \:=\: x\: \times \: y}$$
$$\mathrm{f(x,\: 0) \:=\: 0}$$
$$\mathrm{f(x,\:y \:+\: 1) \:=\: f(x,\: y) \:+\: x }$$
Since addition is primitive recursive, multiplication is also primitive recursive by composition.
Example 3: Exponentiation, where f(x, y) = xy, is primitive recursive.
$$\mathrm{f(x,\: 0) \:=\: 1}$$
$$\mathrm{f(x,\: y \:+\: 1) \:=\: (x,\: y) \:\times\: x}$$
Given that multiplication is primitive recursive, so is exponentiation.
Advanced Example: Factorial Function
Let us prove that the factorial function, fact(x), is primitive recursive.
- Base Case: fact(0) = 1
- Recursive Step: fact(x + 1) = (x + 1) fact(x)
Here, since multiplication is primitive recursive, the factorial function, constructed through recursion, is also primitive recursive.
Conclusion
In this chapter, we explored the concept of primitive recursive functions. Starting with the basics of recursive functions, we covered partial and total recursive functions. We explained the construction of primitive recursive functions with examples such as the zero function, successor function, and more complex functions like addition, multiplication, and exponentiation, for a better understanding.