# Dependence logic

Dependence logic is a logical formalism, created by Jouko Väänänen, which adds dependence atoms to the language of first-order logic. A dependence atom is an expression of the form $=\!\!(t_{1}\ldots t_{n})$, where $t_{1}\ldots t_{n}$ are terms, and corresponds to the statement that the value of $t_{n}$ is functionally dependent on the values of $t_{1},\ldots ,t_{n-1}$.
Dependence logic is a logic of imperfect information, like branching quantifier logic or independence-friendly logic (IF logic): in other words, its game-theoretic semantics can be obtained from that of first-order logic by restricting the availability of information to the players, thus allowing for non-linearly ordered patterns of dependence and independence between variables. However, dependence logic differs from these logics in that it separates the notions of dependence and independence from the notion of quantification.

## Syntax

The syntax of dependence logic is an extension of that of first-order logic. For a fixed signature σ = (S$_{func}$, S$_{rel}$, ar), the set of all well-formed dependence logic formulas is defined according to the following rules:

### Terms

Terms in dependence logic are defined precisely as in first-order logic.

### Atomic formulas

There are three types of atomic formulas in dependence logic:
* A relational atom is an expression of the form $Rt_{1}\ldots t_{n}$ for any n-ary relation $R$ in our signature and for any n-tuple of terms $(t_{1},\ldots ,t_{n})$;
* An equality atom is an expression of the form $t_{1}=t_{2}$, for any two terms $t_{1}$ and $t_{2}$;
* A dependence atom is an expression of the form $=\!\!(t_{1}\ldots t_{n})$, for any $n\in \mathbb {N}$ and for any n-tuple of terms $(t_{1},\ldots ,t_{n})$.
Nothing else is an atomic formula of dependence logic.
Relational and equality atoms are also called first-order atoms.

### Complex formulas and sentences

For a fixed signature σ, the set of all formulas $\phi$ of dependence logic and their respective sets of free variables ${\mbox{Free}}(\phi )$ are defined as follows:
* Any atomic formula $\phi$ is a formula, and ${\mbox{Free}}(\phi )$ is the set of all variables occurring in it;
* If $\phi$ is a formula, so is $\lnot \phi$ and ${\mbox{Free}}(\lnot \phi )={\mbox{Free}}(\phi )$;
* If $\phi$ and $\psi$ are formulas, so is $\phi \vee \psi$ and ${\mbox{Free}}(\phi \vee \psi )={\mbox{Free}}(\phi )\cup {\mbox{Free}}(\psi )$;
* If $\phi$ is a formula and $x$ is a variable, $\exists x\phi$ is also a formula and ${\mbox{Free}}(\exists v\phi )={\mbox{Free}}(\phi )\backslash \{v\}$.
Nothing is a dependence logic formula unless it can be obtained through a finite number of applications of these four rules.
A formula $\phi$ such that ${\mbox{Free}}(\phi )=\emptyset$ is a sentence of dependence logic.

#### Conjunction and universal quantification

In the above presentation of the syntax of dependence logic, conjunction and universal quantification are not treated as primitive operators; rather, they are defined in terms of negation and, respectively, disjunction and existential quantification, by means of De Morgan's Laws.
Therefore, $\phi \wedge \psi$ is taken as a shorthand for $\lnot (\lnot \phi \vee \lnot \psi )$, and $\forall x\phi$ is taken as a shorthand for $\lnot (\exists x(\lnot \phi ))$.

## Semantics

The team semantics for dependence logic is a variant of Wilfrid Hodges' compositional semantics for IF logic. There exist equivalent game-theoretic semantics for dependence logic, both in terms of imperfect information games and in terms of perfect information games.

### Teams

Let ${\mathcal {A}}=(A,\sigma ,I)$ be a first-order structure and let $V=\{v_{1},\ldots ,v_{n}\}$ be a finite set of variables. Then a team over A with domain V is a set of assignments over A with domain V, that is, a set of functions μ from V to A.
It may be helpful to visualize such a team as a database relation with attributes $v_{1},\ldots ,v_{n}$ and with only one data type, corresponding to the domain A of the structure: for example, if the team X consists of four assignments $\mu _{1},\ldots ,\mu _{4}$ with domain $\{v_{1},v_{2},v_{3}\}$ then one may represent it as the relation
    ${\begin{array}{c|ccc}&v_{1}&v_{2}&v_{3}\\\hline \mu _{1}&\mu _{1}(v_{1})&\mu _{1}(v_{2})&\mu _{1}(v_{3})\\\mu _{2}&\mu _{2}(v_{1})&\mu _{2}(v_{2})&\mu _{2}(v_{3})\\\mu _{3}&\mu _{3}(v_{1})&\mu _{3}(v_{2})&\mu _{3}(v_{3})\\\mu _{4}&\mu _{4}(v_{1})&\mu _{4}(v_{2})&\mu _{4}(v_{3})\end{array}}$

### Positive and negative satisfaction

Team semantics can be defined in terms of two relations ${\mathcal {T}}$ and ${\mathcal {C}}$ between structures, teams and formulas.
Given a structure ${\mathcal {A}}$, a team $X$ over it and a dependence logic formula $\phi$ whose free variables are contained in the domain of $X$, if $({\mathcal {A}},X,\phi )\in {\mathcal {T}}$ we say that $X$ is a trump for $\phi$ in ${\mathcal {A}}$, and we write that ${\mathcal {A}}\models _{X}^{+}\phi$; and analogously, if $({\mathcal {A}},X,\phi )\in {\mathcal {C}}$ we say that $X$ is a cotrump for $\phi$ in ${\mathcal {A}}$, and we write that ${\mathcal {A}}\models _{X}^{-}\phi$.
If ${\mathcal {A}}\models _{X}^{+}\phi$ one can also say that $\phi$ is positively satisfied by $X$ in ${\mathcal {A}}$, and if instead ${\mathcal {A}}\models _{X}^{-}\phi$ one can say that $\phi$ is negatively satisfied by $X$ in ${\mathcal {A}}$.
The necessity of considering positive and negative satisfaction separately is a consequence of the fact that in dependence logic, as in the logic of branching quantifiers or in IF logic, the law of the excluded middle does not hold; alternatively, one may assume that all formulas are in negation normal form, using De Morgan's relations in order to define universal quantification and conjunction from existential quantification and disjunction respectively, and consider positive satisfaction alone.
Given a sentence $\phi$, we say that $\phi$ is true in ${\mathcal {A}}$ if and only if ${\mathcal {A}}\models _{\{\emptyset \}}^{+}\phi$, and we say that $\phi$ is false in ${\mathcal {A}}$ if and only if ${\mathcal {A}}\models _{\{\emptyset \}}^{-}\phi$.

### Semantic rules

As for the case of Alfred Tarski's satisfiability relation for first-order formulas, the positive and negative satisfiability relations of the team semantics for dependence logic are defined by structural induction over the formulas of the language. Since the negation operator interchanges positive and negative satisfiability, the two inductions corresponding to $\models ^{+}$ and $\models ^{-}$ need to be performed simultaneously:

#### Positive satisfiability

* ${\mathcal {A}}\models _{X}^{+}Rt_{1}\ldots t_{n}$ if and only if
** $R$ is a n-ary symbol in the signature of ${\mathcal {A}}$;
** All variables occurring in the terms $t_{1},\ldots ,t_{n}$ are in the domain of $X$;
** For every assignment $\mu \in X$, the evaluation of the tuple $(t_{1},\ldots ,t_{n})$ according to $\mu$ is in the interpretation of $R$ in ${\mathcal {A}}$;
* ${\mathcal {A}}\models _{X}^{+}t_{1}=t_{2}$ if and only if
** All variables occurring in the terms $t_{1}$ and $t_{2}$ are in the domain of $X$;
** For every assignment $\mu \in X$, the evaluations of $t_{1}$ and $t_{2}$ according to ${\mathcal {A}}$ are the same;
* ${\mathcal {A}}\models _{X}^{+}=\!\!(t_{1}\ldots t_{n})$ if and only if any two assignments $\mu ,\mu '\in X$ whose evaluations of the tuple $(t_{1},\ldots ,t_{n-1})$ coincide assign the same value to $t_{n}$;
* ${\mathcal {A}}\models _{X}^{+}\lnot \phi$ if and only if ${\mathcal {A}}\models _{X}^{-}\phi$;
* ${\mathcal {A}}\models _{X}^{+}\phi \vee \psi$ if and only if there exist teams $Y$ and $Z$ such that
** $X=Y\cup Z'$
** ${\mathcal {A}}\models _{Y}^{+}\phi$;
** ${\mathcal {A}}\models _{Z}^{+}\psi$;
* ${\mathcal {A}}\models _{X}^{+}\exists x\phi$ if and only if there exists a function $F$ from $X$ to the domain of ${\mathcal {A}}$ such that ${\mathcal {A}}\models _{X[F/x]}^{+}\phi$, where $X[F/x]=\{\mu [F(\mu )/x]:\mu \in X\}$.

#### Negative satisfiability

* ${\mathcal {A}}\models _{X}^{-}Rt_{1}\ldots t_{n}$ if and only if
** $R$ is a n-ary symbol in the signature of ${\mathcal {A}}$;
** All variables occurring in the terms $t_{1},\ldots ,t_{n}$ are in the domain of $X$;
** For every assignment $\mu \in X$, the evaluation of the tuple $(t_{1},\ldots ,t_{n})$ according to $\mu$ is not in the interpretation of $R$ in ${\mathcal {A}}$;
* ${\mathcal {A}}\models _{X}^{-}t_{1}=t_{2}$ if and only if
** All variables occurring in the terms $t_{1}$ and $t_{2}$ are in the domain of $X$;
** For every assignment $\mu \in X$, the evaluations of $t_{1}$ and $t_{2}$ according to ${\mathcal {A}}$ are different;
* ${\mathcal {A}}\models _{X}^{-}=\!\!(t_{1}\ldots t_{n})$ if and only if $X$ is the empty team;
* ${\mathcal {A}}\models _{X}^{-}\lnot \phi$ if and only if ${\mathcal {A}}\models _{X}^{+}\phi$;
* ${\mathcal {A}}\models _{X}^{-}\phi \vee \psi$ if and only if ${\mathcal {A}}\models _{X}^{-}\phi$ and ${\mathcal {A}}\models _{X}^{-}\psi$;
* ${\mathcal {A}}\models _{X}^{-}\exists x\phi$ if and only if ${\mathcal {A}}\models _{X[A/x]}^{-}\phi$, where $X[A/x]=\{\mu [a/x]:a\in A\}$ and $A$ is the domain of ${\mathcal {A}}$.

## Dependence logic and other logics
### Dependence logic and first-order logic

Dependence logic is a conservative extension of first-order logic: in other words, for every first-order sentence $\phi$ and structure ${\mathcal {A}}$ we have that ${\mathcal {A}}\models _{\{\emptyset \}}^{+}\phi$ if and only if $\phi$ is true in ${\mathcal {A}}$ according to the usual first-order semantics. Furthermore, for any first-order formula $\phi$, ${\mathcal {A}}\models _{X}^{+}\phi$ if and only if all assignments $\mu \in X$ satisfy $\phi$ in ${\mathcal {A}}$ according to the usual first-order semantics.
However, dependence logic is strictly more expressive than first-order logic: for example, the sentence
    $\exists z\forall x_{1}\forall x_{2}\exists y_{1}\exists y_{2}(=\!\!(x_{1},y_{1})\wedge =\!\!(x_{2},y_{2})\wedge (x_{1}=x_{2}\leftrightarrow y_{1}=y_{2})\wedge y_{1}\not =z)$
is true in a model ${\mathcal {A}}$ if and only if the domain of this model is infinite, even though no first-order formula $\phi$ has this property.

### Dependence logic and second-order logic

Every dependence logic sentence is equivalent to some sentence in the existential fragment of second-order logic, that is, to some second-order sentence of the form
    $\exists R_{1}\ldots \exists R_{n}\psi (R_{1},\ldots ,R_{n})$
where $\psi (R_{1},\ldots ,R_{n})$ does not contain second-order quantifiers. Conversely, every second-order sentence in the above form is equivalent to some dependence logic sentence.
As for open formulas, dependence logic corresponds to the downwards monotone fragment of existential second-order logic, in the sense that a nonempty class of teams is definable by a dependence logic formula if and only if the corresponding class of relations is downwards monotone and definable by an existential second-order formula.

### Dependence logic and branching quantifiers

Branching quantifiers are expressible in terms of dependence atoms: for example, the expression
    $(Q_{H}x_{1},x_{2},y_{1},y_{2})\phi (x_{1},x_{2},y_{1},y_{2})\equiv {\begin{pmatrix}\forall x_{1}\exists y_{1}\\\forall x_{2}\exists y_{2}\end{pmatrix}}\phi (x_{1},x_{2},y_{1},y_{2})$
is equivalent to the dependence logic sentence $\forall x_{1}\exists y_{1}\forall x_{2}\exists y_{2}(=\!\!(x_{1},y_{1})\wedge =\!\!(x_{2},y_{2})\wedge \phi )$, in the sense that the former expression is true in a model if and only if the latter expression is true.
Conversely, any dependence logic sentence is equivalent to some sentence in the logic of branching quantifiers, since all existential second-order sentences are expressible in branching quantifier logic.

### Dependence logic and IF logic

Any dependence logic sentence is logically equivalent to some IF logic sentence, and vice versa.
However, the issue is subtler when it comes to open formulas. Translations between IF logic and dependence logic formulas, and vice versa, exist as long as the domain of the team is fixed: in other words, for all sets of variables $V=\{v_{1}\ldots v_{n}\}$ and all IF logic formulas $\phi$ with free variables in $V$ there exists a dependence logic formula $\phi ^{D}$ such that
    ${\mathcal {A}}\models _{X}^{+}\phi \Leftrightarrow {\mathcal {A}}\models _{X}^{+}\phi ^{D}$
for all structures ${\mathcal {A}}$ and for all teams $X$ with domain $V$, and conversely, for every dependence logic formula $\psi$ with free variables in $V$ there exists an IF logic formula $\psi ^{I}$ such that
    ${\mathcal {A}}\models _{X}^{+}\psi \Leftrightarrow {\mathcal {A}}\models _{X}^{+}\psi ^{I}$
for all structures ${\mathcal {A}}$ and for all teams $X$ with domain $V$. These translations cannot be compositional.

## Properties

Dependence logic formulas are downwards closed: if ${\mathcal {A}}\models _{X}\phi$ and $Y\subseteq X$ then ${\mathcal {A}}\models _{Y}\psi$. Furthermore, the empty team (but not the team containing the empty assignment) satisfies all formulas of dependence logic, both positively and negatively.
The law of the excluded middle fails in dependence logic: for example, the formula $\exists y(=\!\!(y)\wedge y=x)$ is neither positively nor negatively satisfied by the team $X=\{(x:0),(x:1)\}$. Furthermore, disjunction is not idempotent and does not distribute over conjunction.
Both the compactness theorem and the Löwenheim–Skolem theorem are true for dependence logic. Craig's interpolation theorem also holds, but, due to the nature of negation in dependence logic, in a slightly modified formulation: if two dependence logic formulas $\phi$ and $\psi$ are contradictory, that is, it is never the case that both $\phi$ and $\psi$ hold in the same model, then there exists a first-order sentence $\theta$ in the common language of the two sentences such that $\phi$ implies $\theta$ and $\theta$ is contradictory with $\psi$.
As for IF logic, dependence logic can define its own truth operator: more precisely, there exists a formula $\tau (x)$ such that for every sentence $\phi$ of dependence logic and all models ${\mathcal {M}}_{\omega }$ which satisfy Peano's axioms, if $'\phi '$ is the Gödel number of $\phi$ then
    ${\mathcal {M}}_{\omega }\models _{\{\emptyset \}}^{+}\!\phi$ if and only if ${\mathcal {M}}_{\omega }\models _{\{\emptyset \}}^{+}\tau ('\phi ').$
This does not contradict Tarski's undefinability theorem, since the negation of dependence logic is not the usual contradictory one.

## Complexity

As a consequence of Fagin's theorem, the properties of finite structures definable by a dependence logic sentence correspond exactly to NP properties. Furthermore, Durand and Kontinen showed that restricting the number of universal quantifiers or the arity of dependence atoms in sentences gives rise to hierarchy theorems with respect to expressive power.
The inconsistency problem of dependence logic is semidecidable, and in fact equivalent to the inconsistency problem for first-order logic. However, the decision problem for dependence logic is non-arithmetical, and is in fact complete with respect to the $\Pi _{2}$ class of the Lévy hierarchy.

## Variants and extensions
### Team logic

Team logic extends dependence logic with a contradictory negation $\sim \!\!\phi$. Its expressive power is equivalent to that of full second-order logic.

### Modal dependence logic

The dependence atom, or a suitable variant thereof, can be added to the language of modal logic, thus obtaining modal dependence logic.

### Intuitionistic dependence logic

As it is, dependence logic lacks an implication. The intuitionistic implication $\phi \rightarrow \psi$, whose name derives from the similarity between its definition and that of the implication of intuitionistic logic, can be defined as follows:
    ${\mathcal {A}}\models _{X}\phi \rightarrow \psi$ if and only if for all $Y\subseteq X$ such that ${\mathcal {A}}\models _{Y}\phi$ it holds that ${\mathcal {A}}\models _{Y}\psi$.
Intuitionistic dependence logic, that is, dependence logic supplemented with the intuitionistic implication, is equivalent to second-order logic.

### Independence logic

Instead of dependence atoms, independence logic adds to the language of first-order logic independence atoms ${\vec {t_{1}}}\bot _{\vec {t_{3}}}{\vec {t_{2}}}$ where ${\vec {t_{1}}}$, ${\vec {t_{2}}}$ and ${\vec {t_{3}}}$ are tuples of terms. The semantics of these atoms is defined as follows:
    ${\mathcal {A}}\models _{X}{\vec {t_{1}}}\bot _{\vec {t_{3}}}{\vec {t_{2}}}$ if and only if for all $s,s'\in X$ with ${\vec {t_{3}}}\langle s\rangle ={\vec {t_{3}}}\langle s'\rangle$ there exists $s''\in X$ such that ${\vec {t_{3}}}\langle s''\rangle ={\vec {t_{3}}}\langle s\rangle$, ${\vec {t_{1}}}\langle s''\rangle ={\vec {t_{1}}}\langle s\rangle$ and ${\vec {t_{2}}}\langle s''\rangle ={\vec {t_{2}}}\langle s'\rangle$.
Independence logic corresponds to existential second-order logic, in the sense that a non-empty class of teams is definable by an independence logic formula if and only if the corresponding class of relations is definable by an existential second-order formula. Therefore, on the level of open formulas, independence logic is strictly stronger in expressive power than dependence logic. However, on the level of sentences these logics are equivalent.

### Inclusion/exclusion logic

Inclusion/exclusion logic extends first-order logic with inclusion atoms ${\vec {t_{1}}}\subseteq {\vec {t_{2}}}$ and exclusion atoms ${\vec {t_{1}}}\mid {\vec {t_{2}}}$ where in both formulas ${\vec {t_{1}}}$ and ${\vec {t_{2}}}$ are term tuples of the same length. The semantics of these atoms is defined as follows:
* ${\mathcal {A}}\models _{X}{\vec {t_{1}}}\subseteq {\vec {t_{2}}}$ if and only if for all $s\in X$ there exists $s'\in X$ such that ${\vec {t_{1}}}\langle s\rangle ={\vec {t_{2}}}\langle s'\rangle$;
* ${\mathcal {A}}\models _{X}{\vec {t_{1}}}\mid {\vec {t_{2}}}$ if and only if for all $s,s'\in X$ it holds that ${\vec {t_{1}}}\langle s\rangle \neq {\vec {t_{2}}}\langle s'\rangle$.
Inclusion/exclusion logic has the same expressive power as independence logic, already on the level of open formulas. Inclusion logic and exclusion logic are obtained by adding only inclusion atoms or exclusion atoms to first-order logic, respectively. Inclusion logic sentences correspond in expressive power to greatest fixed-point logic sentences; hence inclusion logic captures (least) fixed-point logic on finite models, and PTIME over finite ordered models. Exclusion logic in turn corresponds to dependence logic in expressive power.

### Generalized quantifiers

Another way of extending dependence logic is to add some generalized quantifiers to the language of dependence logic. Very recently there has been some study of dependence logic with monotone generalized quantifiers and dependence logic with a certain majority quantifier, the latter leading to a new descriptive complexity characterization of the counting hierarchy.