
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 : An → A
For example: F(a1, a2, ... , an) = aj where, ∀ i∈ {1,2, ..., n} ai ∈ A and aj ∈ A
Whereas a predicate P of arity n is defined as P : An → {0,1}
For example: P(a1, a2, ... , an) = 0 where, ∀ i∈ {1,2, ..., n} ai ∈ A
P(a0, a0, ... n times ... , a0) = 1 where, a0 ∈ 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 : A2 → {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.