Dibyendu D. answered • 05/20/19

Ph.D. in Computer Science with 2+ years of Teaching Experience

Think of these in terms mathematical functions defined on sets.

For any set Α, a function F of arity n is defined as **F : A**^{n }**→ A**

For example: F(a_{1}, a_{2}, ... , a_{n}) = a_{j} where, ∀ i∈ {1,2, ..., n} a_{i }∈ A and a_{j }∈ A

Whereas a predicate P of arity n is defined as **P : A**^{n }**→ {0,1}**

For example: P(a_{1}, a_{2}, ... , a_{n}) = 0 where, ∀ i∈ {1,2, ..., n} a_{i }∈ A

P(a_{0}, a_{0}, ... n times ... , a_{0}) = 1 where, a_{0 }∈ A

Now, for your examples,

Predicate is to show a comparison or showing a relation between two objects such as, President(Obama, America) Functions are to specify what a particular object is such as, Human(Obama)

Let's consider the set **A = {****Obama, America****}**

A function **President** of arity **1** can be defined as **President**** : A**^{ }**→ A**

to get something like, **President(America) = Obama**

A predicate **President** of arity **2** can be defined as **President**** : A**^{2 }**→ {0,1}**

to get something like,

**President(Obama, America) = 1**

**President(America, America) = 0 **etc.

Another predicate **Human** of arity **1** can be defined as **Human**** : A**^{ }**→ {0,1}**

to get something like,

**Human(Obama) = 1**

**Human(America) = 0 **etc.

A predicate is nothing but a **boolen function**.