I have a variable set $v$ of size 6.
$V =\{a,b,c,p,q,r\}$
I have two statements
$\forall_{x \in \{a,b,c\}} x$ is an integer
$\forall_{x \in \{p,q,r\}} x$ is an irrational number
Now I am using a sort set $S = \{\mathbf{Z}, \mathbf{R-Q}\} $
Now I assign $a,b,c$ to sort $\mathbf{Z}$ and remaining three variables to another sort $\mathbf{R-Q}$
My two statements become true now. Thus sort is either a set or a mechanism to differentiate or to assign variables a particular identity.
Is my understanding true?
For each sort $\sigma_i$ we have the corresponding variables $v_1^i, v_2^i, \ldots$.
Sorts are "kind" of objects that we want to distinguish.
Consider the silly example: we want to speak of humans and numbers at the same time.
Instead of considering a single domain $D$ with humans and number together, we "divide" the domain into two sorts : $S_1$ with all and only humans and $S_2$ with all and only numbers.
In this way, we quantify separately on humans, using variables of sort $\sigma_1$, and on mumbers, using variables of sort $\sigma_2$.
A less silly example is the definition of limit of a sequnce :
The usual formula :
can be rewritten in two-sorted logic using $N,M,n,m$ as variables for the sort $S_1$ of natural numbers and using $\epsilon, \delta, x, y$ as variables for the sort $S_2$ of the real numbers, to get :
Many-sorted logic can be easily rewritten into standard (one sort) predicate logic with suitable predicates.
We use $\text N(x)$ to symbolize the fact that $x$ is a natural and $\text R(x)$ for the reals.
In this way we have :
taht we usually abbreviate as $\forall x \in \mathbb R^+ \ldots$