Vector logic

Uses your system voice; voice and rate in settings.

Snapshot

≈ 11 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Vector logic is an algebraic model of elementary logic based on matrix algebra. Vector logic assumes that the truth values map on vectors, and that the monadic and dyadic operations are executed by matrix operators. "Vector logic" has also been used to refer to the representation of classical propositional logic as a vector space, in which the unit vectors are propositional variables. Predicate logic can be represented as a vector space of the same type in which the axes represent the predicate letters S and P . In the vector space for propositional logic the origin represents the false, F, and the infinite periphery represents the true, T, whereas in the space for predicate logic the origin represents "nothing" and the periphery represents the flight from nothing, or "something".

Vector logic is an algebraic model of elementary logic based on matrix algebra. Vector logic assumes that the truth values map on vectors, and that the monadic and dyadic operations are executed by matrix operators. "Vector logic" has also been used to refer to the representation of classical propositional logic as a vector space, in which the unit vectors are propositional variables. Predicate logic can be represented as a vector space of the same type in which the axes represent the predicate letters S and P . In the vector space for propositional logic the origin represents the false, F, and the infinite periphery represents the true, T, whereas in the space for predicate logic the origin represents "nothing" and the periphery represents the flight from nothing, or "something". (where q \geq 2 is an arbitrary natural number, and "normalized" means that the length of the vector is 1; usually s and n are orthogonal vectors). This correspondence generates a space of vector truth-values: V 2  = {s,n}. The basic logical operations defined using this set of vectors lead to matrix operators. The operations of vector logic are based on the scalar product between q-dimensional column vectors: u^Tv=\langle u,v\rangle : the orthonormality between vectors s and n implies that \langle u,v\rangle=1 if u = v , and \langle u,v\rangle=0 if u \ne v , where u, v \in \{s, n\} . ===Monadic operators=== The monadic operators result from the application Mon: V_2 \to V_2 , and the associated matrices have q rows and q columns. The two basic monadic operators for this two-valued vector logic are the identity and the negation: Identity: A logical identity ID(p) is represented by matrix I=ss^T + nn^T . This matrix operates as follows: Ip = p, p ∈ V 2 ; due to the orthogonality of s with respect to n, we have Is=ss^Ts+nn^Ts=s\langle s,s\rangle+n\langle n,s\rangle=s , and similarly In=n . This vector logic identity matrix is not generally an identity matrix in the sense of matrix algebra. Negation: A logical negation ¬p is represented by matrix N=ns^T + sn^T Consequently, Ns = n and Nn = s. The involutory behavior of the logical negation, namely that ¬(¬p) equals p, corresponds with the fact that N 2  = I. C=s(s\otimes s)^T + n(s\otimes n)^T + n(n\otimes s)^T + n(n\otimes n)^T and verifies C(s\otimes s)=s, and C(s\otimes n)=C(n\otimes s)=C(n\otimes n)=n. Disjunction. The disjunction (p∨q) is executed by the matrix D=s(s\otimes s)^T+s(s\otimes n)^T+s(n\otimes s)^T+n(n\otimes n)^T, resulting in D(s\otimes s)=D(s\otimes n)=D(n\otimes s)=s and D(n\otimes n)=n. Implication. The implication corresponds in classical logic to the expression p → q ≡ ¬p ∨ q. The vector logic version of this equivalence leads to a matrix that represents this implication in vector logic: L=D(N\otimes I) . The explicit expression for this implication is: L=s(s\otimes s)^T+n(s\otimes n)^T+s(n\otimes s)^T+s(n\otimes n)^T, and the properties of classical implication are satisfied: L(s\otimes s)=L(n\otimes s)=L(n\otimes n)=s and L(s\otimes n)=n. Equivalence and Exclusive or. In vector logic the equivalence p≡q is represented by the following matrix: E=s(s\otimes s)^T+n(s\otimes n)^T+n(n\otimes s)^T+s(n\otimes n)^T with E(s\otimes s)=E(n\otimes n)=s and E(s\otimes n)=E(n\otimes s)=n. The Exclusive or is the negation of the equivalence, ¬(p≡q); it corresponds with the matrix X=NE given by X=n(s\otimes s)^T+s(s\otimes n)^T+s(n\otimes s)^T+n(n\otimes n)^T, with X(s\otimes s)=X(n\otimes n)=n and X(s\otimes n)=X(n\otimes s)=s. NAND and NOR The matrices S and P correspond to the Sheffer (NAND) and the Peirce (NOR) operations, respectively: S=NC P=ND ===Numerical examples=== Here are numerical examples of some basic logical gates implemented as matrices for two different sets of 2-dimensional orthonormal vectors for s and n. Set 1: s=\begin{bmatrix}1 \\ 0 \end{bmatrix} \quad n=\begin{bmatrix}0 \\ 1 \end{bmatrix} In this case the identity and negation operators are the identity and anti-diagonal identity matrices:, I=\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}, \quad N=\begin{bmatrix}0 & 1\\1 & 0\end{bmatrix} and the matrices for conjunction, disjunction and implication are C=\begin{bmatrix}1 & 0 & 0 & 0\\0 & 1 & 1 & 1\end{bmatrix}, \quad D=\begin{bmatrix}1 & 1 & 1 & 0\\0 & 0 & 0 &1\end{bmatrix}, \quad L=\begin{bmatrix}1 & 0 & 1 & 1\\0 & 1 & 0 & 0\end{bmatrix} respectively. Set 2: s=\frac{1}{\sqrt{2}}\begin{bmatrix}1 \\ 1 \end{bmatrix} \quad n=\frac{1}{\sqrt{2}}\begin{bmatrix}1 \\ -1 \end{bmatrix} Here the identity operator is the identity matrix, but the negation operator is no longer the anti-diagonal identity matrix : I=\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}, \quad N=\begin{bmatrix}1 & 0\\0 & -1\end{bmatrix} The resulting matrices for conjunction, disjunction and implication are: C=\frac{1}{\sqrt{2}}\begin{bmatrix}2 & 0 & 0 & 0\\-1 & 1 & 1 & 1\end{bmatrix}, \quad D=\frac{1}{\sqrt{2}}\begin{bmatrix}2 & 0 & 0 & 0\\1 & 1 & 1 &-1\end{bmatrix}, \quad L=\begin{bmatrix}2 & 0 & 0 & 0\\1 & 1 & -1 & 1\end{bmatrix} respectively. C(u\otimes v)=ND(Nu\otimes Nv) , where u and v are two logic vectors. The Kronecker product implies the following factorization: C(u\otimes v)=ND(N\otimes N)(u\otimes v). Then it can be proved that in the two-dimensional vector logic the De Morgan's law is a law involving operators, and not only a law concerning operations: C=ND(N\otimes N) L(u\otimes v)=D(N\otimes I)(u\otimes v)=D(Nu\otimes v)=D(Nu\otimes NNv)= D(NNv\otimes Nu)=D(N\otimes I)(Nv\otimes Nu)=L(Nv\otimes Nu) This result is based in the fact that D, the disjunction matrix, represents a commutative operation. Let f=\epsilon s + \delta n , with \epsilon, \delta \in [0,1], \epsilon + \delta = 1 be this kind of "probabilistic" vectors. Here, the many-valued character of the logic is introduced a posteriori via the uncertainties introduced in the inputs. ===Scalar projections of vector outputs=== The outputs of this many-valued logic can be projected on scalar functions and generate a particular class of probabilistic logic with similarities with the many-valued logic of Reichenbach. Given two vectors u=\alpha s + \beta n and v=\alpha's + \beta'n and a dyadic logical matrix G , a scalar probabilistic logic is provided by the projection over vector s: Val(\mathrm{scalars}) = s^TG(\mathrm{vectors}) Here are the main results of these projections: NOT(\alpha)=s^TNu=1-\alpha OR(\alpha,\alpha')=s^TD(u\otimes v)=\alpha + \alpha' - \alpha\alpha' AND(\alpha,\alpha')=s^TC(u\otimes v)=\alpha\alpha' IMPL(\alpha,\alpha')=s^TL(u\otimes v)=1-\alpha(1-\alpha') XOR(\alpha,\alpha')=s^TX(u\otimes v)=\alpha+\alpha'-2\alpha\alpha' The associated negations are: NOR(\alpha,\alpha')=1-OR(\alpha,\alpha') NAND(\alpha,\alpha')=1-AND(\alpha,\alpha') EQUI(\alpha,\alpha')=1-XOR(\alpha,\alpha') If the scalar values belong to the set {0, , 1}, this many-valued scalar logic is for many of the operators almost identical to the 3-valued logic of Łukasiewicz. Also, it has been proved that when the monadic or dyadic operators act over probabilistic vectors belonging to this set, the output is also an element of this set. A=(\sqrt{N})_1=\frac{1}{2}(1+i)I+\frac{1}{2}(1-i)N , and B=(\sqrt{N})_2=\frac{1}{2}(1-i)I+\frac{1}{2}(1+i)N , with i=\sqrt{-1} . A and B are complex conjugates: B=A^* , and note that A^2=B^2=N , and AB=BA=I . Another interesting point is the analogy with the two square roots of -1. The positive root +(\sqrt{-1}) corresponds to (\sqrt{N})_1=IA , and the negative root -(\sqrt{-1}) corresponds to (\sqrt{N})_2=NA ; as a consequence, NA=B . f(x) = f(1)x + f(0)(1-x) The four different monadic operations result from the different binary values for the coefficients. Identity operation requires f(1) = 1 and f(0) = 0, and negation occurs if f(1) = 0 and f(0) = 1. For the 16 dyadic operators, the Boolean polynomials are of the form: f(x,y) = f(1,1)xy + f(1,0)x(1-y) +f(0,1)(1-x)y + f(0,0)(1-x)(1-y) The dyadic operations can be translated to this polynomial format when the coefficients f take the values indicated in the respective truth tables. For instance: the NAND operation requires that: f(1,1)=0 and f(1,0)=f(0,1)=f(0,0)=1 . These Boolean polynomials can be immediately extended to any number of variables, producing a large potential variety of logical operators. In vector logic, the matrix-vector structure of logical operators is an exact translation to the format of linear algebra of these Boolean polynomials, where the x and 1−x correspond to vectors s and n respectively (the same for y and 1−y). In the example of NAND, f(1,1)=n and f(1,0)=f(0,1)=f(0,0)=s and the matrix version becomes: S=n(s\otimes s)^T + s[(s\otimes n)^T+(n\otimes s)^T+(n\otimes n)^T] ==Extensions== Vector logic can be extended to include many truth values since large-dimensional vector spaces allow the creation of many orthogonal truth values and the corresponding logical matrices. Logical modalities can be fully represented in this context, with recursive process inspired in neural models. Some cognitive problems about logical computations can be analyzed using this formalism, in particular recursive decisions. Any logical expression of classical propositional calculus can be naturally represented by a tree structure. This fact is retained by vector logic, and has been partially used in neural models focused in the investigation of the branched structure of natural languages. The computation via reversible operations as the Fredkin gate can be implemented in vector logic. Such an implementation provides explicit expressions for matrix operators that produce the input format and the output filtering necessary for obtaining computations. Elementary cellular automata can be analyzed using the operator structure of vector logic; this analysis leads to a spectral decomposition of the laws governing its dynamics. In addition, based on this formalism, a discrete differential and integral calculus has been developed.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1375667644 under CC BY-SA 4.0; modifications have been made.