ArticleslgStudy

computer science

Term indexing

Term indexing 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 Term indexing rather than just read about it. In short: In computer science, a term index is a data structure to facilitate fast lookup of terms and clauses in a logic program, deductive database, or automated theorem prover. Overview Many operations in automatic theorem provers require search in huge collections of terms and clauses.

Key takeaways

  • Term indexing 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 Term indexing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Term indexing from memory before moving on to harder problems.

Reference excerpt

In computer science, a term index is a data structure to facilitate fast lookup of terms and clauses in a logic program, deductive database, or automated theorem prover.

Overview Many operations in automatic theorem provers require search in huge collections of terms and clauses. Such operations typically fall into the following scheme. Given a collection S {\displaystyle S} of terms (clauses) and a query term (clause) q {\displaystyle q} , find in S {\displaystyle S} some/all terms t {\displaystyle t} related to q {\displaystyle q} according to a certain retrieval condition. Most interesting retrieval conditions are formulated as existence of a substitution that relates in a special way the query and the retrieved objects t {\displaystyle t} . Here is a list of retrieval conditions frequently used in provers:

term q {\displaystyle q} is unifiable with term t {\displaystyle t} , i.e., there exists a substitution θ {\displaystyle \theta } , such that q θ {\displaystyle q\theta } = t θ {\displaystyle t\theta }

term t {\displaystyle t} is an instance of q {\displaystyle q} , i.e., there exists a substitution θ {\displaystyle \theta } , such that q θ {\displaystyle q\theta } = t {\displaystyle t}

term t {\displaystyle t} is a generalisation of q {\displaystyle q} , i.e., there exists a substitution θ {\displaystyle \theta } , such that q {\displaystyle q} = t θ {\displaystyle t\theta }

clause q {\displaystyle q} θ-subsumes clause t {\displaystyle t} , i.e., there exists a substitution θ {\displaystyle \theta } , such that q θ {\displaystyle q\theta } is a subset/submultiset of t {\displaystyle t}

clause q {\displaystyle q} is θ-subsumed by t {\displaystyle t} , i.e., there exists a substitution θ {\displaystyle \theta } , such that t θ {\displaystyle t\theta } is a subset/submultiset of q {\displaystyle q}

More often than not, we are actually interested in finding the appropriate substitutions explicitly, together with the retrieved terms t {\displaystyle t} , rather than just in establishing existence of such substitutions. Very often the sizes of term sets to be searched are large, the retrieval calls are frequent and the retrieval condition test is rather complex. In such situations linear search in S {\displaystyle S} , when the retrieval condition is tested on every term from S {\displaystyle S} , becomes prohibitively costly. To overcome this problem, special data structures, called indexes, are designed in order to support fast retrieval. Such data structures, together with the accompanying algorithms for index maintenance and retrieval, are called term indexing techniques.

Classic indexing techniques discrimination trees substitution trees path indexing Substitution trees outperform path indexing, discrimination tree indexing, and abstraction trees. A discrimination tree term index stores its information in a trie data structure.

Indexing techniques used in logic programming First-argument indexing is the most common strategy where the first argument is used as index. It distinguishes atomic values and the principal functor of compound terms. Nonfirst argument indexing is a variation of first-argument indexing that uses the same or similar techniques as first-argument indexing on one or more alternative arguments. For instance, if a predicate call uses variables for the first argument, the system may choose to use the second argument as the index instead. Multiargument indexing creates a combined index over multiple instantiated arguments if there is not a sufficiently selective single argument index. Deep indexing is used when multiple clauses use the same principal functor for some argument. It recursively uses the same or similar indexing techniques on the arguments of the compound terms. Trie indexing uses a prefix tree to find applicable clauses.

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Term indexing

Start with the simplest possible case. Write down what Term indexing 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 Term indexing 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 Term indexing 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 Term indexing

In research
Term indexing 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 Term indexing 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
Term indexing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data structures, Logic programming, Theorem proving software systems, so understanding it makes those chapters shorter.
In everyday life
Look for Term indexing 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.

Affiliate

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

How to study Term indexing in 20 minutes

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

Frequently asked questions

What is Term indexing in simple terms?

In computer science, a term index is a data structure to facilitate fast lookup of terms and clauses in a logic program, deductive database, or automated theorem prover. Overview Many operations in automatic theorem provers require search in huge collections of terms and clauses.

Why does Term indexing 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 Term indexing?

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 Term indexing.

Tags

  • Data structures
  • Logic programming
  • Theorem proving software systems

Keep exploring