AI Glossary / Graphs and symbolic AI / Beginner
Arity
Definition
Arity is the number of arguments that a function, predicate, relation, or operation takes. A unary predicate has one argument, a binary predicate has two, and a ternary predicate has three. In formal logic, arity is part of a symbol's specification and helps determine whether an expression is correctly formed.
What it means
Consider Available(room1), which applies a property to one room. Its predicate has arity one. ReservedBy(room1, maya) relates a room to a person and has arity two. Scheduled(room1, maya, morning) uses three positions and has arity three.
Arity counts argument positions, not the number of different objects, facts in a database, or words in a name. SameAs(room1, room1) still has two arguments even though both positions contain the same term.
The concept matters in symbolic AI because rules and queries must agree on the structure of the relationships they use. A mismatch can be a syntax error or, in some systems, refer to a different symbol entirely.
How it works
A formal vocabulary gives each predicate or function symbol a fixed number of argument places. Applying the symbol requires supplying the corresponding number of terms in the specified order.
For an n-ary predicate over a domain D, its interpretation specifies which n-tuples of domain objects make it true. A binary predicate therefore concerns ordered pairs. Reversing arguments can change the meaning even though the arity remains the same.
Function symbols also have arity, but their role differs: a function application denotes a value or object, while a predicate application forms a statement that can be true or false. ParentOf(person) can be a unary function in a suitable model; Parent(person, child) can be a binary predicate.
Some languages permit zero-argument symbols or variable-argument functions. A zero-argument predicate behaves like a proposition. These conventions should be checked in the language being used rather than assumed from ordinary punctuation or naming style.
Three practical examples
1. A knowledge-base designer documents assigned(person, task) as a binary relation, ensuring that imported data uses the same two argument roles.
2. A rule checker rejects connected(a, b, c) when connected was declared as a binary predicate. It identifies a structural mismatch before reasoning proceeds.
3. A query author distinguishes available(room) from available(room, time). The latter expresses time-specific availability and needs different rules or an explicit translation.
Think of it this way
Think of arity as the number of labeled spaces on a structured form. A form for a transfer might have sender, recipient, and item: three positions even when two positions happen to name the same person.
The analogy is limited because arity alone does not specify the labels, allowed values, or truth of the completed form. Knowing that a relation has three arguments is not enough to know what each argument means. Types and documentation supply further information.
Worked example
Consider an original relation stored(item, location, time). Its arity is three. The expression stored(box7, shelf2, noon) supplies three arguments and is structurally compatible with that declaration.
The expression stored(box7, shelf2) supplies only two and is not an application of the declared ternary relation. It might belong to a separate binary relation in a language that distinguishes symbols by name and arity, but that is a different specification.
Now consider stored(box7, box7, noon). It still has arity three, despite repeating box7. Whether the second argument is an acceptable location is a typing or domain question, not an arity question.
If a finite untyped domain contains four objects, a ternary predicate has 4 × 4 × 4 = 64 possible ground argument tuples. This counts possible applications, not true facts. Types can reduce the relevant combinations: two items, three locations, and two times give 2 × 3 × 2 = 12 typed tuples.
Illustrative case study
Fictional case: Linden Records imports a relation describing who approved a document. One source uses approved(document, person), while another uses approved(document, person, date).
The team does not discard the extra date or silently treat the records as identical. It defines the intended relations and a documented conversion where appropriate. This invented case illustrates schema alignment and the difference between structure and meaning; it reports no measured integration result.
Common misconceptions and mistakes
Arity is not the number of distinct variables. Related(x, x) has two argument positions even though it contains one distinct variable.
Matching arity does not establish matching meaning. Ships(sender, recipient) and Ships(recipient, sender) use the same number of arguments but may reverse the relationship.
Do not confuse arity with the size of a relation. A binary relation may contain no true pairs, a few true pairs, or many. Nor does arity determine computational difficulty by itself: domain size, rule structure, representation, and the reasoning task all matter.
Business use
The concept helps teams design and validate structured knowledge used by AI systems. Clear argument counts and roles make rules, data imports, and queries easier to review and maintain.
When a relationship changes from two arguments to three, the change can affect every dependent rule and query. Treat that as a semantic design decision, not merely an extra column. For example, adding time may turn a timeless claim into a time-dependent one. Preserve the intended meaning and check whether old records can be interpreted without inventing missing information.
People also ask
Does repeated input reduce arity?
No. Arity counts positions, so p(a, a) is still binary.
Does a binary predicate have only two facts?
No. It has two argument positions and can describe many true or false pairs.
Can a predicate have no arguments?
Some formal languages allow this; it then represents a proposition with a truth value.
Check your understanding
In connects(x, y, x), how many argument positions and distinct variables are present?
Answer: There are three argument positions, so the predicate is ternary, but only two distinct variables, x and y.
Related terms
- Predicate (logic)
- Relation
- Tuple
- Predicate
- function symbol
- argument
- signature
- ground atom
- type system
Learn next
Next, describe five relationships with explicit argument roles. Check arity, argument order, and allowed types separately, then identify whether adding time would change each relationship's meaning.
More in Graphs and symbolic AI
- Apprenticeship Learning - Apprenticeship learning is learning to perform a task from demonstrations of an expert's behavior.
- Approximate near-neighbors - Approximate near-neighbors are data points found under a relaxed closeness requirement rather than an exact nearest-point requirement.
- Architecture - In the intelligent-agent context, architecture is the underlying computing and interaction platform on which an agent program runs.
- Artificial life - Artificial life, often shortened to ALife, studies life-like processes by constructing and examining artificial systems.
- Asilomar AI Principles - The Asilomar AI Principles are a set of 23 principles developed in connection with the 2017 Beneficial AI conference at Asilomar and coordinated by the...
- Assignment - An assignment gives values to variables. In a constraint-satisfaction problem, it selects a value from the domain of each variable it covers.
Sources
Poole and Mackworth, Artificial Intelligence, formal-semantics lecture: https://artint.info/slides/ch12/lect2.pdf
Primary treatment of n-ary predicates and their interpretations read. Examples are original; language-specific overloading and variable-argument conventions are explicitly qualified.
Previous: Arithmetic coding Next: ARKA descriptors in QSAR