Manifestly $SL(2,R)$ Duality-Symmetric Forms in ModMax Theory

H. Babaei-Aghbolagha, Komeil Babaei Velnib, Davood Mahdavian Yektac and H.
Mohammadzadeha

aDepartment of Physics, University of Mohaghegh Ardabili, P.O. Box 179,
Ardabil, Iran
bDepartment of Physics, University of Guilan, P.O. Box 41335-1914, Rasht, Iran
cDepartment of Physics, Hakim Sabzevari University, P.O. Box 397, Sabzevar,
Iran

E-mails<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
In this paper, we will investigate a manifestly $SL(2,R)$-invariant structure
for the energy-momentum tensor of ModMax theory as a nonlinear modification of
Maxwell electrodynamics which includes conformal invariance as well. In the
context of this theory, we show that the energy-momentum tensor of the
generalized Born-Infeld theory can also be written in the same invariant form.
We will find manifestly self-dual invariant actions corresponding to the
invariant couplings $\lambda$ and $\gamma$ in these theories. It can be shown
that the resultant actions correspond to the irrelevant and marginal
$T\bar{T}$-like deformations, respectively.

##  1 Introduction

It has been found different classes of non-linear electrodynamic (NED)
theories as candidates to the extension of Maxwell electrodynamics in the
literature [1, 2, 3, 4]. Also, one can find some recent developments in this
area of research in Refs. [5, 6, 7, 8]. Recently, it has been discovered a
nonlinear extension of Maxwell’s theory, which not only is invariant under
electromagnetic duality transformations, but also is a conformally invariant
theory. This electromagnetic modification is known as the ModMax theory [9]
and is described by the following Lagrangian density

$\displaystyle{\cal
L}_{MM}=\cosh(\gamma)\mathcal{S}+\sinh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}},$
(1.1)

where $\mathcal{S}=-\frac{1}{4}F_{\mu\nu}F^{\mu\nu}$ and
$\,\,\mathcal{P}=-\frac{1}{4}F_{\mu\nu}\tilde{F}^{\mu\nu}$ are two Lorentz
invariant variables, which
$\tilde{F}^{\mu\nu}=\frac{1}{2}\varepsilon^{\mu\nu\alpha\beta}F_{\alpha\beta}$
is the Hodge dual of the electromagnetic field strength $F_{\mu\nu}$. As is
obvious from (1.1), the ModMax theory comprises a positive constant $\gamma$
so that for $\gamma=0$, it reduces to the Maxwell Lagrangian [10]. The
generalization of the ModMax theory in the context of conformal invariant
p-form gauge theories was studied in Ref. [11].

It has been shown [9, 11] that the ModMax and the Born-Infeld theories can be
combined into a duality-symmetric generalized Born-Infeld (GBI)
electrodynamics as follows

${\cal L}_{BI\gamma}=\frac{1}{\lambda}\Bigg{[}1-\sqrt{1-\lambda\Bigl{(}2{\cal
L}_{MM}+\lambda\mathcal{P}^{2}\Bigr{)}}\Bigg{]},$ (1.2)

where in the weak field limit $\lambda\to 0$, the Lagrangian (1.2) reduces to
the ModMax theory denoted by (1.1). More studies on the ModMax theory, such as
the supersymmetric actions, the nonlinear generalizations, and solutions of
field equations can be found in Refs. [12, 13, 14, 15, 16, 17, 18, 19]. Also,
an alternative form of the ModMax Lagrangian in terms of axion-dilaton-like
auxiliary scalar fields coupling has been proposed in Ref. [20]. ModMax theory
has been more carefully studied and expanded in recent works [19, 21, 22, 23,
24].

As well known, the Maxwell’s field equations are invariant under the electric-
magnetic $SO(2)$ duality transformations, however, the enhancement of this
symmetry to the level of an action is another problematic task. This fact
becomes even more complicated for theories featuring nonlinear interactions of
the Maxwell fields. There are three approaches to construct theories of self-
interacting Maxwell fields incorporating an electromagnetic $SO(2)$ duality
invariance; the Gaillard and Zumino [25, 26] approach which has been further
developed by Gibbons and Rasheed [27], the non-covariant first order
Hamiltonian approach based on the work by Henneaux and Teitelboim [28] and
further followed by Deser, Gomberoff, Henneaux and Teitelboim [29, 30], and
the third one is the PST method proposed by Pasti, Sorokin and Tonin [31, 32,
33, 34].

In the first systematic method to construct duality invariant theories, we
have to define a doublet $\left(\tilde{F},G\right)$, where
$G_{\mu\nu}=-2\,\frac{\partial{\cal L}(\mathcal{S},\mathcal{P})}{\partial
F^{\mu\nu}}$ is an antisymmetric tensor, to show that the equations of motion
are invariant under $SO(2)$ rotations. This requirement imposes a non-linear
differential equation; $G\tilde{G}-F\tilde{F}=0$, the so-called self-dual
condition. In the second approach, $SO(2)$ duality is an exact and explicit
symmetry of the Lagrangian of the theory. Such a NED theory has a doublet of
electric and magnetic fields $(A_{1},A_{2})$ and the $SO(2)$ duality is an
ordinary 2d rotation on these doublets. Finally in the PST approach, if one
introduces an auxiliary scalar field and a compensating gauge symmetry, it is
possible to formulate a manifestly covariant action with the correct degrees
of freedom.

We will follow the Gaillard-Zumino approach and present the self-dual
invariant actions for the ModMax and GBI (and axion-dilaton-GBI) theories
which gives the correct equations of motion when one imposes the duality
invariant condition as an extra constraint. As the main purpose of our study
in this letter, we find a manifestly $SL(2,R)$ invariant structure for the
energy-momentum tensors of the ModMax and also the GBI theories. In this
respect, although the corresponding Lagrangians are not invariant under
$SO(2)$ duality-symmetry, their derivatives with respect to the invariant
parameters are. The invariant parameter could be a coupling constant or an
external background field, such as the gravitational field, which does not
change under duality rotations[25]. In this approach if a theory satisfies the
self-dual condition, then the physical objects of the theory such as equations
of motion[35], energy-momentum tensor[27, 36] and scattering amplitudes[39,
38, 37] are (S-dual) invariant. We are also interested in finding
corresponding self-dual invariant theory in the form that are manifestly
$SL(2,R)$ invariant. The self-dual invariant Lagrangian is given by the
derivative of the original Lagrangian with respect to the constant parameters
$\gamma$ and $\lambda$ [40].

The structure of this paper is organized as follows: in Sec. 2, we enhance
$SO(2)$ duality in the ModMax as well as the GBI theories to the non-compact
$SL(2,R)$ group by coupling the electromagnetic field to the dilaton and axion
fields. In Sec. 3, we find the manifestly self-dual invariant actions for a
general non-linear GBI theories of electrodynamics. We show that the expansion
of a self-dual invariant Lagrangian in NED theories is compatible with the
deformed Lagrangian constructed by both irrelevant and marginal $T\bar{T}$
operators in NED theories. Finally, the Sec. 4 is devoted to giving a brief
summary of results and identifies some directions for future researches.

##  2 $SL(2,R)$ symmetry in axion-dilaton ModMax Theory

The equations of motion of free Maxwell theory are
$\partial_{\nu}F^{\mu\nu}=0$ and $\partial_{\nu}\tilde{F}^{\mu\nu}=0$. These
equations obviously are transformed into each other under the rotation of
$(F^{\mu\nu},\tilde{F}^{\mu\nu})\to(\tilde{F}^{\mu\nu},-F^{\mu\nu})$. This
duality, which is known as the electric-magnetic duality, is a special case of
the $SO(2)$ duality-symmetry. In this section we are going to study the
$SO(2)$ symmetry for the energy-momentum tensor of the ModMax theory and its
extension to $SL(2,R)$ symmetry by coupling the electromagnetic field to some
axion and dilaton fields. Consequently, we find the $SL(2,R)$ duality-
symmetric structures for the energy-momentum tensor of the ModMax and GBI
theories.

###  2.1 Electric-magnetic duality in the ModMax theory

According to [41], a general electric-magnetic duality rotation through an
angle $\alpha$ is given by

$\left\\{\begin{array}[]{rcl}G_{\mu\nu}&\\!\\!\\!\rightarrow\\!\\!\\!&\cos\alpha~{}G_{\mu\nu}+\sin\alpha~{}\tilde{F}\\\
&&\\\
\tilde{F}_{\mu\nu}&\\!\\!\\!\rightarrow\\!\\!\\!&\cos\alpha~{}\tilde{F}_{\mu\nu}-\sin\alpha~{}G_{\mu\nu}.\end{array}\right.$
(2.1)

This rotational symmetry is called the $SO(2)$-duality symmetry. Assume a
finite $SO(2)$-duality rotation of the angle $\pi/2$, then we have the
following relations for the fields and invariant parameters

$(G^{\mu\nu},\tilde{F}^{\mu\nu})\to(\tilde{F}^{\mu\nu},-G^{\mu\nu})\,,\,\,\,\,\,\,\,\,\,\,\,(g_{\mu\nu},\gamma,\lambda)\to(g_{\mu\nu},\gamma,\lambda)\,.$
(2.2)

One can find the $G$-tensor for the ModMax theory (1.1) as follows

$G_{\mu\nu}=-2\,\frac{\partial{\cal L}_{MM}}{\partial
F^{\mu\nu}}=\cosh(\gamma)F_{\mu\nu}+\sinh(\gamma)\frac{F_{\mu\nu}\mathcal{S}+\tilde{F}_{\mu\nu}\mathcal{P}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}.$
(2.3)

It has been found in Ref. [27] that the energy-momentum tensor of a NED theory
can be written as

$T_{\mu\nu}=g_{\mu\nu}\,{\cal
L}(\mathcal{S},\mathcal{P})+{F_{\mu}}^{\rho}G_{\nu\rho},$ (2.4)

therefore, by considering the above relation, the energy-momentum tensor of
the ModMax theory (1.1) can be found as

$\displaystyle
T_{\mu\nu}=T^{Max}_{\mu\nu}\bigg{(}\cosh(\gamma)+\frac{\mathcal{S}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\sinh(\gamma)\bigg{)},$
(2.5)

where $T^{Max}_{\mu\nu}=F_{\mu\rho}{F_{\nu}}^{\rho}+g_{\mu\nu}\mathcal{S}$ is
the energy-momentum tensor of the Maxwell theory. Now, in order to study the
behavior of the energy-momentum tensor (2.5) under the nonlinear duality
transformations (2.2), we define the following symmetric structure that is
invariant under these transformations

$\displaystyle{\cal
N}_{\mu\nu}=G_{\mu}{}^{\alpha}G_{\alpha\nu}+\tilde{F}_{\mu}{}^{\alpha}\tilde{F}_{\alpha\nu}.$
(2.6)

Also substituting the ModMax $G$-tensor (2.3) in Eq. (2.6), one can find the
symmetric invariant structure corresponding to the ModMax theory

$\displaystyle{\cal N}_{\mu\nu}$ $\displaystyle=$
$\displaystyle-2\cosh(\gamma)\Bigl{(}\cosh(\gamma)+\frac{\mathcal{S}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\sinh(\gamma)\Bigr{)}T^{Max}_{\mu\nu}$
(2.7)
$\displaystyle+2\sinh(\gamma)\Bigl{(}\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\sinh(\gamma)\mathcal{S}\Bigr{)}g_{\mu\nu}.$

Considering the energy-momentum tensor (2.5) and the invariant structure
(2.7), we obtain a manifestly invariant $T_{\mu\nu}$ of the form

$T_{\mu\nu}=-\frac{1}{2\cosh(\gamma)}\Big{[}{\cal N}_{\mu\nu}-\frac{1}{4}{\cal
N}_{\rho}{}^{\rho}{g}_{\mu\nu}\Big{]},$ (2.8)

where ${\cal
N}_{\rho}{}^{\rho}=8\sinh(\gamma)\Bigl{(}\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\sinh(\gamma)\mathcal{S}\Bigr{)}$
is the trace of symmetric structure ${\cal N}_{\mu\nu}$. Note also that ${\cal
N}_{\rho}{}^{\rho}$ vanishes at $\gamma=0$ and we achieve the standard Maxwell
energy-momentum tensor.

###  2.2 ModMax theory coupled to an axion-dilaton field

Consider the following nonlinear $SL(2,R)$ transformation

$\displaystyle\tau\rightarrow\frac{p\tau+q}{r\tau+s},\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\Lambda=\left(\begin{array}[]{cc}p&q\\\
r&s\end{array}\right)\in\,{SL(2,R)},$ (2.11)

where $\tau=C_{0}+ie^{-\phi_{0}}$ is a complex axion-dilaton field. Now, for a
Lagrangian in which the general NED theory is coupled with the axion field so
that the equations of motion are $SL(2,R)$ invariant, one should add the term
$\frac{1}{4}C_{0}F_{\mu\nu}\tilde{F}^{\mu\nu}$ to the primary NED Lagrangian.
On the other hand, the contribution of dilatonic field is given by the field
redefinition $\bar{F}_{\mu\nu}\to e^{-\frac{\phi_{0}}{2}}F_{\mu\nu}$ [26].
Thus, the final theory appears an axion-dilatonic NED theory denoted by
Lagrangian density $\hat{{\cal L}}(\tau,F)=\bar{{\cal
L}}(e^{-\frac{\phi_{0}}{2}}F)+\frac{1}{4}C_{0}F_{\mu\nu}\tilde{F}^{\mu\nu}$.
In this regard, the $SO(2)$ duality group in Eq. (2.2) enhances to the
$SL(2,R)$ symmetry group. Due to this consideration, one can find the ModMax
theory coupled to axion-dilaton field as

$\displaystyle\hat{{\cal L}}_{MM}(\tau,F)=\bar{{\cal
L}}_{MM}(e^{-\frac{\phi_{0}}{2}}F)-C_{0}\mathcal{P}=\cosh(\gamma)e^{-\phi_{0}}\mathcal{S}+\sinh(\gamma)\sqrt{e^{-2\phi_{0}}(\mathcal{S}^{2}+\mathcal{P}^{2})}-C_{0}\mathcal{P}.$
(2.12)

It is clear that the above theory reduces to $\hat{{\cal L}}_{Max}(\tau,F)$ in
the limit of $\gamma\to 0$. So, the energy-momentum tensor obtained from
Lagrangian (2.12), only differs up to a dilaton field factor from the energy-
momentum tensor of the pure ModMax theory . This means that
$\hat{T}_{\mu\nu}=e^{-\phi_{0}}T_{\mu\nu}$ where the tensor $T_{\mu\nu}$ is
given by Eq. (2.5). We can also find the $G$-tensor corresponding to the
axion-dilaton ModMax theory (2.12) from
$\hat{G}_{\mu\nu}=-2\,\frac{\partial\hat{{\cal L}}_{MM}(\tau,F)}{\partial
F^{\mu\nu}}$. Thus, we have the antisymmetric tensor
$\hat{G}_{\mu\nu}=\bar{G}_{\mu\nu}-C_{0}\tilde{F}_{\mu\nu}$ where
$\bar{G}_{\mu\nu}=-2\frac{\partial\bar{{\cal L}}_{MM}}{\partial
F^{\mu\nu}}=e^{-\phi_{0}}G_{\mu\nu}$ and $G_{\mu\nu}$ is given in Eq. (2.3).

According to [27], for any NED theory one can extend the duality
transformations (2.2) to the corresponding $SL(2,R)$ duality group. In the
case of ModMax theory, the corresponding $SL(2,R)$ duality transformations is
described by

${\cal F}_{\mu\nu}\equiv\left(\begin{array}[]{c}\tilde{F}_{\mu\nu}\cr\
\bar{G}_{\mu\nu}-C_{0}\tilde{F}_{\mu\nu}\end{array}\right)\rightarrow(\Lambda^{-1})^{T}\left(\begin{array}[]{c}\tilde{F}_{\mu\nu}\cr\
\bar{G}_{\mu\nu}-C_{0}\tilde{F}_{\mu\nu}\end{array}\right)\,,$ (2.13)

and111Note that the matrix ${\cal M}_{0}$ here is the inverse of the matrix
${\cal M}$ in [27].

${\cal M}_{0}=e^{\phi_{0}}\left(\begin{array}[]{cc}|\tau|^{2}&C_{0}\\\
C_{0}&1\end{array}\right),\,\,\,\,\,\,{\cal M}_{0}\longrightarrow\Lambda{\cal
M}_{0}\Lambda^{T}\,.$ (2.14)

Using the transformations (2.13) and (2.14), we can find a symmetric structure
in the form of $\hat{\cal N}_{\mu\nu}=({\cal F}^{T})_{\mu}{}^{\alpha}{\cal
M}_{0}{\cal F}_{\alpha\nu}$ which is manifestly invariant under the $SL(2,R)$
duality transformations. That is,

$\displaystyle\hat{\cal N}_{\mu\nu}$ $\displaystyle=$ $\displaystyle
e^{-\phi_{0}}\,\tilde{F}_{\mu}{}^{\alpha}\,\tilde{F}_{\alpha\nu}+e^{\phi_{0}}\,\bar{G}_{\mu}{}^{\alpha}\,\bar{G}_{\alpha\nu}$
(2.15) $\displaystyle=$ $\displaystyle e^{-\phi_{0}}{\cal N}_{\mu\nu}\,,$

where we have used $\bar{G}_{\mu\nu}=e^{-\phi_{0}}G_{\mu\nu}$ and Eq. (2.6) to
obtain the second line. On the other hand, the energy-momentum tensor
corresponding to Eq. (2.12) is given as follows

$\displaystyle\hat{T}_{\mu\nu}=-\frac{1}{2\cosh(\gamma)}\Big{[}{\hat{{\cal
N}}}_{\mu\nu}-\frac{1}{4}{{\hat{{\cal N}}}_{\rho}}^{\rho}{g}_{\mu\nu}\Big{]},$
(2.16)

which is a manifestly $SL(2,R)$ invariant structure in the axion-dilaton
ModMax theory.

###  2.3 $SL(2,R)$ symmetry in the GBI theory

Following the discussion in the previous section, one can construct a GBI
theory with $SL(2,R)$ symmetry group by adding an axion-dilaton field to
$BI\gamma$ theory given by Eq. (1.2), i,e, as $\hat{{\cal
L}}_{BI\gamma}(\tau,F)=\bar{{\cal
L}}_{BI\gamma}(e^{-\frac{\phi_{0}}{2}}F)-C_{0}\mathcal{P}$. Due to this
identification we obtain

$\hat{{\cal
L}}_{BI\gamma}(\tau,F)=\frac{1}{\lambda}\Bigg{[}1-\sqrt{1-\lambda\Bigl{(}2e^{-\phi_{0}}\Big{(}\cosh(\gamma)\mathcal{S}+\sinh(\gamma)\sqrt{(\mathcal{S}^{2}+\mathcal{P}^{2})}\Big{)}+\lambda
e^{-2\phi_{0}}\mathcal{P}^{2}\Bigr{)}}\Bigg{]}-C_{0}\mathcal{P}.$ (2.17)

Similar to what we have a priori done for the ModMax theory, we are interested
in the $SL(2,R)$ invariant structure for the energy-momentum of GBI theory in
(2.17). Therefore, using the standard definition of the energy-momentum tensor
and after a straightforward calculation, we obtain

$\displaystyle\hat{T}_{\mu\nu}$ $\displaystyle=$ $\displaystyle
e^{-\phi_{0}}\frac{F_{\mu\alpha}F_{\nu}{}^{\alpha}\bigl{(}\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\sinh(\gamma)\mathcal{S}\bigr{)}}{x\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}$
(2.18) $\displaystyle+$ $\displaystyle
e^{-\phi_{0}}\frac{\bigl{(}2\lambda\cosh(\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\lambda\sinh(\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})+e^{\phi_{0}}(x-1)\,\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\bigr{)}\mathit{g}_{\mu\nu}}{\lambda
x\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}},$

where, for simplicity, we use the shorthand
$x=\sqrt{1-\lambda\Bigl{(}2e^{-\phi_{0}}\Big{(}\cosh(\gamma)\mathcal{S}+\sinh(\gamma)\sqrt{(\mathcal{S}^{2}+\mathcal{P}^{2})}\Big{)}+\lambda
e^{-2\phi_{0}}\mathcal{P}^{2}\Bigr{)}}$. The $\lambda$-expansion of the above
energy momentum tensor up to order $\lambda$ is as follows

$\displaystyle\hat{T}_{\mu\nu}$ $\displaystyle=$ $\displaystyle
e^{-\phi_{0}}\biggl{(}\cosh(\gamma)+\frac{\sinh(\gamma)\mathcal{S}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\biggr{)}T^{Max}_{\mu\nu}+e^{-2\phi_{0}}\lambda\biggl{[}\Bigl{(}\cosh(2\gamma)\mathcal{S}+\frac{\sinh(2\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})}{2\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\Bigr{)}T^{Max}_{\mu\nu}$
(2.19) $\displaystyle-$
$\displaystyle\frac{1}{2}\Bigl{(}\cosh^{2}(\gamma)\mathcal{P}^{2}+\mathcal{S}\bigl{(}\cosh(2\gamma)\mathcal{S}-\sinh(2\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\bigr{)}\Bigr{)}\mathit{g}_{\mu\nu}\biggr{]}+{\cal
O}(\lambda^{2})+\ldots\,.$

The leading term in the expansion of (2.19) is the energy-momentum tensor of
the axion-dilaton ModMax theory that we found in terms of $SL(2,R)$ invariant
structure in Eq. (2.16). In fact, if the Eq. (2.19) is to be invariant under
the $SL(2,R)$ transformations, one should find it invariant at any order of
$\lambda$ as well.

In comparison to the axion-dilaton ModMax theory, the antisymmetric $G$-tensor
of generalized theory in Eq. (2.17) could be found from
$\hat{G}_{\mu\nu}=-2\,\frac{\partial\hat{{\cal
L}}_{BI\gamma}(\tau,F)}{\partial F^{\mu\nu}}$. However, one can write the
result as $\hat{G}_{\mu\nu}=\bar{G}_{\mu\nu}-C_{0}\tilde{F}_{\mu\nu}$, where

$\displaystyle\bar{G}_{\mu\nu}=\frac{e^{-\phi_{0}}\sinh(\gamma)(F_{\mu\nu}\mathcal{S}+\mathcal{P}\tilde{F}_{\mu\nu})}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}x}+\frac{e^{-\phi_{0}}\cosh(\gamma)F_{\mu\nu}+e^{-2\phi_{0}}\lambda\mathcal{P}\tilde{F}_{\mu\nu}}{x}\,.$
(2.20)

The $\lambda$-expansion of the above tensor up to order $\lambda$ is as
follows

$\displaystyle\bar{G}_{\mu\nu}$ $\displaystyle=$ $\displaystyle
e^{-\phi_{0}}\bigg{[}\cosh(\gamma)F_{\mu\nu}+\frac{\sinh(\gamma)(F_{\mu\nu}\mathcal{S}+\tilde{F}_{\mu\nu}\mathcal{P})}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\bigg{]}+e^{-2\phi_{0}}\lambda\Bigl{[}\cosh^{2}(\gamma)\tilde{F}_{\mu\nu}\mathcal{P}+\frac{\cosh(\gamma)\sinh(\gamma)\tilde{F}_{\mu\nu}\mathcal{P}\mathcal{S}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}$
(2.21) $\displaystyle+$
$\displaystyle\frac{F_{\mu\nu}\bigl{(}2\cosh(2\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\sinh(2\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})\bigr{)}}{2\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\Bigr{]}+{\cal
O}(\lambda^{2})+\ldots\,.$

Substituting $\bar{G}_{\mu\nu}$ from (2.21) in Eq. (2.15), we find the
$SL(2,R)$ invariant structure corresponding to (2.17) up to order $\lambda$,
i.e. ,

$\displaystyle\hat{\cal N}_{\mu\nu}$ $\displaystyle\\!\\!\\!=\\!\\!\\!$
$\displaystyle-2e^{-\phi_{0}}\bigg{[}\cosh(\gamma)\Bigl{(}\cosh(\gamma)+\frac{\mathcal{S}\sinh(\gamma)}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\Bigr{)}T^{Max}_{\mu\nu}-\sinh(\gamma)\Bigl{(}\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\sinh(\gamma)\mathcal{S}\Bigr{)}g_{\mu\nu}\bigg{]}$
$\displaystyle\\!\\!\\!+\\!\\!\\!$
$\displaystyle-2\lambda\,e^{-2\phi_{0}}\biggl{[}\Bigl{(}\cosh(3\gamma)\mathcal{S}+\frac{2\cosh^{2}(\gamma)\sinh(\gamma)\mathcal{P}^{2}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}+\frac{\sinh(3\gamma)\mathcal{S}^{2}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\Bigr{)}T^{Max}_{\mu\nu}$
$\displaystyle\\!\\!\\!-\\!\\!\\!$
$\displaystyle\frac{1}{2}\bigl{(}\cosh(\gamma)\mathcal{P}^{2}+\cosh(3\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})+2\sinh(3\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\bigr{)}g_{\mu\nu}\biggr{]}+{\cal
O}(\lambda^{2})+\ldots\,.$

Now, by considering this invariant structure and after performing some lengthy
calculations we are able to recast the energy-momentum tensor of the axion-
dilaton $BI\gamma$ theory in Eq. (2.18) in a manifestly $SL(2,R)$ invariant
form. Therefore, we have

$\displaystyle\hat{T}_{\mu\nu}=-\frac{1}{2\cosh(\gamma)}\Big{(}\hat{\cal
N}_{\mu\nu}-\frac{1}{4}\hat{\cal
N}_{\rho}{}^{\rho}{g}_{\mu\nu}\Big{)}+\lambda\biggl{[}a_{0}(\gamma)\,\hat{\cal
N}_{\rho}{}^{\rho}\,\hat{\cal N}_{\mu\nu}+b_{0}(\gamma)\,\hat{\cal
N}_{\mu}{}^{\rho}\,\hat{\cal N}_{\nu\rho}\biggr{]}+\ldots,$ (2.23)

where the coefficients $a_{0}(\gamma)$ and $b_{0}(\gamma)$ are given by

$\displaystyle
a_{0}(\gamma)=-\frac{1}{16\cosh^{2}(\gamma)}+\frac{3}{16},\,\,\,\,\,\,\,\,\,\,b_{0}(\gamma)=\frac{1}{4\cosh^{2}(\gamma)}-\frac{3}{8}\,.$

Note that in Eq. (2.23) we have also used the identities
$F_{\mu}{}^{\alpha}\tilde{F}_{\nu\alpha}=-g_{\mu\nu}\mathcal{P}$ and
$F_{\mu}{}^{\alpha}F_{\alpha}{}^{\gamma}F_{\gamma\beta}F^{\beta}{}_{\nu}=2F_{\mu}{}^{\alpha}F_{\alpha\nu}\mathcal{S}+\mathit{g}_{\mu\nu}\mathcal{P}^{2}$
that hold for any two-form $F$ . The explicit forms of the invariant
structures that appear in Eq. (2.23) have mentioned in the appendix.

##  3 Manifestly self-dual invariant actions

As mentioned before, the Lagrangian of the Maxwell and the ModMax theories are
not invariant under the $SL(2,R)$ transformation, however, the derivatives of
them with respect to an invariant parameter are invariant. In this paper we
deal with two coupling constants $\lambda$ and $\gamma$ and also the
gravitational field. The energy-momentum tensor that obtains from the
variation of the corresponding Lagrangian with respect to the gravitational
field would be invariant under this duality[25, 26]. The non-zero contribution
of the invariant action in electrodynamic theories comes from the variation of
original theory with respect to the electromagnetic field strength [42]. It
has been shown in [40] that the derivative of the original Lagrangian $\cal L$
with respect to the coupling constant $c$ in the form $c\frac{\partial{\cal
L}}{\partial c}$ produces the corresponding invariant theory $L^{c}_{inv}$.
However, for a theory with a typical dimensionless coupling constant such as
the ModMax theory, the corresponding derivative can produce an invariant
theory.

Due to this fact and according to (1.2), consider the invariant Lagrangians
$L^{\lambda}_{inv}$ and $L^{\gamma}_{inv}$ corresponding to the coupling
constants $\lambda$ and $\gamma$, respectively. Obviously, the Lagrangians of
the Maxwell theory as well as the ModMax theory are independent of $\lambda$,
therefore there is no self-dual invariant Lagrangian of type
$L^{\lambda}_{inv}$ for these theories. On the other hand, $L^{\gamma}_{inv}$
has non-vanishing contribution only for the ModMax theory, while the
derivative of the Lagrangian density of Maxwell theory with respect to
$\gamma$ vanishes. We ensue the following invariant action from the above
discussion for the ModMax theory

$\displaystyle\frac{\partial{\cal L}_{MM}}{\partial\gamma}={\cal
L}^{\gamma}_{inv-
MM}=\sinh(\gamma)\mathcal{S}+\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}.$
(3.1)

Comparing the self-dual Lagrangian (3.1) with Eq. (2.7), we can find a
manifestly $SO(2)$ duality-symmetric form for the Lagrangian (3.1) as follows

$\displaystyle{\cal L}^{\gamma}_{inv-MM}=\frac{1}{8\sinh(\gamma)}\,\,{\cal
N}_{\rho}{}^{\rho}.$ (3.2)

It is noticed that there is a similar consideration for the GBI theory (1.2)
as well. In fact, variations of the GBI Lagrangian with respect to the
couplings $\lambda$ and $\gamma$, which are respectively denoted by ${\cal
L}^{\lambda}_{inv-BI\gamma}$ and ${\cal L}^{\gamma}_{inv-BI\gamma}$, are
invariant under $SO(2)$ duality group. In the rest of this section, we will
derived the frameworks of these invariant theories in the context of $SL(2,R)$
structures.

###  3.1 Self-dual invariant Lagrangian: ${\cal L}^{\lambda}_{inv-BI\gamma}$

For the purpose of constructing a self-dual Lagrangian for GBI theory, let us
briefly review the construction of this duality for an arbitrary
electrodynamic theory ${\cal L}(\mathcal{S},\mathcal{P})$ which satisfies the
duality invariant condition. Now, one can define an invariant Lagrangian
${\cal L}^{\lambda}_{inv}$ so that is self-dual as follows [5, 40, 43, 42, 44]

$\displaystyle-\lambda\frac{\partial{\cal L}}{\partial\lambda}={\cal
L}^{\lambda}_{inv}={\cal
L}(\mathcal{S},\mathcal{P})+\frac{1}{4}F_{\mu\nu}G^{\mu\nu}.$ (3.3)

As we mentioned above, due to the lack of dependence on $\lambda$, the
invariant actions for both the Maxwell theory and the ModMax theory are
trivial. For example, in the case of ModMax theory one can check this fact by
inserting ${\cal L}_{MM}$ from (1.1) and $G^{\mu\nu}$ from (2.3) in Eq. (3.3).
Now, consider a family of NED theories that led to the Maxwell theory (or the
ModMax theory) at the first order of coupling constant, i.e. ${\cal
O}(F^{2})$. It seems that the nonzero self-dual contribution of these NED
theories appears from the order of ${\cal O}(F^{4})$[42], but we will show
that this statement is not true for the ModMax theories. By comparing (2.4)
and (3.3), one can find that ${\cal
L}^{\lambda}_{inv}=\frac{1}{4}{T_{\mu}}^{\mu}$. This interesting result
asserts that the necessary condition for a NED theory to have nonzero
contribution to self-dual Lagrangian (3.3) is that ${T_{\mu}}^{\mu}\neq 0$.

The axion-dilaton $BI\gamma$ theory satisfies both duality invariant condition
$G\tilde{G}-F\tilde{F}=0$ and the energy-momentum traceless condition
${T_{\mu}}^{\mu}\neq 0$. If we set $\phi_{0}=0$ and $C_{0}=0$ in (2.17) then
we will find the corresponding duality invariant Lagrangian as follows

$\displaystyle{\cal L}^{\lambda}_{inv-
BI\gamma}=\frac{1}{\lambda}\Big{[}1-\frac{1}{\sqrt{1-\lambda\bigl{(}2{\cal
L}_{MM}+\lambda\mathcal{P}^{2}\bigr{)}}}+\lambda\frac{{\cal
L}_{MM}}{\sqrt{1-\lambda\bigl{(}2{\cal
L}_{MM}+\lambda\mathcal{P}^{2}\bigr{)}}}\Big{]}.$ (3.4)

In other words, a comparison between Eq. (2.19) for $\phi_{0}=0$ and Eq. (3.4)
shows that the identity ${\cal L}^{\lambda}_{inv}=\frac{1}{4}{T_{\mu}}^{\mu}$
works truly. Also, it is worth mentioning that the $\lambda$-expansion of
Lagrangian (3.4) starts from the order of $\lambda$, or equivalently ${\cal
O}(F^{4})$.

Considering the duality invariant structure (2.6) in which $G_{\mu\nu}$ is
substituted from (2.21) with $\phi_{0}=0$, we find the $\lambda$-expansion of
action (3.4) in the form that is manifestly duality invariant

$\displaystyle{\cal L}^{\lambda}_{inv-
BI\gamma}=-\frac{\lambda}{2^{7}\sinh^{2}(\gamma)}{\cal N}_{\mu}{}^{\mu}\,{\cal
N}_{\nu}{}^{\nu}+\frac{\lambda^{2}\cosh(\gamma)}{2^{9}\sinh^{4}(\gamma)}{\cal
N}_{\mu}{}^{\mu}\,{\cal N}_{\nu}{}^{\nu}\,{\cal
N}_{\alpha}{}^{\alpha}+\ldots,$ (3.5)

in which we have used the following identity

$\displaystyle{\cal N}_{\mu\nu}\,{\cal
N}^{\mu\nu}=\frac{\cosh(2\gamma)}{4\sinh^{2}(\gamma)}{\cal
N}_{\mu}{}^{\mu}\,{\cal N}_{\nu}{}^{\nu}.$ (3.6)

As alluded before, the $SO(2)$-invariant action ${\cal L}^{\lambda}_{inv-
BI\gamma}$ can be related to the action (1.2) by a differential flow equation
$-\lambda\frac{\partial{\cal L}_{BI\gamma}}{\partial\lambda}={\cal
L}^{\lambda}_{inv}$. Therefore, one can find the relationship of the duality
invariant actions (3.4) to the irrelevant $T\bar{T}$-like deformation of the
GBI theory[45, 46, 47] as well as Born-Infeld theory [48, 49, 50] (the GBI
theory at the limit of $\gamma\to 0$), that is ${\cal
L}^{\lambda}_{inv}=-\frac{1}{8}\lambda O^{\lambda}_{T^{2}}$ where
$O^{\lambda}_{T^{2}}=T_{\mu\nu}T^{\mu\nu}-\frac{1}{2}{T_{\mu}}^{\mu}{T_{\nu}}^{\nu}$
is an irrelevant $T\bar{T}$ operator.

###  3.2 Self-dual invariant Lagrangian: ${\cal L}^{\gamma}_{inv-BI\gamma}$

In this subsection, we consider the second self-dual invariant action coming
from the derivative of GBI Lagrangian (1.2) with respect to the parameter
$\gamma$. One can find that

$\displaystyle{\cal L}^{\gamma}_{inv-BI\gamma}=\frac{\partial{\cal
L}_{BI\gamma}}{\partial\gamma}=\frac{\sinh(\gamma)\mathcal{S}+\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}{\sqrt{1-\lambda\bigl{(}2{\cal
L}_{MM}+\lambda\mathcal{P}^{2}\bigr{)}}},$ (3.7)

therefore, expanding the invariant action (3.7) up to order $\lambda$ yields
that

$\displaystyle{\cal L}^{\gamma}_{inv-BI\gamma}$
$\displaystyle\\!\\!\\!=\\!\\!\\!$
$\displaystyle\sinh(\gamma)\mathcal{S}+\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}$
$\displaystyle\\!\\!\\!+\\!\\!\\!$
$\displaystyle\lambda\biggl{(}\cosh(2\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\cosh(\gamma)\sinh(\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})\biggr{)}+{\cal
O}(\lambda^{2})+\ldots\,\,.$

As the same steps that we did in the previous subsection, by considering the
invariant structure (2.6) and $\phi_{0}=0$, we find the above action in the
form that is manifestly duality invariant as follows

$\displaystyle{\cal L}^{\gamma}_{inv-
BI\gamma}=\frac{1}{8\sinh(\gamma)}\,\,{\cal
N}_{\mu}{}^{\mu}-\lambda\,\,\frac{1}{64}\frac{\cosh(\gamma)}{\sinh^{3}(\gamma)}\,\,{\cal
N}_{\mu}{}^{\mu}\,{\cal N}_{\nu}{}^{\nu}+{\cal O}(\lambda^{2})+\ldots\,\,.$
(3.9)

Note that, the self-dual invariant Lagrangian ${\cal L}^{\lambda}_{inv-
BI\gamma}(\ref{Linvlambda})$ starts from the order of $F^{4}$, but the self-
dual invariant Lagrangian ${\cal L}^{\gamma}_{inv-BI\gamma}$ (3.9) starts from
the order of $F^{2}$. Actually, the nonzero contribution of the invariant
action ${\cal L}^{\gamma}_{inv-BI\gamma}$ at the Maxwell order can be
interested because the other known NED theories have no contribution for their
corresponding invariant actions at this order.

In general, by replacing ${\cal N}$ with $\hat{\cal N}$, the results that we
have found in this section extend to the case of $\phi_{0}\neq 0$ and
$C_{0}\neq 0$. Doing so, we extend the $SO(2)$ duality invariant actions (3.5)
and (3.9) to corresponding $SL(2,R)$-invariant cases. It would be also of
interest to notice that the self-dual invariant Lagrangian (3.7) can be
related to a marginal $T\bar{T}$-like deformation of the ModMax theory [45].
One can show that ${\cal L}^{\gamma}_{inv-
BI\gamma}=\frac{1}{2}O^{\gamma}_{T^{2}}$, where
$O^{\gamma}_{T^{2}}=\sqrt{T_{\mu\nu}T^{\mu\nu}-\frac{1}{4}{T_{\mu}}^{\mu}{T_{\nu}}^{\nu}}$
is a marginal operator. It has been discussed in Refs. [47, 51, 52] that a
dimensional reduction of the ModMax theory to two spacetime dimensions
corresponds to the continuous marginal root-$T\bar{T}$ deformation of free
bosons .

##  4 Discussions

In this paper, we studied the self-dual invariant structures of the conformal
nonlinear modification of the Maxwell electrodynamics (ModMax theory) and its
generalization. We found an $SL(2,R)$ invariant form for the energy-momentum
tensor of the ModMax theory in terms of some $SL(2,R)$ duality-symmetric
structures. We have also obtained the manifestly duality invariant structures
for the energy-momentum tensor of the GBI theory.

In Sec. 3, we have proposed two actions which are invariant under $SL(2,R)$
symmetry, and consistent with two irrelevant and marginal $T\bar{T}$-like
deformations. The first self-dual action (3.4) is related to the standard form
of the expansion of the GBI Lagrangian with respect to $\lambda$, and the
second one (3.7) concerns with the expansion of the GBI Lagrangian with
respect to $\gamma$, proposed in Ref. [11], which are manifestly
$SL(2,R)$-duality invariant and include axion-dilaton couplings.

As custom, the correlation functions are fundamental observables in QFTs. For
instance, it has been shown in Refs. [53, 54, 55, 56] that the deformed
Lagrangian and stress tensor could obtained order by order from a
$T\bar{T}$-product operator in two dimensional CFTs, which can be used to
expand the partition function up to the second-order. It would be of interest
to study the correlation functions in the context of the ModMax theory and
check out the consistency of two self-dual actions and $T\bar{T}$-like
deformations.

The extension of supersyemmetric theories to NED theories are also of great
interest [57, 58]. For example, the supersymmetric extension of the Born-
Infeld Lagrangian has been studied in Ref. [59] and in the case of ModMax
theory this extension was discussed in Refs. [12, 13]. Recently, I. Bandos et
al. [12] (see also [13]) have shown that the Born-Infeld-like extension of
superModMax theory is described by the following superfield Lagrangian density

$\displaystyle\mathcal{L}_{{susy}-{BI\gamma}}=\frac{\cosh(\gamma)}{4}\left\\{\int
d^{2}\theta\,W^{2}+\int d^{2}\bar{\theta}\,\bar{W}^{2}+\int d^{2}\theta
d^{2}\bar{\theta}\,W^{2}\bar{W}^{2}K(\mathbb{S},\mathbb{P})\right\\}~{},~{}~{}~{}~{}~{}~{}$
(4.1)

where $K(\mathbb{S},\mathbb{P})$ is given by

$\displaystyle
K(\mathbb{S},\mathbb{P})=\frac{\frac{1}{\lambda}\big{(}1-\sqrt{1-2\lambda\left[\cosh(\gamma)\mathbb{S}+\sinh(\gamma)\sqrt{\mathbb{S}^{2}+\mathbb{P}^{2}}\right]-\lambda^{2}\mathbb{P}^{2}}\big{)}-\cosh(\gamma)\mathbb{S}}{\cosh(\gamma)(\mathbb{S}^{2}+\mathbb{P}^{2})}~{}.~{}~{}~{}~{}~{}~{}$
(4.2)

Here, the superfields $\mathbb{S}$ and $\mathbb{P}$ are

$\displaystyle\mathbb{S}=-\frac{1}{16}(D^{2}W^{2}+\bar{{D}}^{2}\bar{W}^{2})~{},\quad\mathbb{P}=\frac{i}{16}({D}^{2}W^{2}-\bar{{D}}^{2}\bar{W}^{2})~{},$
(4.3)

where $W^{2}=W^{\alpha}W_{\alpha}$. $W_{\alpha}$ and its conjugate
$\bar{W}_{\dot{\alpha}}=(W_{\alpha})^{*}$, are anticommuting Weyl spinor
chiral superfields satisfying in the conditions

$\displaystyle\bar{{D}}_{\dot{\beta}}W_{\alpha}=0,\quad{D}^{\alpha}W_{\alpha}=\bar{{D}}_{\dot{\alpha}}\bar{W}^{\dot{\alpha}}~{}.$
(4.4)

In the limit $\gamma=0$, the Lagrangian (4.1) reduces to the Bagger-Galperin
Lagrangian [59]. The self-dual condition for electromagnetic duality
invariance of generic nonlinear electrodynamic theories in Refs. [25, 26],
were generalized to superfield formulations of $N=1$ supersymmetric theories
in Refs.[60, 61]. For generic $N=1$ theories described by a Lagrangian
$\mathcal{L}[W,\bar{W}]$, the Kuzenko–Theisen duality-invariance condition is
[60, 61]

$\displaystyle Im\int
d^{4}x\,d\theta^{2}\left(W^{\alpha}W_{\alpha}+M^{\alpha}M_{\alpha}\right)=0\,,\qquad
M_{\alpha}\equiv-2i\frac{\delta\mathcal{L}[W,\bar{W}]}{\delta W^{\alpha}}\,.$
(4.5)

The Born-Infeld-like extension of the supersymmetric ModMax theory in (4.1)
satisfies the duality-invariance condition (4.5). Therefore, as shown in Sec.
3, we expect to have two supersymmetric self-duality invariant actions for the
$N=1$ supersymmetric Born-Infeld-like theory. These two actions are denoted by

$\displaystyle\mathcal{L}_{{susy}-inv-
BI\gamma}^{\lambda}=-\lambda\frac{\partial\mathcal{L}_{{susy}-BI\gamma}}{\partial\lambda}\,\,\,\,\,\,\,\,;\,\,\,\,\,\,\,\mathcal{L}_{{susy}-inv-
BI\gamma}^{\gamma}=\frac{\partial\mathcal{L}_{{susy}-BI\gamma}}{\partial\gamma}~{}.$
(4.6)

In [50] we have, a priori, studied the compatibility deformation of $N=2$
supersymmetric BI theory with $N=2$ supersymmetric self-dual invariant
Lagrangian. The $T\bar{T}$-deformation of the $N=1$ supersymmetric ModMax
theory with operator $O_{T^{2}}^{\lambda}$, was initially considered in Ref.
[46]. As final remark, extending the $N=1$ and $N=2$ supersymmetric self-dual
invariant Lagrangian of the ModMax theory can be investigated as a future
work.

## Acknowledgements

We are very grateful to D. Sorokin for his kindly interest in this work and
fruitful discussion. HBA is specially appreciate M.R.Garousi for his useful
comments at the early stages of the work.

## Appendix

In this appendix we write the explicit forms of invariant structures
$\hat{\cal N}_{\rho}{}^{\rho}$ and $\hat{\cal N}_{\mu}{}^{\rho}\,\hat{\cal
N}_{\nu\rho}$ that appear in Eq (2.23).

$\displaystyle\hat{\cal N}_{\rho}{}^{\rho}$ $\displaystyle=$ $\displaystyle
8\,e^{-\phi_{0}}\sinh(\gamma)\Bigl{(}\cosh(\gamma)\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}+\sinh(\gamma)\mathcal{S}\Bigr{)}$
$\displaystyle+$
$\displaystyle\lambda\,e^{-2\phi_{0}}\Bigl{[}4\cosh(\gamma)\mathcal{P}^{2}+4\cosh(3\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})+8\sinh(3\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\Bigr{]}+{\cal
O}(\lambda^{2})+\ldots\,,$

and

$\displaystyle\hat{\cal N}_{\mu}{}^{\rho}\,\hat{\cal N}_{\nu\rho}$
$\displaystyle=$
$\displaystyle-e^{-2\phi_{0}}\frac{2\sinh(2\gamma)\bigl{(}\mathcal{P}^{2}+\cosh(2\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})+2\sinh(2\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\bigr{)}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}T^{Max}_{\mu\nu}$
$\displaystyle+$ $\displaystyle
2\,e^{-2\phi_{0}}\cosh(2\gamma)\Bigl{(}\mathcal{P}^{2}+\cosh(2\gamma)(\mathcal{P}^{2}+2\mathcal{S}^{2})+2\sinh(2\gamma)\mathcal{S}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\Bigr{)}g_{\mu\nu}$
$\displaystyle+$
$\displaystyle\lambda\,e^{-3\phi_{0}}\biggl{[}\Bigl{(}-2\cosh(\gamma)\mathcal{P}^{2}-4\cosh(3\gamma)\mathcal{P}^{2}-2\cosh(5\gamma)(\mathcal{P}^{2}+4\mathcal{S}^{2})$
$\displaystyle+$
$\displaystyle\frac{32\cosh^{2}(\gamma)\sinh(\gamma)\mathcal{P}^{2}\mathcal{S}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}-\frac{24\cosh^{2}(\gamma)\sinh(3\gamma)\mathcal{P}^{2}\mathcal{S}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}-\frac{8\sinh(5\gamma)\mathcal{S}^{3}}{\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}}\Bigr{)}T^{Max}_{\mu\nu}$
$\displaystyle+$
$\displaystyle\Bigl{(}-2\cosh(\gamma)\mathcal{P}^{2}\mathcal{S}+4\cosh(3\gamma)\mathcal{P}^{2}\mathcal{S}+\cosh(5\gamma)(6\mathcal{P}^{2}\mathcal{S}+8\mathcal{S}^{3})+\sinh(\gamma)2\mathcal{P}^{2}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}$
$\displaystyle+$
$\displaystyle\bigl{(}4\mathcal{P}^{2}\sinh(3\gamma)+2\sinh(5\gamma)(\mathcal{P}^{2}+4\mathcal{S}^{2})\bigr{)}\Bigr{)}\mathit{g}_{\mu\nu}\sqrt{\mathcal{S}^{2}+\mathcal{P}^{2}}\biggr{]}+{\cal
O}(\lambda^{2})+\ldots\,.$

## References

  * [1] J. Plebanski, Lectures on nonlinear electrodynamics, Cycle of lectures delivered at The Niels Bohr Institute and NORDITA, Copenhagen, October 1968.
  * [2] G. Boillat, Nonlinear electrodynamics: Lagrangian and equations of motion, J. Math. Phys. 11 (1970) 941.
  * [3] Z. Bialynicka-Birula and I. Bialynicki-Birula, Nonlinear effects in Quantum Electrodynamics. Photon propagation and photon splitting in an external field, Phys. Rev. D 2 (1970) 2341.
  * [4] I. Bialynicki-Birula, Nonlinear Electrodynamics: Variations on a theme by Born and Infeld, in Quantum Theory of Particles and Fields: birthday volume dedicated to Jan Lopuszański, eds B. Jancewicz and J. Lukierski, World Scientific, 1983, pp 31.
  * [5] P. Aschieri, S. Ferrara and B. Zumino, “Duality Rotations in Nonlinear Electrodynamics and in Extended Supergravity,” Riv. Nuovo Cim. 31, 625-708 (2008), [arXiv:0807.4039 [hep-th]].
  * [6] A. Dehghani, M. R. Setare and S. Zarepour, “Self-energy problem, vacuum polarization, and dual symmetry in Born–Infeld-type U(1) gauge theories,” Eur. Phys. J. Plus 137, no.7, 859 (2022) [erratum: Eur. Phys. J. Plus 137, no.9, 1090 (2022)], [arXiv:2112.03757 [hep-th]].
  * [7] D. P. Sorokin, Fortsch. Phys. 70, no.7-8, 2200092 (2022), [arXiv:2112.12118 [hep-th]].
  * [8] J. M. A. Paixão, L. P. R. Ospedal, M. J. Neves, J. A. Helayël-Neto “The axion-photon mixing in non-linear electrodynamic scenarios,” [arXiv:2205.05442 [hep-ph]].
  * [9] I. Bandos, K. Lechner, D. Sorokin and P. K. Townsend, “A non-linear duality-invariant conformal extension of Maxwell’s equations,” Phys. Rev. D 102, 121703 (2020), [arXiv:2007.09092 [hep-th]].
  * [10] B. P. Kosyakov, Phys. Lett. B 810, 135840 (2020), [arXiv:2007.13878 [hep-th]].
  * [11] I. Bandos, K. Lechner, D. Sorokin and P. K. Townsend, “On p-form gauge theories and their conformal limits,” JHEP 03, 022 (2021), [arXiv:2012.09286 [hep-th]].
  * [12] I. Bandos, K. Lechner, D. Sorokin and P. K. Townsend, “ModMax meets Susy,” JHEP 10, 031 (2021), [arXiv:2106.07547 [hep-th]].
  * [13] S. M. Kuzenko, “Superconformal duality-invariant models and $\mathcal{N}$ = 4 SYM effective action,” JHEP 09, 180 (2021), [arXiv:2106.07173 [hep-th]].
  * [14] Z. Avetisyan, O. Evnin and K. Mkrtchyan, “Democratic Lagrangians for Nonlinear Electrodynamics,” Phys. Rev. Lett. 127, no.27, 271601 (2021), [arXiv:2108.01103 [hep-th]].
  * [15] S. I. Kruglov, “On generalized ModMax model of nonlinear electrodynamics,” Phys. Lett. B 822, 136633 (2021), [arXiv:2108.08250 [physics.gen-ph]].
  * [16] A. Ballon Bordo, D. Kubizňák and T. R. Perche, “Taub-NUT solutions in conformal electrodynamics,” Phys. Lett. B 817, 136312 (2021), [arXiv:2011.13398 [hep-th]].
  * [17] H. Nastase, “Coupling ModMax theory precursor with scalars, and BIon-type solutions,” [arXiv:2112.01234 [hep-th]].
  * [18] K. Mkrtchyan, M. Svazas “Solutions in Nonlinear Electrodynamics and their double copy regular black holes,” [arXiv:2205.14187 [hep-th]].
  * [19] J. Barrientos, A. Cisterna, D. Kubiznak and J. Oliva, “Accelerated black holes beyond Maxwell’s electrodynamics,” Phys. Lett. B 834, 137447 (2022), [arXiv:2205.15777 [gr-qc]].
  * [20] K. Lechner, P. Marchetti, A. Sainaghi and D. P. Sorokin, “Maximally symmetric nonlinear extension of electrodynamics and charged particles,” Phys. Rev. D 106, no.1, 016009 (2022), [arXiv:2206.04657 [hep-th]].
  * [21] A. Bokulić, I. Smolić and T. Jurić, “Constraints on singularity resolution by nonlinear electrodynamics,” Phys. Rev. D 106, no.6, 064020 (2022) [arXiv:2206.07064 [gr-qc]].
  * [22] A. Banerjee, A. Mehra, “ModMax meets GCA”, [arXiv:2206.11696 [hep-th]] .
  * [23] R. C. Pantig, L. Mastrototaro, G. Lambiase, A. Övgün, “Shadow, lensing and neutrino propagation by dyonic ModMax black holes”, [arXiv:2208.06664 [gr-qc]] .
  * [24] M. J. Neves, P. Gaete, L. P. R. Ospedal, J. A. Helayël-Neto, “Considerations on the ModMax electrodynamics in the presence of an electric and magnetic background”, [arXiv:2209.09361 [hep-th]] .
  * [25] M. K. Gaillard and B. Zumino, “Duality Rotations for Interacting Fields,” Nucl. Phys. B 193, 221-244 (1981).
  * [26] M. K. Gaillard and B. Zumino, “Nonlinear electromagnetic selfduality and Legendre transformations,” [arXiv:hep-th/9712103 [hep-th]].
  * [27] G. W. Gibbons and D. A. Rasheed, “Sl(2,R) invariance of nonlinear electrodynamics coupled to an axion and a dilaton,” Phys. Lett. B 365, 46-50 (1996), [arXiv:hep-th/9509141 [hep-th]].
  * [28] M. Henneaux and C. Teitelboim, Dynamics of chiral (self-dual) p-forms, Phys. Lett. B206 (1988) 650.
  * [29] S. Deser, A. Gomberoff, M. Henneaux and C. Teitelboim, “Duality, selfduality, sources and charge quantization in Abelian N form theories,” Phys. Lett. B 400, 80-86 (1997), [arXiv:hep-th/9702184 [hep-th]].
  * [30] S. Deser, A. Gomberoff, M. Henneaux and C. Teitelboim, “P-brane dyons and electric magnetic duality,” Nucl. Phys. B 520, 179-204 (1998), [arXiv:hep-th/9712189 [hep-th]].
  * [31] P. Pasti, D. P. Sorokin and M. Tonin, “Duality symmetric actions with manifest space-time symmetries,” Phys. Rev. D 52, R4277-R4281 (1995), [arXiv:hep-th/9506109 [hep-th]].
  * [32] P. Pasti, D. P. Sorokin and M. Tonin, “Space-time symmetries in duality symmetric models,” [arXiv:hep-th/9509052 [hep-th]].
  * [33] P. Pasti, D. P. Sorokin and M. Tonin, “On Lorentz invariant actions for chiral p forms,” Phys. Rev. D 55, 6292-6298 (1997), [arXiv:hep-th/9611100 [hep-th]].
  * [34] P. Pasti, D. P. Sorokin and M. Tonin, “Covariant action for a D = 11 five-brane with the chiral field,” Phys. Lett. B 398, 41-46 (1997), [arXiv:hep-th/9701037 [hep-th]].
  * [35] M. B. Green and M. Gutperle, “Comments on three-branes,” Phys. Lett. B 377, 28-35 (1996), [arXiv:hep-th/9602077 [hep-th]].
  * [36] K. Babaei Velni and H. Babaei-Aghbolagh, “On SL (2,R) symmetry in nonlinear electrodynamics theories,” Nucl. Phys. B 913, 987-1000 (2016), [arXiv:1610.07790 [hep-th]].
  * [37] K. Babaei Velni and H. Babaei-Aghbolagh, “$S$-dual amplitude and $D_{3}$-brane couplings,” Phys. Rev. D 99, no.6, 066007 (2019), [arXiv:1901.00198 [hep-th]].
  * [38] M. R. Garousi, “Duality constraints on effective actions,” Phys. Rept. 702, 1-30 (2017), [arXiv:1702.00191 [hep-th]].
  * [39] H. Babaei-Aghbolagh and M. R. Garousi, “S-duality of tree-level S-matrix elements in D3-brane effective action,” Phys. Rev. D 88, no.2, 026008 (2013), [arXiv:1304.2938 [hep-th]].
  * [40] P. Aschieri and S. Ferrara, “Constitutive relations and Schroedinger’s formulation of nonlinear electromagnetic theories,” JHEP 05, 087 (2013), [arXiv:1302.4737 [hep-th]].
  * [41] G. W. Gibbons and D. A. Rasheed, “Electric - magnetic duality rotations in nonlinear electrodynamics,” Nucl. Phys. B 454, 185-206 (1995), [arXiv:hep-th/9506035 [hep-th]].
  * [42] J. J. M. Carrasco, R. Kallosh and R. Roiban, “Covariant procedures for perturbative non-linear deformation of duality-invariant theories,” Phys. Rev. D 85, 025007 (2012). [arXiv:1108.4390 [hep-th]].
  * [43] W. A. Chemissany, J. de Jong and M. de Roo, “Selfduality of non-linear electrodynamics with derivative corrections,” JHEP 11, 086 (2006), [arXiv:hep-th/0610060 [hep-th]].
  * [44] W. Chemissany, R. Kallosh and T. Ortin, “Born-Infeld with Higher Derivatives,” Phys. Rev. D 85, 046002 (2012), [arXiv:1112.0332 [hep-th]].
  * [45] H. Babaei-Aghbolagh, K. B. Velni, D. M. Yekta and H. Mohammadzadeh, “Emergence of non-linear electrodynamic theories from ${T\bar{T}}$-like deformations,” Phys. Lett. B 829, 137079 (2022), [arXiv:2202.11156 [hep-th]].
  * [46] C. Ferko, L. Smith and G. Tartaglino-Mazzucchelli, “On Current-Squared Flows and ModMax Theories,” SciPost Phys. 13, no.2, 012 (2022), [arXiv:2203.01085 [hep-th]].
  * [47] R. Conti, J. Romano and R. Tateo, “Metric approach to a $\mathrm{T}\overline{\mathrm{T}}$-like deformation in arbitrary dimensions,” JHEP 09, 085 (2022), [arXiv:2206.03415 [hep-th]].
  * [48] R. Conti, L. Iannella, S. Negro and R. Tateo, “Generalised Born-Infeld models, Lax operators and the $\mathrm{T}\overline{\mathrm{T}}$ perturbation,” JHEP 11, 007 (2018), [arXiv:1806.11515 [hep-th]].
  * [49] C. Ferko, H. Jiang, S. Sethi and G. Tartaglino-Mazzucchelli, “Non-linear supersymmetry and $T\overline{T}$-like flows,” JHEP 02, 016 (2020), [arXiv:1910.01599 [hep-th]].
  * [50] H. Babaei-Aghbolagh, K. B. Velni, D. M. Yekta and H. Mohammadzadeh, “$T\overline{T}$-like flows in non-linear electrodynamic theories and S-duality,” JHEP 04, 187 (2021), [arXiv:2012.13636 [hep-th]].
  * [51] H. Babaei-Aghbolagh, K. Babaei Velni, D. M. Yekta and H. Mohammadzadeh, “Marginal $T\bar{T}$-Like Deformation and ModMax Theories in Two Dimensions,” [arXiv:2206.12677 [hep-th]].
  * [52] C. Ferko, A. Sfondrini, L. Smith, G. Tartaglino-Mazzucchelli “Root-$T\overline{T}$ Deformations,” [arXiv:2206.10515 [hep-th]].
  * [53] S. He and Y. Sun, “Correlation functions of CFTs on a torus with a $T\overline{T}$ deformation,” Phys. Rev. D 102, no.2, 026023 (2020), [arXiv:2004.07486 [hep-th]].
  * [54] S. He, Y. Sun and Y. X. Zhang, “$T\overline{T}$-flow effects on torus partition functions,” JHEP 09, 061 (2021), [arXiv:2011.02902 [hep-th]].
  * [55] M. He, S. He and Y. h. Gao, “Surface charges in Chern-Simons gravity with $T\overline{T}$ deformation,” JHEP 03, 044 (2022), [arXiv:2109.12885 [hep-th]].
  * [56] S. He, Y. Z. Li, “Higher Genus Correlation Functions in CFTs with $T\overline{T}$ Deformation,” [arXiv:2202.04810 [hep-th]].
  * [57] S. Deser and R. Puzalowski, “Supersymmetric non-polynomial vector multiplets and causal propagation,” J. Phys. A13 (1980) 2501.
  * [58] S. Cecotti and S. Ferrara, “SUPERSYMMETRIC BORN-INFELD LAGRANGIANS,” Phys. Lett. B 187, 335-339 (1987).
  * [59] J. Bagger and A. Galperin, “A New Goldstone multiplet for partially broken supersymmetry,” Phys. Rev. D 55, 1091-1098 (1997), [arXiv:hep-th/9608177 [hep-th]].
  * [60] S. M. Kuzenko and S. Theisen, “Supersymmetric duality rotations,” JHEP 03, 034 (2000), [arXiv:hep-th/0001068 [hep-th]].
  * [61] S. M. Kuzenko and S. Theisen, “Nonlinear selfduality and supersymmetry,” Fortsch. Phys. 49, 273-309 (2001), [arXiv:hep-th/0007231 [hep-th]].


11institutetext: Computer Science III
University of Bonn, Germany11institutetext: University of Bonn, Computer
Science III,
Römerstraße 164, 53117 Bonn, Germany
{tantius, dsp<EMAIL_ADDRESS>
#  Towards an Application of
Update Propagation on Logic Programs
Representing Java Source Code

Richard Tantius  Daniel Speicher  Andreas Behrend

(17 May 2012)

###### Abstract

Logic programs are now used as a representation of object-oriented source code
in academic prototypes for about a decade. This representation allows a clear
and concise implementation of analyses of the object-oriented source code. The
full potential of this approach is far from being explored. In this paper, we
report about an application of the well-established theory of update
propagation within logic programs. Given the representation of the object-
oriented code as facts in a logic program, a change to the code corresponds to
an update of these facts. We demonstrate how update propagation provides a
generic way to generate incremental versions of such analyses.

###### Keywords:

logic program, update propagation, application, logic meta programming,
refactoring impact

##  1 Introduction

In this paper, we show how update propagation can be employed for efficiently
computing-derived information within the domain of logic fact-bases
representing object-oriented source code.

###  1.1 Logic Meta Programming

Logic Meta Programming approaches build a detailed representation of a program
(typically) written in another programming language in a logic fact-base [14],
[8], [10]. This representation allows analysing the orginal program by means
of a logic program built on those facts. This approach has been used to detect
code locations that need design improvement [13]. It provides a suitable basis
for different static analyses from the implementation of code quality metrics
to the implementation of type constraints. Recently, we have been arguing that
logic meta programming should be used to integrate the knowledge about good
design structures and suspicious design structures, creating a database of
code quality knowledge, which can be evolved over time [13].

###  1.2 Update Propagation

Update propagation (UP) is an established database research topic, which has
been studied over the last 40 years mainly in the context of integrity
checking and materialized views maintenance, e.g., [4], [2], [9], [7], [11],
[12]. Therefore, UP is known from the SQL and Datalog world. UP makes a
contribution to efficiently compute implicit changes of derived relations
resulting from explicitly performed updates of extensional facts of a logic
fact-base. SQL view specifications and Datalog rules, as well as Prolog rules
are related forms of deductive rules. This supports the idea to adapt UP to
the Prolog world, and also use sets of deltas, together with specialized
update statements to incrementally maintain derived predicates (which can be a
software analysis, implemented in Prolog). The original predicates are
required only once for materializing their initial answers, the specialized
delta versions are used in update statements afterwards for continuously
updating the materialized results. Assuming that a great portion of the
materialized content of the original logic rules remains unchanged, the
application of such update statements may considerably enhance the efficiency
of computing the state of such relations after an update of the fact-base.

###  1.3 Refactoring Impact Prediction

UP enables computing the results of an analysis after an update of the fact-
base without actually executing the change. Such an update of the fact-base
can be induced for example by applying a structural improvement like a
refactoring [6] to the source code. This allows to efficiently execute a
”what-if”-style analysis. The approach enables us to evaluate a potential
refactoring of Java programs, by computing quality attributes like software
metrics before the refactoring and simulate via UP how the metric result
changes due to the refactoring.

###  1.4 Automation

Figure 1 introduces our implementation which automates several aspects of the
refactoring impact prediction via UP. The picture shows the different
components of the system. Those components may consist of several Prolog
modules. The application covers the derivation of a suitable abstract model,
on which we build the software analysis we intend to employ. We use the Logic
Meta Programming approach JTransformer presented in [8], to derive such a
model. The implementation also handles the refactoring simulation on the level
of that abstract model, metric computation and UP rule generation. We have
used SWI-Prolog (in the version 6.0.2111The Project homepage of SWI-Prolog:
http://www.swi-prolog.org/ (accessed 17.08.12).) for the implementation.
Beside the metric definitions that had to be implemented in a strictly
declarative syntax, so that we can apply UP, we used the full feature set of
the SWI-Prolog environment for the other parts of the implementation.

Figure 1: Overview Update Propagation

##  2 Model and Analysis

Software analyses like software metrics are a frequently-studied approach to
detect lack of quality and are also capable of making improvements of quality
measurable. Logic Meta Programming Approaches provide the capability to
represent software systems as logic programs. A refactoring in this context,
therefore, can be understood as a transformation imposing changes on an
extensional fact-base. We discuss the structural cohesion metric Lack of
Cohesion in Methods $LCOM1$ [5], as an example of such a software analysis.
Cohesion can be defined as the degree of how closely module components are
related to each other. A unified framework for structural metrics was
presented by Briand in [3], who created a common model for existing metrics.
The model unified the syntactical representation and operational semantic of
those metrics. In order to provide the information about the source code the
metric relies on, we also present a simplified abstract model as basis for
$LCOM1$. This meta model will be directly derived from the Logic Meta
Programming fact-base.

###  2.1 Abstract Cohesion Model

The Logic Meta Programming approach [8], which we use to derive our abstract
cohesion model, is based on Prolog. For this reason, we represent the relevant
information for the $LCOM1$ metric as Prolog facts. We will also present the
$LCOM1$ metric itself as a logic program in the following. To sufficiently
describe the information relevant for cohesion metric, we need to take the
following information into account: Which class contains a certain method or
field? Which methods are called and which fields are accessed by a method? The
presented model is based on the cohesion model as presented in Briand [3] and
was adapted to Prolog. We consider the following Prolog predicates:

`c(M).` |  ``class
---|---
`cm(C, M).` |  ``class contains method
`cf(C, F).` |  ``class contains field
`mf(M, F).` |  ``method accesses field
`mm(M, N).` |  ``method invokes method

The related Prolog facts are ground versions of the predicates from above and
the variables `C,M,F,...` are bound to unique identifiers for the
corresponding elements. In the next subsection, we demonstrate how we extract
this model from the JTransformer fact-base. In the following section, we build
the $LCOM1$ metric on top of those facts as a logic program.

###  2.2 Model Fact Derivation

We derive the abstract cohesion model directly from the fact-base created by
the JTransformer Logic Meta Programming approach. JTransformer builds a so
called Abstract Syntax Tree (AST) that already is a full model representation
in Prolog of the Java language. The JTransformer facts are called Program
Element Facts PEF, they are the starting point for creating the cohesion
model.

Figure 1 gives an overview of the various components of our Implementation.
The architecture consists of three layers. In the first layer, we have the
metric rules and the facts created by JTransformer. The layer in the middle is
the meta programming layer, in which we process the rules and facts. Here we
compile the UP rules. In the layer at the bottom, we have the subsystems which
actually contain the executable code. Each subsystem may consist of several
Prolog modules.

Based on generator predicates, the Model Facts Converter component creates
cohesion model facts (from the JTransformer facts) and asserts them to a
prolog module (`cohesion_model`). Additionally, we perform checks, if an
element should be included at all. In the case of classes, we do not consider
the three following class types. Interface classes do not provide method calls
and attribute references. Cohesion cannot be examined here. Classes from
external dependencies are supposed to be examined elsewhere. Anonymous classes
are not supposed to be analysed standalone.

The implementation of the class generator predicates is as follows:

      generate(FactsModule, c, [ClassId]) :-
        % Here we only use the class id
        classT(ClassId, _, _, _),
        source_class(ClassId).

For the free variable `FactsModule`, we use the module `cohesion_model`
mentioned above as a default value. The implementation of the class analysis
considers different JTransfomer facts to determine the class type:

      source_class(ClassId) :-
        % JTransformer facts
        not(externT(ClassId)),
        not(interfaceT(ClassId)),
        % See below
        not(anonymous_class__(ClassId)).

      anonymous_class__(Class):-
        classT(Class, _, ClassName, _),
        string_concat(’ANONYMOUS$’, _, ClassName).

On top of the provided model facts, we create our software analyses, for
example the cohesion metric presented before. The deductive Metric rule
definition is the starting point (also shown in Figure 1). We define the
deductive part of the metric in a Prolog module:

`:- module(` $metricName$`_deductive_ruleset, []).`
` `$rule_{1}$`(A, B, `$...$`) :- `$...$
` `
For example:
` :- module(lcom1_deductive_ruleset, []).`
` ...`

###  2.3 Declarative Metric Implementation

The $LCOM1$ metric definition we present in the following is based on the
definition given by Briand in [3].

####  2.3.1 Query and Mapping

The computation of structural metrics can be divided into two steps. First, a
query step collects the elements or relations that are relevant for the
metric. Second, a mapping maps the result of the query to a number. Separating
these steps has the benefit that we can discuss both steps on their own. A
query result may be evaluated with different mappings. A mapping may be
applied to the result of different queries. The separation of query and
mapping has the advantage, that we can apply the update propagation approach
to the deductive rules defining the query.

##### Query

$LCOM1$ counts the number of method pairs within a class that do not access
even one common field. We split this definition into two predicates. Each
predicate will be first described in natural language, then as a logic
program.

$M$ and $N$ in $C$ are connected, if $M$ accesses a field $F$, that belongs to
the class $C$, and $N$ accesses that field $F$ as well.

      cp(C, M, N) :-
          mf(M,F), cf(C, F), mf(N,F).

$M$ and $N$ in $C$ are a pair of methods lacking cohesion, if $M$ is a method
in $C$, $N$ is as well a method in $C$ and $M$ and $N$ are not a connected
pair in $C$:

      lp(C, M, N) :-
          cm(C, M), cm(C, N), not(cp(C, M, N)).

##### Mapping

To complete the $LCOM1$ computation rule, we need to perform some additional
steps after the deductive part.

      lcom1(C, R):-
        findall([M,N], (cp(C, M, N), not(M=N)), E),
        length(E, T),
        R is T/2.

##  3 Refactoring as Cohesion Model Update

We model a refactoring as an update on our cohesion model. Performing the
refactoring only on the abstract level of the cohesion model, helps to
concentrate the computation only on aspects relevant for the metric
computation. Because we use update propagation in the following, we do not
directly perform model updates, rather every update will generate a so called
delta fact, which depicts the actual change and will be discussed in detail in
Section 4. In the following, we briefly discuss the refactorings we use and
describe their effects on the level of the model. Both refactorings assume in
our setting, that the moved element will be extracted into a new class,
creating the following delta fact: `add_c(#newClassId)`

Since we exclude constructor methods from our model and do not consider
modificators as public, private and protected, the following refactorings
require no special preconditions to be applied.

###  3.1 Move Method, Move Field

The move method refactoring moves a method from one class to another. Though
in a real world refactoring, we would need to adjust the code in several ways,
so that it remains functioning and compileable we add two simple delta facts
to our model:

      add_cm(C, M)
      del_cm(C, M)

Similar to the move method refactoring the move field refactoring moves a
field from one class to another, the resulting delta facts are as follows:

      add_cf(C, F)
      del_cf(C, F)

##  4 Update Propagation

In this section, we show how to apply update propagation in Prolog. Because of
the different evaluation mechanisms for SQL views (set-oriented, bottom-up)
and Prolog rules (instance-oriented, top-down), however, the transformation
techniques from UP could not be applied directly. Instead, the specific
properties of Prolog rules have to be taken into account in order to achieve a
complete and sound update propagation based on delta predicates.

###  4.1 Rule Transformation in Prolog

    % Derived from: lp(C, M, N) :- cm(C, M), cm(C, N), not(cp(C, M, N)).

    add_lp(C, M, N) :- add_cm(C, M),                  nwd_cm(C, N), not(nwi_cp(C, M, N)), not(    lp(C, M, N)).
    add_lp(C, M, N) :- add_cm(C, N),    nwd_cm(C, M),               not(nwi_cp(C, M, N)), not(    lp(C, M, N)).
    add_lp(C, M, N) :- del_cp(C, M, N), nwd_cm(C, M), nwd_cm(C, N),                       not(    lp(C, M, N)).

    del_lp(C, M, N) :- del_cm(C, M),                      cm(C, N), not(    cp(C, M, N)), not(nwi_lp(C, M, N)).
    del_lp(C, M, N) :- del_cm(C, N),        cm(C, M),               not(    cp(C, M, N)), not(nwi_lp(C, M, N)).
    del_lp(C, M, N) :- add_cp(C, M, N),     cm(C, M),     cm(C, N),                       not(nwi_lp(C, M, N)).

    nwi_lp(C, M, N) :-                  nwd_cm(C, M), nwd_cm(C, N), not(nwi_cp(C, M, N)).

    nwd_lp(C, M, N) :-     lp(C, M, N), not(del_lp(C, M, N)).
    nwd_lp(C, M, N) :- add_lp(C, M, N).

    % Derived from: cp(C, M, N) :- mf(M, F), cf(C, F), mf(N, F).

    add_cp(C, M, N) :- add_mf(M, F),               nwd_cf(C, F), nwd_mf(N, F), not(    cp(C, M, N)).
    add_cp(C, M, N) :- add_cf(C, F), nwd_mf(M, F),               nwd_mf(N, F), not(    cp(C, M, N)).
    add_cp(C, M, N) :- add_mf(N, F), nwd_mf(M, F), nwd_cf(C, F),               not(    cp(C, M, N)).

    del_cp(C, M, N) :- del_mf(M, F),                   cf(C, F),     mf(N, F), not(nwi_cp(C, M, N)).
    del_cp(C, M, N) :- del_cf(C, F),     mf(M, F),                   mf(N, F), not(nwi_cp(C, M, N)).
    del_cp(C, M, N) :- del_mf(N, F),     mf(M, F),     cf(C, F),               not(nwi_cp(C, M, N)).

    nwi_cp(C, M, N) :-               nwd_mf(M, F), nwd_cf(C, F), nwd_mf(N, F).

    nwd_cp(C, M, N) :-     cp(C, M, N), not(del_cp(C, M, N)).
    nwd_cp(C, M, N) :- add_cp(C, M, N).

    % Direct transition rules for the model facts mf/2 and cf/2

    nwd_mf(C, M) :- mf(C, M), not(del_mf(C, M)).
    nwd_mf(C, M) :- add_mf(C, M).

    nwd_cf(C, F) :- cf(C, F), not(del_cf(C, F)).
    nwd_cf(C, F) :- add_cf(C, F).

Figure 2: The derived update propagation and indirect and direct transition
rules for the $LCOM1$ definition.

The task of UP is to systematically compute the set of all induced changes,
starting from the physical changes of base data. Technically, this is a set of
delta facts for any affected predicate which may be stored in corresponding
delta relations. For each predicate symbol p, we will use a pair of delta
predicates <add_p, del_p> representing the insertions and deletions induced on
p by an update. The initial set of delta facts represents the so-called _UP
seeds_.

In the following, we briefly review a transformation-based approach to UP
where the Prolog rules and the UP seeds are employed to derive _propagation
rules_ for computing delta relations. A propagation rule refers to at least
one delta predicate in its body in order to provide a focus on the underlying
changes when computing induced updates. For showing the effectiveness of an
induced update, however, references to the state of a predicate before and
after the base update has been performed are necessary.

For each predicate ${\tt p}$ we use ${\tt old\\_p}$ to refer to its old state
before the changes given in the delta sets have been applied (technically the
rule behind ${\tt old\\_p}$ is the unmodified version of ${\tt p}$). We use
${\tt new\\_p}$ to refer to the new state of ${\tt p}$. These state relations
are never completely computed, but are queried with bindings from the delta
sets in the propagation rule body, and thus act as a test of effectiveness. An
induced insertion or induced deletion can be simply represented by the
difference between the two consecutive database states. We consider the
following Prolog rule:

      p(X) :- q(Y),r(Z),not s(C).

The difference rules may look as follows:

      add_p(X) :- add_q(Y), new_r(Z), not(new_m(C)), not(old_p(X)).
      add_p(X) :- new_q(Y), add_r(Z), not(new_m(C)), not(old_p(X)).
      add_p(X) :- new_q(Y), new_r(Z),     del_m(C),  not(old_p(X)).

The propagation rules basically perform a comparison of the `old` and `new`
versions of the predicates. While providing a focus on insertions into q and
r, all necessary combinations of delta and state predicates are considered.
Because of the negative referenced predicate s, an additional rule has to be
considered, which covers new derivations for p due to a deletion from s.

All propagation rules also contain the additional effectiveness test `not
old_p(X)`, to check for the effectiveness of the induced insertions in case of
alternative derivations of the same fact `p` in the old state. As an
optimization we can drop the test, in case there are no alternative
derivations, or if the set of, insertions can be overestimated. To avoid the
full determination of state predicates, we should move the delta predicates as
far left as possible in the rule body. This way the bindings provided by the
delta facts can be used for restricting the evaluation of state predicates.
This leads to the following rules:

      add_p(X) :- add_q(Y), new_r(Z), not(new_m(C)).
      add_p(X) :- add_r(Z), new_q(Y), not(new_m(C)).
      add_p(X) :- del_m(C), new_q(Y),     new_r(Z).

For simulating the new predicate state from a given update and the old state,
so called _transition rules_ [12] can be used. The transition rules of a
derived predicate infer its new state from the new states of the underlying
predicates. Thus, for a rule $A:-L_{1},\ldots,L_{n}$ a transition rule of the
form $new\\_A:-new\\_L_{1},\ldots,new\\_L_{n}$ is considered. In contrast, for
every extensional predicate $A$ so-called incremental transition rules are
used:

      new_A :- old_A, not(del_A).
      new_A :- add_A.

which explicitly refer to the computed changes to A.

For a rule $A:-L_{1},\ldots,L_{n}$ we may also use the direct transition rules
if there are no mutual dependencies between the predicate and the predicates
in the body. In any case, the indirect transition rules of the form
`new`$\\_A$` :- new`$\\_L_{1}$`,`$\ldots,$`new`$\\_L_{n}$
are used in the effectiveness test of negative propagation rules.

As an example, consider the following Prolog program

      p(X) :- q(X,Y),r(Y),not(s(Y)).
              q(1,2). r(3). s(4).
              q(2,3). r(4). s(5).
              q(3,4). r(5). s(6).

and the insertion `r(2)` into relation r. The following propagation and
transition rules

      p(X) :- add_r(Y),new_q(X,Y),not(new_s(Y)).
      new_q(X,Y) :- q(X,Y), not(del_q(X,Y)).
      new_q(X,Y) :- add_q(X,Y).
      new_s(X,Y) :- s(X,Y), not(del_s(X,Y)).
      new_s(X,Y) :- add_s(X,Y).

were derived using the scheme described above. These rules allow for
efficiently computing the induced insertion p(1) (represented by the fact
$add\\_p(1)$) by avoiding any redundant recomputations.

##  5 Propagation of Cohesion Model Updates

In this section, we apply UP as presented in Section 4 to our cohesion model
and the metric rules from Section 2.

Before we employ UP to simulate the model state and metric results after the
refactoring, we first need to generate delta facts as described in Section 3.
At definition time of the metric rules, we may also derive the propagation and
transition rules for UP. Figure 2 shows the result of the rule derivation
process. We can see that for each body literal of a rule that appears in the
metric definition, we create a positive and a negative propagation rule, so
that for the cohesive pair rule `cp` we obtain six propagation rules in total.
We replace negated delta literals simply by their opposite versions, for
example: ` not(del_cp) ` $\Leftrightarrow$ ` add_cp`. For both rules `lp` and
`cp`, we also see two derived transition rules ` nwi_lp ` and ` nwi_cp`,
simulating the versions of those predicates in the new state, which operate on
the propagation rules.

###  5.1 Rule Generation

The UP rule generator component consists of two subcomponents, which can be
seen in the middle of Figure 1. The Rule Analyser component collects meta
information about the metric rules from the deductive rule modules and the UP
Rules Generator, which creates the UP rules, based on the collected meta
information. SWI-Prolog provides various meta predicates to examine loaded
programs. It is important that UP ensures that the augmented rule set (which
includes UP rules as shown in Figure 2 and the original rules like those for
$LCOM1$) generated for a set of logic rules which is guaranteed to terminate,
still keeps this property. This was shown for the language set of Datalog [1],
[7], which only allows straight forward declarative rules, in comparison to
Prolog. We also need to assure this in Prolog, it would be unfavourable if the
UP rules got stuck in infinite loops. Prolog allows a broad variety of syntax
constructs. For the metric definition, therefore, we only allow the model
predicates and predicates defined in the template module itself and those from
the cohesion model. We also allow a narrow list of built-in predicates, namely
`=/2`, `member/2` and the negation predicate `not/1`. We also do not allow any
complex terms in the head of the rules, like: ` cp(a(A),B,[H`$|$`T]) :- ...`.
Though this is a sharp restriction of Prolog, we were able to describe several
structural cohesion metrics, as long as they contained a deductive part.

##### Rule Analyser

First, the Rule Analyser determines all predicates defined in the template
module which contains the $LCOM1$ metric rules we presented before. For
$LCOM1$ those are `cp` and `lp`. The analyser collects various meta
information, which we need to build the UP rules. An overview of the collected
meta information:

` head_of_rule(`$headId$`, `$groundHead$`, [`$name$`, `$arity$`])`
` body_predicate_of_rule(`$headId$`, `$bodyId$`,`
` `$positonInBody$`, `$groundPredicate$`)`
` rule_variables(`$headId$`, `$bodyId$`, `$headBodyPrefix$`, `
` `$positonInBody$`, `$groundPredicate$`)`
` `
` predicate_dependencies_transitive_closure(`
` [`$name$`, `$arity$`], `$dependencies$`)`
` `
We need to determine the free variables in the head and the body of the rules.
We also need to check, if the rules contain self references. This is relevant
to determine the positioning of the delta terms (`del_` and `add_` in the body
of propagation rules). Second, in order to create the indirect transition
rules `nwi_P` of a predicate `P`, we need to analyse, if there are transitive
mutual dependencies between `P` and its body predicates `L`i (where 0 $\leq$ i
¡ #number of body predicates of `P` ). The result will determine if we rather
use `nwi_L`i or `nwd_L`i in `nwi_P`, this is important to ensure that the
rules still terminate. We therefore create a predicate dependency graph.

##### UP Rules Generator

Based on the information collected by the rule analyser, the UP Rules
Generator creates the UP rules. As mentioned before, we create negative and
positive Propagation Rules (for the metric), the direct Transition Rules
(metric and model facts) and indirect Transition Rules (metric only). The
rules created are asserted to a module. After completing the generation
process, we also compile all rules to static predicates by using the Prolog
`compile_predicates` predicate. The rule creation is based on string
concatenation, therefore we convert all predicates to atoms, and prepend the
necessary augmentations to each predicate.

##  6 Conclusions and Future Work

Earlier research had shown that the representation of object-oriented source
code as a fact-base in a logic program allows for clear and concise
implementation of static analyses of the object-oriented code. We explored the
potential of this approach further by applying the well-established theory of
update propagation to it. Update propagation gives us a generic way to
transform any analysis represented as a (sufficiently well-formed) logic
program into an incremental version. Given an actual or hypothetical small
change to the fact-base, this incremental version of the analysis provides an
efficient way to caculate the new result of the analysis after the
(hypothetical) change.

We implemented a transformation, generating the propagation and transition
rules based on the original rules. Besides the applicability of update
propagation to our setting, we already conducted several experiments to
explore the performance benefits. In our experiments, update propagation was
significantly faster than actually transforming our model and re-evaluating
the original definition. As a future work, we intend a detailed study of the
performance benefits.

We focused on the precalculation of the refactoring impact on metrics as this
is in line with our research interest. Nevertheless, there is no reason to
limit update propagation for logic meta programming to metrics or not even to
refactoring. In the context of refactoring, update propagation could for
example be used to verify that certain constraints will still hold true after
the refactoring. This would be in line with the original motivation of update
propagation.

A precise definition of the pairs of abstract refactorings on the model and
the corresponding refactorings on the source code, could ease and clarify the
nature of the induced updates model updates. More sophisticated refactorings
also need complex preconditions, before they may be applied legally. We should
be able to check those conditions on the level of sour model.

## References

  * [1] A. Behrend. Soft Stratification for Transformation-Based Approaches to Deductive Databases, University of Bonn: PhD thesis, 2004
  * [2] A. Behrend, R. Manthey: Update Propagation in Deductive Databases Using Soft Stratification, ADBIS 2004: pp. 22-36, Springer.
  * [3] L. C. Briand: A Unified Framework for Cohesion Measurement in Object-Oriented Systems, Empirical Software Engineering 3 (1), pp. 65-117, 1998
  * [4] F. Bry, H. Decker, and R. Manthey: A uniform approach to constraint satisfaction and constraint satisfiability in deductive databases. In Proceedings of the International Conference on Extending Database Technology (EDBT ’88), volume 303 of LNCS, pp. 488-505, Venice, Italy, March 1988. Springer.
  * [5] Shyam R. Chidamber, Chris F. Kemerer: A metrics suite for object oriented design. IEEE Transactions on Software Engineering 20 (6), pp. 476-493, June 1994.
  * [6] M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
  * [7] U. Griefahn. Reactive Model Computation, University of Bonn: PhD thesis, 1997
  * [8] G. Kniesel, J. Hannemann, and T. Rho.: A Comparison of Logic-Based Infrastructures for Concern Detection and Extraction. In Proceedings of the 3rd workshop on Linking aspect technology and evolution (LATE 2007), New York, NY, USA, 2007.
  * [9] V. Küchenhoff: On the efficient computation of the difference between consecutive database states, DOOD 1991: pp. 478-502, volume 566 of LNCS, Springer.
  * [10] Elnar Hajiyev, Mathieu Verbaere, and Oege de Moor. CodeQuest: Scalable Source Code Queries with Datalog. In Dave Thomas, editor, ECOOP, volume 4067 of Lecture Notes in Computer Science, pages 227. Springer, 2006.
  * [11] R. Manthey: Reflections on some fundamental issues of rule-based incremental update propagation, DAISD 1994: pp. 255-276, September 19-21.
  * [12] A. Olivé: Integrity Constraints Checking In Deductive Databases, VLDB 1991: 513-523.
  * [13] D. Speicher: Evolving Software Quality Knowledge, IC3K 2nd International Workshop on Software Knowledge - SKY 2011, Paris, France, 2011.
  * [14] Roel Wuyts. A logic meta-programming approach to support the co-evolution of object-oriented design and implementation. PhD thesis, Vrije Universiteit Brussel, 2001\.