This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

First-Order Stable Model Semantics
with Intensional Functions

Michael Bartholomew and Joohyung Lee School of Computing, Informatics, and Decision Systems Engineering
Arizona State University, Tempe, USA
{mjbartho,joolee}@asu.edu
Abstract

In classical logic, nonBoolean fluents, such as the location of an object, can be naturally described by functions. However, this is not the case in answer set programs, where the values of functions are pre-defined, and nonmonotonicity of the semantics is related to minimizing the extents of predicates but has nothing to do with functions. We extend the first-order stable model semantics by Ferraris, Lee, and Lifschitz to allow intensional functions – functions that are specified by a logic program just like predicates are specified. We show that many known properties of the stable model semantics are naturally extended to this formalism and compare it with other related approaches to incorporating intensional functions. Furthermore, we use this extension as a basis for defining Answer Set Programming Modulo Theories (ASPMT), analogous to the way that Satisfiability Modulo Theories (SMT) is defined, allowing for SMT-like effective first-order reasoning in the context of ASP. Using SMT solving techniques involving functions, ASPMT can be applied to domains containing real numbers and alleviates the grounding problem. We show that other approaches to integrating ASP and CSP/SMT can be related to special cases of ASPMT in which functions are limited to non-intensional ones.

keywords:
Answer Set Programming , Intensional functions , Satisfiability Modulo Theories

1 Introduction

Answer set programming (ASP) is a widely used declarative computing paradigm oriented towards solving knowledge-intensive and combinatorial search problems [Lifschitz, 2008, Brewka et al., 2011]. Its success is mainly due to the expressivity of its modeling language based on the concept of a stable model [Gelfond and Lifschitz, 1988] as well as the efficiency of ASP solvers thanks to intelligent grounding (the process that replaces schematic variables with variable-free terms) and efficient search methods that originated from propositional satisfiability (SAT) solvers.

The grounding and solving approach makes ASP highly effective for Boolean decision problems but becomes problematic when the domain contains a large number of numerical values or a set of real numbers. This is in part related to the limited role of functions in the stable model semantics [Lifschitz, 1988] in comparison with what is allowed in classical logic: either functions are eliminated in the process of grounding, or they are associated with fixed, pre-defined interpretations forming an Herbrand universe. Such a limitation forces us to represent functional fluents by predicates, but not by functions. For example, the following (non-ground) ASP rule represents that the water level does not change by default, where tt is a variable for time stamps, ll is a variable for integers, not stands for default negation, and \sim\!\!\ stands for strong negation:

WaterLevel(t+1,l)WaterLevel(t,l),notWaterLevel(t+1,l),Time(t),Level(l).\begin{array}[]{rcl}\hbox{\it WaterLevel\/}(t\!+\!1,l)&\leftarrow&\hbox{\it WaterLevel\/}(t,l),\ \hbox{\it not\/}\ \sim\!\!\hbox{\it WaterLevel\/}(t\!+\!1,l),\\ &&\hbox{\it Time\/}(t),\hbox{\it Level\/}(l).\end{array} (1)

An attempt to replace the predicate WaterLevel(t,l)\hbox{\it WaterLevel\/}(t,l) by equality using a function, e.g. “WaterLevel(t)=l\hbox{\it WaterLevel\/}(t)=l,” does not work under the standard stable model semantics: “not(WaterLevel(t+1)=l)\hbox{\it not\/}\sim\!\!(\hbox{\it WaterLevel\/}(t\!+\!1)=l)” is not even syntactically valid because strong negation precedes equality, rather than an ordinary ASP atom. Besides, WaterLevel(t)=l\hbox{\it WaterLevel\/}(t)=l is false under any Herbrand interpretation unless ll is the term WaterLevel(t)\hbox{\it WaterLevel\/}(t) itself, implying that WaterLevel(t)=WaterLevel(t+1)\hbox{\it WaterLevel\/}(t)=\hbox{\it WaterLevel\/}(t+1) is always false.

While semantically correct, a computational drawback of using a rule like (1) is that a large set of ground rules needs to be generated when the water level ranges over a large integer domain. Moreover, real numbers are not supported at all because grounding cannot even be applied.

To alleviate the “grounding problem,” there have been recent efforts in integrating ASP with constraint solving, where functional fluents can be represented by constraint variables and computed without fully grounding their value variables, e.g.,  [Mellarkod et al., 2008, Gebser et al., 2009, Balduccini, 2009, Janhunen et al., 2011]. Constraint ASP solvers have demonstrated significantly better performance over traditional ASP solvers on many domains involving a large set of numbers, but they do not provide a fully satisfactory solution to the problem above because the concept of a function is not sufficiently general. For example, one may be tempted to rewrite rule (1) in the language of a constraint ASP solver, such as clingcon111 http://potassco.sourceforge.net/—a combination of ASP solver clingo and constraint solver gecode, as

WaterLevel(t+1)=$lWaterLevel(t)=$l,not¬(WaterLevel(t+1)=$l)\begin{array}[]{l}\hbox{\it WaterLevel\/}(t\!+\!1)\!=^{\$}\!l\ \leftarrow\hbox{\it WaterLevel\/}(t)\!=^{\$}\!l,\ \hbox{\it not\/}\ \neg(\hbox{\it WaterLevel\/}(t\!+\!1)\!=^{\$}\!l)\end{array} (2)

where =$=^{\$} indicates that the atom containing it is a constraint to be processed by constraint solver gecode and not to be processed by ASP solver clingo. The constraint variable WaterLevel(t)\hbox{\it WaterLevel\/}(t) is essentially a function that is mapped to a numeric value. However, this idea does not work either.222However, there is rather an indirect way to represent the assertion in the language of clingcon using Ab predicates: WaterLevel(t+1)=$lWaterLevel(t)=$l,notAb(t).\hbox{\it WaterLevel\/}(t+1)\!=^{\$}\!l\leftarrow\hbox{\it WaterLevel\/}(t)\!=^{\$}\!l,\hbox{\it not\/}\ \hbox{\it Ab\/}(t). While it is possible to say that WaterLevel(t)=10\hbox{\it WaterLevel\/}(t)=10 and WaterLevel(t+1)=WaterLevel(t)\hbox{\it WaterLevel\/}(t+1)=\hbox{\it WaterLevel\/}(t) are true in the language of clingcon, negation as failure (not) in front of constraints does not work in the same way as it does when it is in front of standard ASP atoms. Indeed, rule (2) has no effect on characterizing the default value of WaterLevel(t)\hbox{\it WaterLevel\/}(t) and can be dropped without affecting answer sets. This is because nonmonotonicity of the stable model semantics (as well as almost all extensions, including those of Constraint ASP) is related to the minimality condition on predicates but has nothing to do with functions. Thus, unlike with predicates, they do not allow for directly asserting that functions have default values. Such an asymmetric treatment between functions and predicates in Constraint ASP makes the language of Constraint ASP less general than one might desire.

It is apparent that one of the main obstacles encountered in the above work is due to an insufficient level of generality regarding functions. Recently, the problem has been addressed in another, independent line of research to allow general first-order functions in ASP, although it was not motivated by efficient computation. Lifschitz [?] called such functions “intensional functions”— functions whose values can be described by logic programs, rather than being pre-defined, thus allowing for defeasible reasoning involving functions in accordance with the stable model semantics. In [Cabalar, 2011], based on the notions of partial functions and partial satisfaction, functional stable models were defined by imposing minimality on the values of partial functions. The semantics presented in [Balduccini, 2012] is a special case of the semantics from [Cabalar, 2011] as shown in [Bartholomew and Lee, 2013c]. On the other hand, intensional functions defined in [Lifschitz, 2012] do not require the rather complex notions of partial functions and partial satisfaction but instead impose the uniqueness of values on total functions similar to the way nonmonotonic causal theories [Giunchiglia et al., 2004] are defined. This led to a simpler semantics, but as we show later in this paper, the semantics is not a proper generalization of the first-order stable model semantics from [Ferraris et al., 2011], and moreover, it exhibits some unintuitive behavior.

We present an alternative approach to incorporating intensional functions into the stable model semantics by a simple modification to the first-order stable model semantics from [Ferraris et al., 2011]. It turns out that unlike the semantics from [Lifschitz, 2012], this formalism, which we call “Functional Stable Model Semantics (FSM),” is a proper generalization of the language from [Ferraris et al., 2011], and avoids the unintuitive cases that the language from [Lifschitz, 2012] encounters. Furthermore, unlike the one from [Cabalar, 2011], it does not require the extended notion of partial interpretations that deviates from the notion of classical interpretations. Nevertheless, the semantics from [Cabalar, 2011] can be embedded into FSM by simulating partial interpretations by total interpretations with auxiliary constants [Bartholomew and Lee, 2013c].

Unlike the semantics from [Cabalar, 2011], as FSM properly extends the notion of functions in classical logic, its restriction to background theories provides a straightforward, seamless integration of ASP and Satisfiability Modulo Theories (SMT), which we call “Answer Set Programming Modulo Theories (ASPMT),” analogous to the known relationship between first-order logic and SMT. SMT is a generalization of SAT and, at the same time, a special case of first-order logic in which certain predicate and function symbols in background theories have fixed interpretations. Such background theories include difference logic, linear arithmetic, arrays, and non-linear real-valued functions.

Monotonic Nonmonotonic
FOL FSM
SMT ASP Modulo Theories
SAT Traditional ASP
Figure 1: Analogy between SMT and ASPMT

Likewise, ASPMT can be viewed as a generalization of the traditional ASP and, at the same time, a special case of FSM in which certain background theories are assumed as in SMT. On the other hand, unlike SMT, ASPMT is not only motivated by computational efficiency, but also by expressive knowledge representation. This is due to the fact that ASPMT is a natural extension of both ASP and SMT. Using SMT solving techniques involving functions, ASPMT can be applied to domains containing real numbers and alleviates the grounding problem. It turns out that constraint ASP can be viewed as a special case of ASPMT in which functions are limited to non-intensional ones.

The paper is organized as follows. Section 2 reviews the stable model semantics from [Ferraris et al., 2011], which Section 3 extends to allow intensional functions. Section 4 shows that many known properties of the stable model semantics are naturally established for this extension. Section 5 shows how to eliminate intensional predicates in favor of intensional functions, and Section 6 shows the opposite elimination under a specific condition. Section 7 compares FSM to other approaches to defining intensional functions. Section 8 extends FSM to be many-sorted, and, based on it, Section 9 defines the concept of ASPMT as a special case of many-sorted FSM, and presents its reduction to SMT under certain conditions. Section 10 compares ASPMT to other approaches to combining ASP with CSP and SMT.

This article is an extended version of the conference papers [Bartholomew and Lee, 2012, Bartholomew and Lee, 2013a].333Besides the complete proofs, this article contains some new results, such as the non-existence of translation from non-𝐜{\bf c}-plain formulas to 𝐜{\bf c}-plain formulas, the usefulness of non-𝐜{\bf c}-plain formulas, reducibility of many-sorted FSM to unsorted FSM, and more complete formal comparison with related works.

2 Review: First-Order Stable Model Semantics with Intensional Predicates

The proposed definition of a stable model in this paper is a direct generalization of the one from [Ferraris et al., 2011], which we review in this section. Stable models are defined as classical models that satisfy a certain “stability” condition, which is expressed by ensuring a minimality condition on predicates.

The syntax of formulas is defined the same as in the standard first-order logic. A signature consists of function constants and predicate constants. Function constants of arity 0 are called object constants, and predicate constants of arity 0 are called propositional constants. A term of a signature σ\sigma is formed from object constants of σ\sigma and object variables using function constants of σ\sigma. An atom of σ\sigma is an nn-ary predicate constant followed by a list of nn terms; atomic formulas of σ\sigma are atoms of σ\sigma, equalities between terms of σ\sigma, and the 0-place connective \bot (falsity). First-order formulas of σ\sigma are built from atomic formulas of σ\sigma using the primitive propositional connectives ,,,,\bot,\ \land,\ \lor,\ \rightarrow, as well as quantifiers ,\forall,\ \exists. We understand ¬F\neg F as an abbreviation of FF\rightarrow\bot; symbol \top stands for \bot\rightarrow\bot, and FGF\leftrightarrow G stands for (FG)(GF)(F\rightarrow G)\land(G\rightarrow F), and t1t2t_{1}\neq t_{2} stands for ¬(t1=t2)\neg(t_{1}=t_{2}).

In [Ferraris et al., 2011], stable models are defined in terms of the SM operator, whose definition is similar to the CIRC operator used for defining circumscription [McCarthy, 1980, Lifschitz, 1994]. As in circumscription, for predicate symbols (constants or variables) uu and pp, expression upu\leq p is defined as shorthand for 𝐱(u(𝐱)p(𝐱))\forall{\bf x}(u({\bf x})\rightarrow p({\bf x})); expression u=pu=p is defined as 𝐱(u(𝐱)p(𝐱))\forall{\bf x}(u({\bf x})\leftrightarrow p({\bf x})). For lists of predicate symbols 𝐮=(u1,,un){\bf u}=(u_{1},\dots,u_{n}) and 𝐩=(p1,,pn){\bf p}=(p_{1},\dots,p_{n}), expression 𝐮𝐩{\bf u}\leq{\bf p} is defined as (u1p1)(unpn)(u_{1}\leq p_{1})\land\dots\land(u_{n}\leq p_{n}), expression 𝐮=𝐩{\bf u}={\bf p} is defined as (u1=p1)(un=pn)(u_{1}=p_{1})\land\dots\land(u_{n}=p_{n}), and expression 𝐮<𝐩{\bf u}<{\bf p} is defined as 𝐮𝐩¬(𝐮=𝐩){\bf u}\leq{\bf p}\land\neg({\bf u}={\bf p}).

For any first-order formula FF and any finite list of predicate constants 𝐩=(p1,,pn){\bf p}=(p_{1},\dots,p_{n}), formula SM[F;𝐩]\hbox{\rm SM}[F;{\bf p}] is defined as

F¬𝐩^(𝐩^<𝐩F(𝐩^)),F\land\neg\exists\widehat{\bf p}(\widehat{\bf p}<{\bf p}\land F^{*}(\widehat{\bf p})),

where 𝐩^\widehat{\bf p} is a list of distinct predicate variables p^1,,p^n\widehat{p}_{1},\dots,\widehat{p}_{n}, and F(𝐩^)F^{*}(\widehat{\bf p}) is defined recursively as follows:

  • When FF is an atomic formula, F(𝐩^)F^{*}(\widehat{\bf p}) is a formula obtained from FF by replacing all predicate constants 𝐩{\bf p} in it with the corresponding predicate variables from 𝐩^\widehat{\bf p};

  • (GH)(𝐩^)=G(𝐩^)H(𝐩^)(G\land H)^{*}(\widehat{\bf p})=G^{*}(\widehat{\bf p})\land H^{*}(\widehat{\bf p});

  • (GH)(𝐩^)=G(𝐩^)H(𝐩^)(G\lor H)^{*}(\widehat{\bf p})=G^{*}(\widehat{\bf p})\lor H^{*}(\widehat{\bf p});

  • (GH)(𝐩^)=(G(𝐩^)H(𝐩^))(GH)(G\rightarrow H)^{*}(\widehat{\bf p})=(G^{*}(\widehat{\bf p})\rightarrow H^{*}(\widehat{\bf p}))\land(G\rightarrow H);

  • (xG)(𝐩^)=xG(𝐩^)(\forall xG)^{*}(\widehat{\bf p})=\forall xG^{*}(\widehat{\bf p});

  • (xG)(𝐩^)=xG(𝐩^)(\exists xG)^{*}(\widehat{\bf p})=\exists xG^{*}(\widehat{\bf p}).

The predicate constants in 𝐩{\bf p} are called intensional: these are the predicates that we “intend to characterize” by FF.444Intensional predicates are analogous to output predicates in Datalog, and non-intensional predicates are analogous to input predicates in Datalog [Lifschitz, 2011]. When FF is a sentence (i.e., formula without free variables), the models of the second-order sentence SM[F;𝐩]\hbox{\rm SM}[F;{\bf p}] are called the stable models of FF relative to 𝐩{\bf p}: they are the models of FF that are “stable” on 𝐩{\bf p}.

Answer sets are defined as a special class of first-order stable models as follows. By σ(F)\sigma(F) we denote the signature consisting of the function and predicate constants occurring in FF. If FF contains at least one object constant, an Herbrand interpretation of σ(F)\sigma(F) that satisfies SM[F;𝐩]\hbox{\rm SM}[F;{\bf p}] is called an answer set of FF, where 𝐩{\bf p} is the list of all predicate constants in σ(F)\sigma(F). The answer sets of a logic program Π\Pi are defined as the answer sets of the FOL-representation of Π\Pi, which is obtained from Π\Pi by

  • replacing every comma by conjunction and every not by ¬\neg 555Strong negation can be incorporated by introducing “negative” predicates as in [Ferraris et al., 2011, Section 8], or can be represented by a Boolean function with the value false [Bartholomew and Lee, 2013b]. For example, p\sim p can be represented by p=falsep\!=\!\hbox{\sc false}.

  • turning every rule HeadBody\hbox{\it Head\/}\leftarrow\hbox{\it Body\/} into a formula rewriting it as the implication BodyHead\hbox{\it Body\/}\rightarrow\hbox{\it Head\/}, and

  • forming the conjunction of the universal closures of these formulas.

For example, the FOL-representation of the program

p(a)q(b)r(x)p(x),notq(x)\begin{array}[]{l}p(a)\\ q(b)\\ r(x)\leftarrow p(x),\hbox{\it not\/}\ q(x)\end{array}

is

p(a)q(b)x((p(x)¬q(x))r(x))p(a)\land q(b)\land\forall x((p(x)\land\neg q(x))\rightarrow r(x)) (3)

and SM[F;p,q,r]\hbox{\rm SM}[F;\ p,q,r] is

p(a)q(b)x((p(x)¬q(x))r(x))¬uvw(((u,v,w)<(p,q,r))u(a)v(b)x(((u(x)(¬v(x)¬q(x)))w(x))((p(x)¬q(x))r(x)))),\begin{array}[]{l}p(a)\land q(b)\land\forall x((p(x)\land\neg q(x))\rightarrow r(x))\\ \quad\land\neg\exists uvw\Big{(}\big{(}(u,v,w)<(p,q,r)\big{)}\wedge u(a)\land v(b)\\ \hskip 50.00008pt\land\forall x\Big{(}\big{(}(u(x)\land(\neg v(x)\land\neg q(x)))\rightarrow w(x)\big{)}\land\big{(}(p(x)\land\neg q(x))\rightarrow r(x)\big{)}\Big{)}\Big{)},\end{array}

which is equivalent to the first-order sentence

x(p(x)x=a)x(q(x)x=b)x(r(x)(p(x)¬q(x)))\begin{array}[]{l}\forall x(p(x)\leftrightarrow x=a)\land\forall x(q(x)\leftrightarrow x=b)\land\forall x(r(x)\leftrightarrow(p(x)\land\neg q(x)))\end{array} (4)

[Ferraris et al., 2007, Example 3]. The stable models of FF are any first-order models of (4). The only answer set of FF is the Herbrand model {p(a),q(b),r(a)}\{p(a),\ q(b),\ r(a)\}.

Remark 1

According to [Ferraris et al., 2011], this definition of an answer set, when applied to the syntax of logic programs, is equivalent to the traditional definition of an answer set that is based on grounding and fixpoints as in [Gelfond and Lifschitz, 1988].

It is also noted in [Ferraris et al., 2011] that if we replace F(𝐩^)F^{*}(\widehat{\bf p}) with a simpler expression F(𝐩^)F(\widehat{\bf p}) (which substitutes 𝐩^\widehat{\bf p} for 𝐩{\bf p}), then the definition of SM[F;𝐩]\hbox{\rm SM}[F;{\bf p}] reduces to the definition of CIRC[F;𝐩]\hbox{\rm CIRC}[F;{\bf p}].

The definition of a stable model above is not limited to Herbrand models, so it allows general functions as in classical first-order logic. Indeed, in Section 10, we show that the previous approaches to combining answer set programs and constraint processing can be viewed as special cases of first-order formulas under the stable model semantics. However, these functions are “extensional,” and cannot cover examples like (2).

3 Extending First-Order Stable Model Semantics to Allow Intensional Functions

In this section, we generalize the first-order stable model semantics to allow intensional functions in addition to intensional predicates.

3.1 Second-Order Logic Characterization of the Stable Model Semantics

We extend expression u=cu=c as 𝐱(u(𝐱)=c(𝐱))\forall{\bf x}(u({\bf x})=c({\bf x})) if uu and cc are function symbols. For lists of predicate and function symbols 𝐮=(u1,,un){\bf u}=(u_{1},\dots,u_{n}) and 𝐜=(c1,,cn){\bf c}=(c_{1},\dots,c_{n}), expression 𝐮=𝐜{\bf u}={\bf c} is defined as (u1=c1)(un=cn)(u_{1}=c_{1})\land\dots\land(u_{n}=c_{n}).

Let 𝐜{\bf{c}} be a list of distinct predicate and function constants, and let 𝐜^{\widehat{\bf{c}}} be a list of distinct predicate and function variables corresponding to 𝐜{\bf{c}}. By 𝐜𝑝𝑟𝑒𝑑{\bf{c}}^{\mathit{pred}} (𝐜𝑓𝑢𝑛𝑐{\bf{c}}^{\mathit{func}}, respectively) we mean the list of all predicate constants (function constants, respectively) in 𝐜{\bf{c}}, and by 𝐜^𝑝𝑟𝑒𝑑{\widehat{\bf{c}}}^{\mathit{pred}} (𝐜^𝑓𝑢𝑛𝑐{\widehat{\bf{c}}}^{\mathit{func}}, respectively) the list of the corresponding predicate variables (function variables, respectively) in 𝐜^{\widehat{\bf{c}}}. For any formula FF, expression SM[F;𝐜]\hbox{\rm SM}[F;\ {\bf{c}}] is defined as

F¬𝐜^(𝐜^<𝐜F(𝐜^)),F\land\neg\exists{\widehat{\bf{c}}}({\widehat{\bf{c}}}<{\bf{c}}\land F^{*}({\widehat{\bf{c}}})), (5)

where 𝐜^<𝐜{\widehat{\bf{c}}}<{\bf{c}} is shorthand for (𝐜^𝑝𝑟𝑒𝑑𝐜𝑝𝑟𝑒𝑑)¬(𝐜^=𝐜)({\widehat{\bf{c}}}^{\mathit{pred}}\leq{\bf{c}}^{\mathit{pred}})\land\neg({\widehat{\bf{c}}}={\bf{c}}), and F(𝐜^)F^{*}({\widehat{\bf{c}}}) is defined recursively in the same way as F(𝐩^)F^{*}(\widehat{\bf p}) except for the base case, which is defined as follows.

  • When FF is an atomic formula, F(𝐜^)F^{*}({\widehat{\bf{c}}}) is FFF^{\prime}\land F where FF^{\prime} is obtained from FF by replacing all (predicate and function) constants 𝐜{\bf c} in it with the corresponding variables from 𝐜^{\widehat{\bf{c}}}.

As before, we say that an interpretation II that satisfies SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] a stable model of FF relative to 𝐜{\bf c}. Clearly, every stable model of FF is a model of FF but not vice versa.

Remark 2

It is easy to see that the definition of a stable model above is a proper generalization of the one from [Ferraris et al., 2011], also reviewed in the previous section: the definition of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] in this section reduces to the one in the previous section when all intensional constants in 𝐜{\bf c} are predicate constants only.

When all intensional constants are function constants only, the definition of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] is similar to the first-order nonmonotonic causal theories defined in [Lifschitz, 1997]. The only difference is that, instead of F(c^)F^{*}(\widehat{c}), a different expression is used there. A more detailed comparison is given in Section 7.1.

We will often write FGF\rightarrow G as GFG\leftarrow F and identify a finite set of formulas with the conjunction of the universal closures of each formula in that set.

For any formula FF, expression {F}ch\{F\}^{\rm ch} denotes the “choice” formula (F¬F)(F\lor\neg F).

The following two lemmas are often useful in simplifying F(𝐜^)F^{*}({\widehat{\bf{c}}}), as we demonstrate in Example 1 below. They are natural extensions of Lemmas 5 and 6 from [Ferraris et al., 2011].

Lemma 1

Formula

(𝐜^<𝐜)F(𝐜^)F({\widehat{\bf{c}}}<{\bf{c}})\land F^{*}({\widehat{\bf{c}}})\rightarrow F

is logically valid.

Proof.  By induction on the structure of FF.   

Lemma 2

Formula

𝐜^<𝐜((¬F)(𝐜^)¬F){\widehat{\bf{c}}}<{\bf{c}}\rightarrow((\neg F)^{*}({\widehat{\bf{c}}})\leftrightarrow\neg F)

is logically valid.

Proof.  Immediate from Lemma 1.   

Example 1

The following program F1F_{1} describes the level of an unlimited water tank that is filled up unless it is flushed.

{Amt1=x+1}chAmt0=x,Amt1=0Flush.\begin{array}[]{rcl}\{\hbox{\it Amt\/}_{1}\!=\!x\!+\!1\}^{\rm ch}&\leftarrow&\hbox{\it Amt\/}_{0}\!=\!x,\\ \hbox{\it Amt\/}_{1}\!=\!0&\leftarrow&\hbox{\it Flush\/}\ .\end{array} (6)

Here Amt1\hbox{\it Amt\/}_{1} is an intensional function constant, and xx is a variable ranging over nonnegative integers. Intuitively, the first rule asserts that the amount increases by one by default.666Section 4.2 explains why choice formulas are read as specifying default values. However, if Flush action is executed (e.g., if we add the fact Flush to (6)), this behavior is overridden, and the amount is set to 0.

Using Lemmas 1 and 2, under the assumption Amt1^<Amt1\widehat{\hbox{\it Amt\/}_{1}}<\hbox{\it Amt\/}_{1}, one can check that formula F1(Amt1^)F_{1}^{*}(\widehat{\hbox{\it Amt\/}_{1}}) is equivalent to the conjunction consisting of (6) and

(Amt1^=x+1Amt1=x+1)¬(Amt1=x+1)Amt0=x,Amt1^=0Amt1=0Flush,\begin{array}[]{rcl}(\widehat{\hbox{\it Amt\/}_{1}}=x\!+\!1\land\hbox{\it Amt\/}_{1}=x\!+\!1)\lor\neg(\hbox{\it Amt\/}_{1}=x\!+\!1)&\ \leftarrow&\hbox{\it Amt\/}_{0}\!=\!x,\\ \widehat{\hbox{\it Amt\/}_{1}}=0\land\hbox{\it Amt\/}_{1}=0&\ \leftarrow&\hbox{\it Flush\/},\end{array} (7)

so that

SM[F1;Amt1]\displaystyle\hbox{\rm SM}[F_{1};\hbox{\it Amt\/}_{1}] =F1¬Amt1^(Amt1^Amt1F1(Amt1^))\displaystyle=F_{1}\land\neg\exists\widehat{\hbox{\it Amt\/}_{1}}(\widehat{\hbox{\it Amt\/}_{1}}\neq\hbox{\it Amt\/}_{1}\land F_{1}^{*}(\widehat{\hbox{\it Amt\/}_{1}}))
F1¬Amt1^(Amt1^Amt1\displaystyle\Leftrightarrow F_{1}\land\neg\exists\widehat{\hbox{\it Amt\/}_{1}}(\widehat{\hbox{\it Amt\/}_{1}}\neq\hbox{\it Amt\/}_{1}\land
x(Amt0=x¬(Amt1=x+1))(Flush)).\displaystyle\hskip 85.35826pt\forall x(\hbox{\it Amt\/}_{0}\!=\!x\rightarrow\neg(\hbox{\it Amt\/}_{1}=x\!+\!1))\land(\hbox{\it Flush\/}\rightarrow\bot)).

Consider the first-order interpretations that have the set of nonnegative integers as the universe, interprets integers, arithmetic functions, and comparison operators in the standard way, and maps the other constants in the following way.

Amt0\hbox{\it Amt\/}_{0} Flush Amt1\hbox{\it Amt\/}_{1}
I1I_{1} 55 false 66
I2I_{2} 55 false 88
I3I_{3} 55 true 0
  • Interpretation I1I_{1} is in accordance with the intuitive reading of the rules above, and it is indeed a model of SM[F1;Amt1]\hbox{\rm SM}[F_{1};\hbox{\it Amt\/}_{1}].

  • Interpretation I2I_{2} is not intuitive (the amount suddenly jumps up with no reason). It is not a model of SM[F1;Amt1]\hbox{\rm SM}[F_{1};\hbox{\it Amt\/}_{1}] though it is a model of F1F_{1}.

  • Interpretation I3I_{3} is in accordance with the intuitive reading of the rules above. It is a model of SM[F1;Amt1]\hbox{\rm SM}[F_{1};\hbox{\it Amt\/}_{1}].

3.2 Reduct-Based Characterization of the Stable Model Semantics

The second-order logic based definition of a stable model in the previous section is succinct, and is a natural extension of the first-order stable model semantics that is defined in [Ferraris et al., 2011], but it may look distant from the usual definition of a stable model in the literature that is given in terms of grounding and fixpoints.

In [Bartholomew and Lee, 2013c], an equivalent definition of the functional stable model semantics in terms of infinitary ground formulas and reduct is given. Appendix A of this article contains a review of the definition.

4 Properties of Functional Stable Models

Many properties known for the stable model semantics can be naturally extended to the functional stable model semantics, which is a desirable feature of the proposed formalism.

4.1 Constraints

Following ? [?], we say that an occurrence of a constant or any other subexpression in a formula FF is positive if the number of implications containing that occurrence in the antecedent is even, and negative otherwise. We say that the occurrence is strictly positive if the number of implications in FF containing that occurrence in the antecedent is 0. For example, in ¬(f=1)g=1\neg(f=1)\rightarrow g=1, the occurrences of ff and gg are both positive, but only the occurrence of gg is strictly positive.777Recall that we understand ¬F\neg F as shorthand for FF\rightarrow\bot.

About a formula FF we say that it is negative on a list 𝐜{\bf{c}} of predicate and function constants if FF has no strictly positive occurrence of a constant from 𝐜{\bf{c}}. Since any formula of the form ¬H\neg H is shorthand for HH\rightarrow\bot, such a formula is negative on any list of constants. The formulas of the form ¬H\neg H are called constraints in the literature of ASP: adding a constraint to a program affects the set of its stable models in a particularly simple way by eliminating the stable models that “violate” the constraint.888Note that the term “constraint” here is different from the one used in CSP.

The following theorem is a generalization of Theorem 3 from [Ferraris et al., 2011] for the functional stable model semantics.

Theorem 1

For any first-order formulas FF and GG, if GG is negative on 𝐜{\bf{c}}, then SM[FG;𝐜]\hbox{\rm SM}[F\land G;{\bf{c}}] is equivalent to SM[F;𝐜]G\hbox{\rm SM}[F;{\bf{c}}]\land G.

Example 2

Consider SM[F2¬(f=1);fg]\hbox{\rm SM}[F_{2}\land\neg(f\!=\!1);fg] where F2F_{2} is (f=1g=1)(f=2g=2)(f\!=\!1\lor g\!=\!1)\land(f\!=\!2\lor g\!=\!2). Since ¬(f=1)\neg(f\!=\!1) is negative on {f,g}\{f,g\}, according to Theorem 1, SM[F2¬(f=1);fg]\hbox{\rm SM}[F_{2}\land\neg(f\!=\!1);fg] is equivalent to SM[F2;fg]¬(f=1)\hbox{\rm SM}[F_{2};fg]\land\neg(f\!=\!1), which is equivalent to f=2g=1f\!=\!2\land g\!=\!1.

4.2 Choice and Defaults

Similar to Theorem 2 from [Ferraris et al., 2011], Theorem 2 below shows that making the set of intensional constants smaller can only make the result of applying SM weaker, and that this can be compensated by adding choice formulas. For any predicate constant pp, by Choice(p)\hbox{\it Choice\/}(p) we denote the formula 𝐱{p(𝐱)}ch\forall{\bf x}\{p({\bf x})\}^{\rm ch} (recall that {F}ch\{F\}^{\rm ch} is shorthand for F¬FF\lor\neg F), where 𝐱{\bf x} is a list of distinct object variables. For any function constant ff, by Choice(f)\hbox{\it Choice\/}(f) we denote the formula 𝐱y{f(𝐱)=y}ch\forall{\bf x}y\{f({\bf x})=y\}^{\rm ch}, where yy is an object variable that is distinct from 𝐱{\bf x}. For any finite list of predicate and function constants 𝐜{\bf{c}}, the expression Choice(𝐜)\hbox{\it Choice\/}({\bf{c}}) stands for the conjunction of the formulas Choice(c)\hbox{\it Choice\/}(c) for all members cc of 𝐜{\bf{c}}. We sometimes identify a list with the corresponding set when there is no confusion.

The following theorem is a generalization of Theorem 7 from [Ferraris et al., 2011] for the functional stable model semantics.

Theorem 2

For any first-order formula FF and any disjoint lists 𝐜{\bf{c}}, 𝐝{\bf{d}} of distinct constants, the following formulas are logically valid:

SM[F;𝐜𝐝]SM[F;𝐜],SM[FChoice(𝐝);𝐜𝐝]SM[F;𝐜].\begin{array}[]{c}\hbox{\rm SM}[F;{\bf{c}}{\bf{d}}]\rightarrow\hbox{\rm SM}[F;{\bf{c}}],\\ \hbox{\rm SM}[F\land\hbox{\it Choice\/}({\bf{d}});{\bf{c}}{\bf{d}}]\leftrightarrow\hbox{\rm SM}[F;{\bf{c}}].\end{array}

For example,

SM[(g=1f=1)y(g=y¬(g=y));fg]\hbox{\rm SM}[(g\!=\!1\rightarrow f\!=\!1)\land\forall y(g\!=\!y\lor\neg(g\!=\!y));\ fg]

is equivalent to

SM[g=1f=1;f].\hbox{\rm SM}[g\!=\!1\rightarrow f\!=\!1;\ f].

A formula {f(𝐭)=𝐭}ch\{f({\bf t})={\bf t}^{\prime}\}^{\rm ch}, where ff is an intensional function constant and 𝐭{\bf t}, 𝐭{\bf t}^{\prime} contain no intensional function constants, intuitively represents that f(𝐭)f({\bf t}) takes the value 𝐭{\bf t}^{\prime} by default. For example, the stable models of {g=1}ch\{g\!=\!1\}^{\rm ch} relative to gg map gg to 11. On the other hand, the default behavior is overridden when we conjoin the formula with g=2g\!=\!2: the stable models of

{g=1}chg=2\{g\!=\!1\}^{\rm ch}\land g\!=\!2

relative to gg map gg to 22, and no longer to 11.

The treatment of {g=1}ch\{g=1\}^{\rm ch} as (g=1)¬(g=1)(g=1)\lor\neg(g=1) is similar to the choice rule {p}ch\{p\}^{\rm ch} in ASP for propositional constant pp, which stands for p¬pp\lor\neg p, with an exception that gg has to satisfy a functional requirement, i.e., it is mapped to a unique value. Under that requirement, an interpretation that maps gg to 11 is a stable model but another assignment to gg is not a stable model because the choice rule itself does not force one to believe that gg is mapped to that other value. This makes the choice rule for the function work as assigning a default value to the function.

With this understanding, the commonsense law of inertia can be succinctly represented using choice formulas for functions. For instance, the formula

Loc(b,t)=l{Loc(b,t+1)=l}ch,\hbox{\it Loc\/}(b,t)\!=\!l\ \rightarrow\ \{\hbox{\it Loc\/}(b,t\!+\!1)\!=\!l\}^{\rm ch}, (8)

where Loc is an intensional function constant, represents that the location of a block bb at next step retains its value by default. The default behavior can be overridden if some action moves the block. In contrast, the standard ASP representation of the commonsense law of inertia, such as (1), uses both default negation and strong negation, and requires the user to be aware of the subtle difference between them.

4.3 Strong Equivalence

Strong equivalence [Lifschitz et al., 2001] is an important notion that allows us to replace a subformula with another subformula without affecting the stable models. The theorem on strong equivalence can be extended to formulas with intensional functions as follows.

For first-order formulas FF and GG, we say that FF is strongly equivalent to GG if, for any formula HH, any occurrence of FF in HH, and any list 𝐜{\bf{c}} of distinct predicate and function constants, SM[H;𝐜]\hbox{\rm SM}[H;{\bf{c}}] is equivalent to SM[H;𝐜]\hbox{\rm SM}[H^{\prime};{\bf{c}}], where HH^{\prime} is obtained from HH by replacing the occurrence of FF by GG.

The following theorem tells us that strong equivalence can be characterized in terms of equivalence in classical logic.

Theorem 3

Let FF and GG be first-order formulas, let 𝐜{\bf{c}} be the list of all predicate and function constants occurring in FF or GG, and let 𝐜^\widehat{{\bf{c}}} be a list of distinct predicate and function variables corresponding to 𝐜{\bf{c}}. The following conditions are equivalent to each other.

  • FF and GG are strongly equivalent to each other;

  • Formula

    (FG)(𝐜^<𝐜(F(𝐜^)G(𝐜^)))(F\leftrightarrow G)\land(\widehat{{\bf{c}}}<{\bf{c}}\rightarrow(F^{*}(\widehat{{\bf{c}}})\leftrightarrow G^{*}(\widehat{{\bf{c}}}))) (9)

    is logically valid.

For instance, choice formula {F}ch\{F\}^{\rm ch} is strongly equivalent to ¬¬FF\neg\neg F\rightarrow F. This can be shown, in accordance with Theorem 3, by checking that not only they are classically equivalent but also

(F¬F)(𝐜^)(F\lor\neg F)^{*}({\widehat{{\bf{c}}}})

and

(¬¬FF)(𝐜^)(\neg\neg F\rightarrow F)^{*}(\widehat{{\bf{c}}})

are classically equivalent under 𝐜^<𝐜\widehat{{\bf{c}}}<{\bf{c}}. Indeed, in view of Lemma 2, (F¬F)(𝐜^)(F\lor\neg F)^{*}({\widehat{{\bf{c}}}}) is equivalent to (F(𝐜^)¬F)(F^{*}({\widehat{{\bf{c}}}})\lor\neg F) and (¬¬FF)(𝐜^)(\neg\neg F\rightarrow F)^{*}(\widehat{{\bf{c}}}) is equivalent to FF(𝐜^)F\rightarrow F^{*}(\widehat{{\bf{c}}}). This fact allows us to rewrite formula (8)(\ref{inertia}) as an implication in which the consequent is an atomic formula:

Loc(b,t)=l¬¬(Loc(b,t+1)=l)Loc(b,t+1)=l.\hbox{\it Loc\/}(b,t)\!=\!l\land\neg\neg(\hbox{\it Loc\/}(b,t+1)\!=\!l)\ \rightarrow\ \hbox{\it Loc\/}(b,t\!+\!1)\!=\!l.

For another example, (GF)(HF)(G\rightarrow F)\land(H\rightarrow F) is strongly equivalent to (GH)F(G\lor H)\rightarrow F. This is useful for rewriting a theory into “Clark normal form,” to which we can apply completion as presented in the next section.

4.4 Completion

Completion [Clark, 1978] is a process that turns formulas under the stable model semantics to formulas under the standard first-order logic.

We say that a formula FF is in Clark normal form (relative to a list 𝐜{\bf c} of intensional constants) if it is a conjunction of sentences of the form

𝐱(Gp(𝐱))\forall{\bf x}(G\rightarrow p({\bf x})) (10)

and

𝐱y(Gf(𝐱)=y)\forall{\bf x}y(G\rightarrow f({\bf x})\!=\!y) (11)

one for each intensional predicate constant pp in 𝐜{\bf c} and each intensional function constant ff in 𝐜{\bf c}, where 𝐱{\bf x} is a list of distinct object variables, yy is another object variable, and GG is a formula that has no free variables other than those in 𝐱{\bf x} and yy.

The completion of a formula FF in Clark normal form relative to 𝐜{\bf c}, denoted by COMP[F;𝐜]\hbox{\rm COMP}[F;{\bf c}], is obtained from FF by replacing each conjunctive term (10) with

𝐱(p(𝐱)G)\forall{\bf x}(p({\bf x})\leftrightarrow G) (12)

and each conjunctive term (11) with

𝐱y(f(𝐱)=yG).\forall{\bf x}y(f({\bf x})\!=\!y\leftrightarrow G). (13)

The dependency graph of FF (relative to 𝐜{\bf c}), denoted by DG𝐜[F]\hbox{\rm DG}_{\bf{c}}[F], is the directed graph that

  • has all members of 𝐜{\bf c} as its vertices, and

  • has an edge from cc to dd if, for some strictly positive occurrence of GHG\rightarrow H in FF,

    • cc has a strictly positive occurrence in HH, and

    • dd has a strictly positive occurrence in GG.

We say that FF is tight (on c) if the dependency graph of FF (relative to c) is acyclic. The following theorem, which generalizes Theorem 11 from [Ferraris et al., 2011] for the functional stable model semantics, tells us that, for a tight formula, completion is a process that allows us to reclassify intensional constants as non-intensional ones. It is similar to the main theorem of [Lifschitz and Yang, 2013], which describes functional completion in the context of nonmonotonic causal logic.

Theorem 4

For any formula FF in Clark normal form relative to 𝐜{\bf c} that is tight on 𝐜{\bf c}, an interpretation II that satisfies xy(xy)\exists xy(x\neq y) is a model of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] iff II is a model of COMP[F;𝐜]\hbox{\rm COMP}[F;{\bf c}].

Example 1 Continued  Formula F1F_{1} is not in Clark normal Form relative to Amt1\hbox{\it Amt\/}_{1}, but it is strongly equivalent to

Amt1=yy=x+1Amt0=x¬¬(Amt1=y),Amt1=yy=0Flush.\begin{array}[]{rcl}\hbox{\it Amt\/}_{1}\!=\!y&\ \leftarrow&y\!=\!x\!+\!1\land\hbox{\it Amt\/}_{0}\!=\!x\land\neg\neg(\hbox{\it Amt\/}_{1}=y),\\ \hbox{\it Amt\/}_{1}\!=\!y&\ \leftarrow&y\!=\!0\land\hbox{\it Flush\/}\ .\end{array}

and further to

Amt1=y(y=x+1Amt0=x¬¬(Amt1=y))(y=0Flush),\begin{array}[]{rcl}\hbox{\it Amt\/}_{1}\!=\!y&\ \leftarrow&\big{(}y\!=\!x\!+\!1\land\hbox{\it Amt\/}_{0}\!=\!x\land\neg\neg(\hbox{\it Amt\/}_{1}\!=\!y)\big{)}\lor\big{(}y\!=\!0\land\hbox{\it Flush\/}\big{)},\end{array}

which is in Clark normal form relative to Amt1\hbox{\it Amt\/}_{1} and is tight on Amt1\hbox{\it Amt\/}_{1}. In accordance with Theorem 4, the stable models of F1F_{1} relative to Amt1\hbox{\it Amt\/}_{1} coincide with the classical models of

Amt1=y(y=x+1Amt0=x¬¬(Amt1=y))(y=0Flush).\begin{array}[]{rcl}\hbox{\it Amt\/}_{1}\!=\!y&\ \leftrightarrow&\big{(}y\!=\!x\!+\!1\land\hbox{\it Amt\/}_{0}\!=\!x\land\neg\neg(\hbox{\it Amt\/}_{1}\!=\!y)\big{)}\lor\big{(}y\!=\!0\land\hbox{\it Flush\/}\big{)}.\end{array}

The assumption xy(xy)\exists xy(x\neq y) in the statement of Theorem 4 is essential to avoid the mismatch between “trivial” stable models and models of completion when the universe is a singleton. Recall that in order to dispute the stability of a model II in the presence of intensional function constants, one needs another interpretation that is different from II on intensional function constants. If the universe contains only one element, the stability of a model is trivial. For example, take FF to be \top and 𝐜{\bf c} to be an intensional function constant ff. If the universe |I||I| of an interpretation II is a singleton, then II satisfies SM[F]\hbox{\rm SM}[F] because there is only one way to interpret 𝐜{\bf{c}}, but II does not satisfy the completion formula 𝐱y(f(𝐱)=y)\forall{\bf x}y(f({\bf x})=y\leftrightarrow\bot).

5 Eliminating Intensional Predicates in Favor of Intensional Functions

In first-order logic, it is known that predicate constants can be replaced by function constants and vice versa. This section and the next section show similar transformations under the functional stable model semantics.

5.1 Eliminating Intensional Predicates

Intensional predicate constants can be eliminated in favor of intensional function constants as follows.

Given a formula FF and an intensional predicate constant pp, formula FfpF^{p}_{f} is obtained from FF as follows:

  • in the signature of FF, replace pp with a new intensional function constant ff of arity nn, where nn is the arity of pp, and add two new non-intensional object constants 0 and 11 (rename if necessary);

  • replace each subformula p(𝐭)p({\bf t}) in FF with f(𝐭)=1f({\bf t})=1.

By FCf\hbox{\it FC\/}_{f} (“Functional Constraint on ff”) we denote the conjunction of the following formulas, which enforces ff to be two-valued:

01,0\neq 1, (14)
¬¬𝐱(f(𝐱)=0f(𝐱)=1),\neg\neg\forall{\bf x}(f({\bf x})=0\lor f({\bf x})=1), (15)

where 𝐱{\bf x} is a list of distinct object variables. By DFf\hbox{\it DF\/}_{f} (“Default False on ff”) we denote the formula

𝐱{f(𝐱)=0}ch.\forall{\bf x}\{f({\bf x})=0\}^{\rm ch}. (16)
Example 3

Let FF be the conjunction of the universal closures of the following formulas:

Loc(b,t)=l{Loc(b,t+1)=l}ch,Move(b,l,t)Loc(b,t+1)=l\begin{array}[]{c}\hbox{\it Loc\/}(b,t)\!=\!l\rightarrow\{\hbox{\it Loc\/}(b,t+1)\!=\!l\}^{\rm ch},\\ \hbox{\it Move\/}(b,l,t)\rightarrow\hbox{\it Loc\/}(b,t+1)=l\end{array}

(lower case symbols are variables). We eliminate the intensional predicate constant Move in favor of an intensional function constant Movef\hbox{\it Move\/}_{f} to obtain FMovefMoveFCMovefDFMovefF_{\textit{Move}_{f}}^{\textit{Move}}\land\hbox{\it FC\/}_{\textit{Move}_{f}}\land\hbox{\it DF\/}_{\textit{Move}_{f}}, which is the conjunction of the universal closures of the following formulas:

Loc(b,t)=l{Loc(b,t+1)=l}ch,Movef(b,l,t)=1Loc(b,t+1)=l,01,¬¬(Movef(b,l,t)=0Movef(b,l,t)=1),{Movef(b,l,t)=0}ch.\begin{array}[]{c}\hbox{\it Loc\/}(b,t)\!=\!l\rightarrow\{\hbox{\it Loc\/}(b,t\!+\!1)\!=\!l\}^{\rm ch},\\ \hbox{\it Move\/}_{f}(b,l,t)=1\rightarrow\hbox{\it Loc\/}(b,t\!+\!1)=l,\\ 0\neq 1,\\ \neg\neg(\hbox{\it Move\/}_{f}(b,l,t)=0\lor\hbox{\it Move\/}_{f}(b,l,t)=1),\\ \{\hbox{\it Move\/}_{f}(b,l,t)=0\}^{\rm ch}.\end{array}

The following theorem asserts the correctness of the elimination method.

Theorem 5

The set of formulas

{𝐱(f(𝐱)=1p(𝐱)),FCf}\{\forall{\bf x}(f({\bf x})=1\leftrightarrow p({\bf x})),\ \ \hbox{\it FC\/}_{f}\}

entails

SM[F;p𝐜]SM[FfpDFf;f𝐜].\hbox{\rm SM}[F;p{\bf c}]\leftrightarrow\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}].

The following corollary to Theorem 5 tells us that there is a 1–1 correspondence between the stable models of FF and the stable models of its “functional image” FfpDFfFCfF^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f}. For any interpretation II of the signature of FF, by IfpI^{p}_{f} we denote the interpretation of the signature of FfpF^{p}_{f} obtained from II by replacing the set pIp^{I} with the function fIfpf^{I^{p}_{f}} such that, for all ξ1,,ξn\xi_{1},\dots,\xi_{n} in the universe of II,

fIfp(ξ1,,ξn)=1I if pI(ξ1,,ξn)=truefIfp(ξ1,,ξn)=0I otherwise .\begin{array}[]{l}f^{I^{p}_{f}}(\xi_{1},\dots,\xi_{n})=1^{I}\text{ if }p^{I}(\xi_{1},\dots,\xi_{n})=\hbox{\sc true}\\ f^{I^{p}_{f}}(\xi_{1},\dots,\xi_{n})=0^{I}\text{ otherwise }.\end{array}

Furthermore, we assume that IfpI^{p}_{f} satisfies (14). Consequently, IfpI^{p}_{f} satisfies FCf\hbox{\it FC\/}_{f}.

Corollary 6

Let FF be a first-order sentence.

  • (a)

    An interpretation II of the signature of FF is a model of SM[F;p𝐜]\hbox{\rm SM}[F;p{\bf c}] iff IfpI^{p}_{f} is a model of SM[FfpDFfFCf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}].

  • (b)

    An interpretation JJ of the signature of FfpF^{p}_{f} is a model of SM[FfpDFfFCf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}] iff J=IfpJ=I^{p}_{f} for some model II of SM[F;p𝐜]\hbox{\rm SM}[F;p{\bf c}].

In Corollary 6 (b), it is clear by the construction of IfpI^{p}_{f} that, for each JJ, there is exactly one II that satisfies the statement.

Repeated applications of Corollary 6 allow us to completely eliminate intensional predicate constants in favor of intensional function constants, thereby turning formulas under the stable model semantics from [Ferraris et al., 2011] into formulas under FSM whose intensional constants are function constants only.

Note that ¬¬\neg\neg in (15) cannot be dropped in general. The formula ¬¬F\neg\neg F is not strongly equivalent to FF. The former is a weaker assertion than the latter under the stable model semantics. Indeed, if it is dropped, in Corollary 6, when FF is \top, the empty set is the only model of SM[F;p]\hbox{\rm SM}[F;p] whereas SM[FfpDFfFCf;f]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f] has two models where ff is mapped to 0 or 11.

6 Eliminating Intensional Functions in favor of Intensional Predicates

We show how to eliminate intensional function constants in favor of intensional predicate constants. Unlike in the previous section, the result is established for “ff-plain” formulas only. It turns out that there is no elimination method for arbitrary formulas that is both modular and signature-preserving.

6.1 Eliminating Intensional Functions from 𝐜{\bf{c}}-Plain Formulas in favor of Intensional Predicates

Let ff be a function constant. A first-order formula is called ff-plain [Lifschitz and Yang, 2011] if each atomic formula in it

  • does not contain ff, or

  • is of the form f(𝐭)=t1f({\bf t})=t_{1} where 𝐭{\bf t} is a tuple of terms not containing ff, and t1t_{1} is a term not containing ff.

For example, f=1f\!=\!1 is ff-plain, but each of p(f)p(f), g(f)=1g(f)=1, and 1=f1\!=\!f is not ff-plain.

For any list 𝐜{\bf{c}} of predicate and function constants, we say that FF is 𝐜{\bf{c}}-plain if FF is ff-plain for each function constant ff in 𝐜{\bf{c}}.

Let FF be an ff-plain formula, where ff is an intensional function constant. Formula FpfF^{f}_{p} is obtained from FF as follows:

  • in the signature of FF, replace ff with a new intensional predicate constant pp of arity n+1n+1, where nn is the arity of ff;

  • replace each subformula f(𝐭)=t1f({\bf t})=t_{1} in FF with p(𝐭,t1)p({\bf t},t_{1}).

The following theorem asserts the correctness of the elimination.

Theorem 7

For any ff-plain formula FF, the set of formulas

{𝐱y(p(𝐱,y)f(𝐱)=y),xy(xy)}\{\forall{\bf x}y(p({\bf x},y)\leftrightarrow f({\bf x})=y),\ \ \exists xy(x\neq y)\}

entails

SM[F;f𝐜]SM[Fpf;p𝐜].\hbox{\rm SM}[F;f{\bf c}]\leftrightarrow\hbox{\rm SM}[F^{f}_{p};p{\bf c}].

The theorem tells us how to eliminate an intensional function constant ff from an ff-plain formula in favor of an intensional predicate constant. By UECp\hbox{\it UEC\/}_{p} we denote the following formulas that enforce the “functional image” on the predicate pp,

𝐱yz(p(𝐱,y)p(𝐱,z)yz),¬¬𝐱yp(𝐱,y),\begin{array}[]{c}\forall{\bf x}yz(p({\bf x},y)\land p({\bf x},z)\land y\neq z\rightarrow\bot),\\ \neg\neg\forall{\bf x}\exists y\,p({\bf x},y),\end{array} (17)

where 𝐱{\bf x} is an nn-tuple of variables, and all variables in 𝐱{\bf x}, yy, and zz are pairwise distinct. Note that each formula is negative on any list of constants, so they work as constraints (Section 4.1) to eliminate the stable models that violate them.

Example 4

Consider the same formula FF in Example 3. We eliminate the function constant Loc in favor of the intensional predicate constant Locp\hbox{\it Loc\/}_{p} to obtain FLocpLocUECLocpF_{\textit{Loc}_{p}}^{\textit{Loc}}\land\hbox{\it UEC\/}_{\textit{Loc}_{p}}, which is the conjunction of the universal closures of the following formulas:

Locp(b,t,l){Locp(b,t+1,l)}ch,Move(b,l,t)Locp(b,t+1,l),Locp(b,t,l)Locp(b,t,l)ll,¬¬btl(Locp(b,t,l)).\begin{array}[]{c}\hbox{\it Loc\/}_{p}(b,t,l)\rightarrow\{\hbox{\it Loc\/}_{p}(b,t\!+\!1,l)\}^{\rm ch},\\ \hbox{\it Move\/}(b,l,t)\rightarrow\hbox{\it Loc\/}_{p}(b,t\!+\!1,l),\\ \hbox{\it Loc\/}_{p}(b,t,l)\land\hbox{\it Loc\/}_{p}(b,t,l^{\prime})\land l\neq l^{\prime}\rightarrow\bot,\\ \neg\neg\forall b\,t\,\exists l(\hbox{\it Loc\/}_{p}(b,t,l)).\end{array} (18)

The following corollary shows that there is a simple 1–1 correspondence between the stable models of FF and the stable models of FpfUECpF^{f}_{p}\land\hbox{\it UEC\/}_{p}. Recall that the signature of FpfF^{f}_{p} is obtained from the signature of FF by replacing ff with pp. For any interpretation II of the signature of FF, by IpfI^{f}_{p} we denote the interpretation of the signature of FpfF^{f}_{p} obtained from II by replacing the function fIf^{I} with the predicate pIp^{I} that consists of the tuples

ξ1,,ξn,fI(ξ1,,ξn)\langle\xi_{1},\dots,\xi_{n},f^{I}(\xi_{1},\dots,\xi_{n})\rangle

for all ξ1,,ξn\xi_{1},\dots,\xi_{n} from the universe of II.

Corollary 8

Let FF be an ff-plain sentence.

  • (a)

    An interpretation II of the signature of FF that satisfies xy(xy)\exists xy(x\neq y) is a model of SM[F;f𝐜]\hbox{\rm SM}[F;f{\bf c}] iff IpfI^{f}_{p} is a model of SM[FpfUECp;p𝐜]\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};\ p{\bf c}].

  • (b)

    An interpretation JJ of the signature of FpfF^{f}_{p} that satisfies xy(xy)\exists xy(x\neq y) is a model of SM[FpfUECp;p𝐜]\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};\ p{\bf c}] iff J=IpfJ=I^{f}_{p} for some model II of SM[F;f𝐜]\hbox{\rm SM}[F;f{\bf c}].

In Corollary 8 (b), it is clear by the construction of IpfI^{f}_{p} that, for each JJ, there is exactly one II that satisfies the statement.

Theorem 7 and Corollary 8 are similar to Theorem 3 and Corollary 5 from [Lifschitz and Yang, 2011], which are about eliminating “explainable” functions in nonmonotonic causal logic in favor of “explainable” predicates.

Similar to Theorem 4, the condition xy(xy)\exists xy(x\neq y) is necessary in Theorem 7 and Corollary 8 because in order to dispute the stability of a model II in the presence of intensional function constants, one needs another interpretation that is different from II on intensional function constants. Such an interpretation simply does not exist if the condition is missing, so II becomes trivially stable. For example, consider the formula \top with signature σ={f}\sigma=\{f\} and the universe {1}\{1\}. There is only one interpretation, which maps ff to 11. This is a stable model of \top. On the other hand, the formula UECp\top\land\hbox{\it UEC\/}_{p}, which is ¬¬yp(y)\top\land\neg\neg\exists y\,p(y), has no stable models.

The method above eliminates only one intensional function constant at a time, but repeated applications can eliminate all intensional function constants from a given 𝐜{\bf{c}}-plain formula in favor of intensional predicate constants. In other words, it tells us that the stable model semantics for 𝐜{\bf{c}}-plain formulas can be reduced to the stable model semantics from [Ferraris et al., 2011] by adding uniqueness and existence of value constraints.

The elimination method described in Corollary 8 has shown to be useful in a special class of FSM, known as multi-valued propositional formulas [Giunchiglia et al., 2004].999We discuss the relationship in Section 8.2. In [Lee et al., 2013], the method allows us to relate the two different translations of action language C{\mathcal{B}C} into multi-valued propositional formulas and into the usual ASP programs. Also, it led to the design of mvsm,101010http://reasoning.eas.asu.edu/mvsm/ which computes stable models of multi-valued propositional formulas using f2lp and clingo, and the design of cplus2asp [Babb and Lee, 2013],111111http://reasoning.eas.asu.edu/cplus2asp/ which computes action languages using ASP solvers.

Interestingly, the elimination method results in a new way of formalizing the commonsense law of inertia using choice rules instead of using strong negation, e.g., (1). The formulas (18) can be more succinctly represented in the language of ASP as follows.

{Locp(b,t+1,l)}chLocp(b,t,l)Locp(b,t+1,l)Move(b,l,t)not 1{Locp(b,t,l):Location(l)}1,Block(b),Time(t)\begin{array}[]{l}\{\hbox{\it Loc\/}_{p}(b,t\!+\!1,l)\}^{\rm ch}\leftarrow\hbox{\it Loc\/}_{p}(b,t,l)\\ \hbox{\it Loc\/}_{p}(b,t\!+\!1,l)\leftarrow\hbox{\it Move\/}(b,l,t)\\ \leftarrow\hbox{\it not\/}\ 1\{\hbox{\it Loc\/}_{p}(b,t,l):\hbox{\it Location\/}(l)\}1,\hbox{\it Block\/}(b),\hbox{\it Time\/}(t)\end{array}

where Location, Block, and Time are domain predicates. The first rule says that if the location of bb at time tt is ll, then decide arbitrarily whether to assert Locp(b,t+1,l)\hbox{\it Loc\/}_{p}(b,t\!+\!1,l) at time t+1t+1. In the absence of additional information about the location of bb at time t+1t+1, asserting Locp(b,t+1,l)\hbox{\it Loc\/}_{p}(b,t\!+\!1,l) will be the only option, as the third rule requires one of the location ll to be associated with the block bb at time t+1t+1. But if we are given conflicting information about the location at time t+1t+1 due to the Move action, then not asserting Locp(b,t+1,l)\hbox{\it Loc\/}_{p}(b,t\!+\!1,l) will be the only option, and the second rule will tell us the new location of bb at time t+1t+1.

6.2 Non-𝐜{\bf{c}}-plain formulas vs. 𝐜{\bf{c}}-plain formulas

One may wonder if the method of eliminating intensional function constants in the previous section can be extended to non-𝐜{\bf{c}}-plain formulas, possibly by first rewriting the formulas into 𝐜{\bf{c}}-plain formulas. In classical logic, this is easily done by “unfolding” nested functions by introducing existential quantifiers, but this is not the case under the stable model semantics because nested functions in general express weaker assertions than unfolded ones.

Example 5

Consider FF to be a+b=5a+b=5, where aa and bb are object constants. The formula FF is equivalent to xy(a=xb=yx+y=5)\exists xy(a\!=\!x\ \land\ b\!=\!y\ \land\ x+y\!=\!5) under classical logic, but this is not the case under FSM. The former has no stable models, and the latter has many stable models, including II such that aI=1,bI=4a^{I}=1,b^{I}=4.

Gelfond and Kahl [?] describe the intuitive meaning of stable models in terms of rationality principle: “believe nothing you are not forced to believe.” In the example above, it is natural to understand that a+b=5a+b=5 does not force one to believe a=1a=1 and b=4b=4.

The weaker assertion expressed by function nesting is useful for specifying the range of a function using a domain predicate, or expressing the concept of synonymity between the two functions without forcing the functions to have specific values.

Example 6

Consider FF to be Dom(a)\hbox{\it Dom\/}(a) where Dom is a predicate constant and aa is an object constant. The formula FF can be viewed as applying the sort predicate (i.e., domain predicate) Dom to specify the value range of aa, but it does not force one to believe that aa has a particular value. In classical logic, FF is equivalent to x(Dom(x)x=a)\exists x(\hbox{\it Dom\/}(x)\land x=a), but their stable models are different. The former has no stable models, and the latter has many stable models, including II such that DomI={1,2,3}\hbox{\it Dom\/}^{I}=\{1,2,3\} and aI=1a^{I}=1.

Example 7

A “synonymity” rule [Lifschitz and Yang, 2011] has the form

Bf1(𝐭1)=f2(𝐭2),B\ \rightarrow\ f_{1}({\bf t}_{1})=f_{2}({\bf t}_{2}), (19)

where f1f_{1}, f2f_{2} are intensional function constants in 𝐟{\bf{f}}, and 𝐭1{\bf t}_{1}, 𝐭2{\bf t}_{2} are tuples of terms not containing members of 𝐟{\bf{f}}. This rule expresses that we believe f1(𝐭1)f_{1}({\bf t}_{1}) to be “synonymous” to f2(𝐭2)f_{2}({\bf t}_{2}) under condition BB, but it does not force one to assign particular values to f1(𝐭𝟏)f_{1}({\bf t_{1}}) and f2(𝐭𝟐)f_{2}({\bf t_{2}}). As a special case, consider f1=f2f_{1}=f_{2} vs. x(f1=xf2=x)\exists x(f_{1}=x\land f_{2}=x). The latter forces one to assign some values to f1f_{1} and f2f_{2}, and does not express the intended weaker assertion that they are synonymous.

To sum up, in Examples 5, 6, and 7, the classically equivalent transformations do not preserve strong equivalence. They affect the beliefs, forcing one to believe more than what the original formulas assert.

On the other hand, there is some special class of formulas for which the process of “unfolding” preserves stable models. We first define precisely the process.

Definition 1

The process of unfolding FF w.r.t. a list 𝐜{\bf{c}} of constants, denoted by UF𝐜(F)\hbox{\it UF\/}_{\bf{c}}(F), is recursively defined as follows.

  • If FF is an atomic formula that is 𝐜{\bf{c}}-plain, UF𝐜(F)\hbox{\it UF\/}_{\bf{c}}(F) is FF;

  • If FF is an atomic formula of the form p(t1,,tn)p(t_{1},\dots,t_{n}) (n0n\geq 0) such that tk1,,tkjt_{k_{1}},\dots,t_{k_{j}} are all the terms in t1,,tnt_{1},\dots,t_{n} that contain some members of 𝐜{\bf{c}}, then UF𝐜(p(t1,,tn))\hbox{\it UF\/}_{\bf{c}}(p(t_{1},\dots,t_{n})) is

    x1xj(p(t1,,tn)′′1ijUF𝐜(tki=xi)),\exists x_{1}\dots x_{j}\Big{(}p(t_{1},\dots,t_{n})^{\prime\prime}\land\bigwedge_{1\leq i\leq j}\hbox{\it UF\/}_{\bf{c}}(t_{k_{i}}=x_{i})\Big{)},

    where p(t1,,tn)′′p(t_{1},\dots,t_{n})^{\prime\prime} is obtained from p(t1,,tn)p(t_{1},\dots,t_{n}) by replacing each tkit_{k_{i}} with a new variable xix_{i}.

  • If FF is an atomic formula of the form f(t1,,tn)=t0f(t_{1},\dots,t_{n})=t_{0} (n0n\geq 0) such that tk1,,tkjt_{k_{1}},\dots,t_{k_{j}} are all the terms in t0,,tnt_{0},\dots,t_{n} that contain some members of 𝐜{\bf{c}}, then UF𝐜(f(t1,,tn)=t0)\hbox{\it UF\/}_{\bf{c}}(f(t_{1},\dots,t_{n})=t_{0}) is

    x1xj((f(t1,,tn)=t0)′′1ijUF𝐜(tki=xi)),\exists x_{1}\dots x_{j}\Big{(}(f(t_{1},\dots,t_{n})=t_{0})^{\prime\prime}\land\bigwedge_{1\leq i\leq j}\hbox{\it UF\/}_{\bf{c}}(t_{k_{i}}=x_{i})\Big{)},

    where (f(t1,,tn)=t0)′′(f(t_{1},\dots,t_{n})=t_{0})^{\prime\prime} is obtained from f(t1,,tn)=t0f(t_{1},\dots,t_{n})=t_{0} by replacing each tkit_{k_{i}} with a new variable xix_{i}.

  • UF𝐜(FG)\hbox{\it UF\/}_{\bf{c}}(F\odot G) is UF𝐜(F)UF𝐜(G)\hbox{\it UF\/}_{\bf{c}}(F)\odot\hbox{\it UF\/}_{\bf{c}}(G), where {,,}\odot\in\{\land,\lor,\rightarrow\}.

  • UF𝐜(QxF)\hbox{\it UF\/}_{\bf{c}}(QxF) is QxUF𝐜(F(x))Qx\ \hbox{\it UF\/}_{\bf{c}}(F(x)), where Q{,}Q\in\{\forall,\exists\}.

In Example 6, UFDom(F)\hbox{\it UF\/}_{Dom}(F) is x(Dom(x)a=x)\exists x(\hbox{\it Dom\/}(x)\land a=x), and in Example 5, UF(a,b)(F)\hbox{\it UF\/}_{(a,b)}(F) is xy(a=xb=yx+y=5)\exists xy(a=x\land b=y\land x+y=5). In Example 7, UF(f1,f2)(f1=f2)\hbox{\it UF\/}_{(f_{1},f_{2})}(f_{1}=f_{2}) is x(f1=xf2=x)\exists x(f_{1}=x\land f_{2}=x). We already observed that the process of unfolding does not preserve the stable models of the formulas.

Theorem 9 below presents a special class of formulas, for which the process of unfolding does preserve stable models, or in other words, unfolding does not affect the beliefs.

Definition 2

We say that a formula is head-𝐜{\bf{c}}-plain if every strictly positively occurrence of an atomic formula in it is 𝐜{\bf{c}}-plain.

For instance, f(g)=1h=1f(g)\!=\!1\rightarrow h\!=\!1 is head-(f,g,h)(f,g,h)-plain, though it is not (f,g,h)(f,g,h)-plain.

Theorem 9

For any head-𝐜{\bf{c}}-plain sentence FF that is tight on 𝐜{\bf{c}} and any interpretation II satisfying xy(xy)\exists xy(x\neq y), we have ISM[F;𝐜]I\models\hbox{\rm SM}[F;{\bf{c}}] iff ISM[UF𝐜(F);𝐜]I\models\hbox{\rm SM}[\hbox{\it UF\/}_{\bf{c}}(F);{\bf{c}}].

One may wonder if there is any other translation that would work to unfold nested functions. However, it turns out that there is no modular, signature-preserving translation from arbitrary formulas to 𝐜{\bf{c}}-plain formulas while preserving stable models.

Theorem 10

For any set 𝐜{\bf{c}} of constants, there is no strongly equivalent transformation that turns an arbitrary formula into a 𝐜{\bf{c}}-plain formula.

The proof follows from the following lemma.

Lemma 3

There is no f{f}-plain formula that is strongly equivalent to p(f)p(1)p(2)¬p(3)p(f)\land p(1)\land p(2)\land\neg p(3).

Theorem 10 tells us that the set of arbitrary formulas is strictly more expressive than the set of 𝐜{\bf{c}}-plain formulas of the same signature. One application of this greater expressivity is in reducing many-sorted FSM to unsorted FSM in Section 8.1 later.

7 Comparing FSM with Other Approaches to Intensional Functions

7.1 Relation to Nonmonotonic Causal Logic

A (nonmonotonic) causal theory is a finite list of rules of the form

FGF\mbox{\large\boldmath$\;\Leftarrow\;$}G

where FF and GG are formulas as in first-order logic. We identify a rule with the universal closure of the implication GFG\rightarrow F. A causal model of a causal theory TT is defined as the models of the second-order sentence

CM[T;𝐟]=T¬𝐟^(𝐟^𝐟T(𝐟^))\hbox{\rm CM}[T;{\bf{f}}]=T\land\neg\exists\widehat{{\bf{f}}}(\widehat{{\bf{f}}}\neq{\bf{f}}\land T^{\dagger}(\widehat{{\bf{f}}}))

where 𝐟{\bf{f}} is a list of explainable function constants, and T(𝐟^)T^{\dagger}(\widehat{{\bf{f}}}) denotes the conjunction of the formulas 121212~F\widetilde{\forall}F represents the universal closure of FF.

~(GF(𝐟^))\widetilde{\forall}(G\rightarrow F(\widehat{{\bf{f}}})) (20)

for all rules FGF\mbox{\large\boldmath$\;\Leftarrow\;$}G of TT. By a definite causal theory, we mean the causal theory whose rules have the form either

f(𝐭)=t1Bf({\bf t})=t_{1}\mbox{\large\boldmath$\;\Leftarrow\;$}B (21)

or

B,\bot\mbox{\large\boldmath$\;\Leftarrow\;$}B, (22)

where ff is an explainable function constant, 𝐭{\bf t} is a list of terms that does not contain explainable function constants, and t1t_{1} is a term that does not contain explainable function constants. By Tr(T)\hbox{\it Tr\/}(T) we denote the theory consisting of the following formulas:

~(¬¬Bf(𝐭)=t1)\widetilde{\forall}(\neg\neg B\rightarrow f({\bf t})=t_{1})

for each rule (21) in TT, and

~¬B\widetilde{\forall}\neg B

for each rule (22) in TT. The causal models of such TT coincide with the stable models of Tr(T)\hbox{\it Tr\/}(T).

Theorem 11

For any definite causal theory TT, ICM[T;𝐟]I\models\hbox{\rm CM}[T;{\bf{f}}] iff ISM[Tr(T);𝐟]I\models\hbox{\rm SM}[\hbox{\it Tr\/}(T);{\bf{f}}].

For non-definite theories, they do not coincide as shown by the following example.

Example 8

Consider the following non-definite causal theory TT:

¬(f=1)¬(f=2)\begin{array}[]{l}\neg(f=1)\mbox{\large\boldmath$\;\Leftarrow\;$}\top\\ \neg(f=2)\mbox{\large\boldmath$\;\Leftarrow\;$}\top\end{array}

An interpretation II where |I|={1,2,3}|I|=\{1,2,3\}, and fI=3f^{I}=3 is a causal model of TT. However, the corresponding formula Tr(T)\hbox{\it Tr\/}(T) is equivalent to

¬(f=1)¬(f=2),\neg(f=1)\land\neg(f=2),

which has no stable models.

The following example, a variant of Lin’s suitcase example [Lin, 1995], demonstrates some unintuitive behavior of definite causal theories in representing indirect effects of actions, which is not present in the functional stable model semantics.

Example 9

Consider the two switches which can be flipped but cannot be both up or down at the same time. If one of them is down and the other is up, the direct effect of flipping only one switch is changing the status of that switch, and the indirect effect is changing the status of the other switch. Let Up(s,t)\hbox{\it Up\/}(s,t), where ss is switch AA or BB, and tt is a time stamp 0 or 11, be object constants whose values are Boolean, let Flip(s)\hbox{\it Flip\/}(s), where ss is switch AA or BB, be function constants whose values are Boolean, and let x,yx,y be variables ranging over Boolean values. The domain can be formalized in a causal theory as

Up(s,1)=xUp(s,0)=yFlip(s)=true(xy)Up(s,1)=xUp(s,1)=y(ss,xy)Up(s,1)=xUp(s,1)=xUp(s,0)=xFlip(s)=xFlip(s)=xUp(A,0)=falseUp(B,0)=true\begin{array}[]{rclr}\hbox{\it Up\/}(s,1)\!=\!x&\mbox{\large\boldmath$\;\Leftarrow\;$}&\hbox{\it Up\/}(s,0)\!=\!y\land\hbox{\it Flip\/}(s)\!=\!\hbox{\sc true}&(x\neq y)\\ \hbox{\it Up\/}(s,1)\!=\!x&\mbox{\large\boldmath$\;\Leftarrow\;$}&\hbox{\it Up\/}(s^{\prime},1)\!=\!y&(s\neq s^{\prime},x\neq y)\\ \hbox{\it Up\/}(s,1)\!=\!x&\mbox{\large\boldmath$\;\Leftarrow\;$}&\hbox{\it Up\/}(s,1)\!=\!x\land\hbox{\it Up\/}(s,0)\!=\!x\\ \hbox{\it Flip\/}(s)\!=\!x&\mbox{\large\boldmath$\;\Leftarrow\;$}&\hbox{\it Flip\/}(s)\!=\!x\\ \hbox{\it Up\/}(A,0)\!=\!\hbox{\sc false}&\mbox{\large\boldmath$\;\Leftarrow\;$}&\top\\ \hbox{\it Up\/}(B,0)\!=\!\hbox{\sc true}&\mbox{\large\boldmath$\;\Leftarrow\;$}&\top\end{array}

There are five causal models as shown in the following table.

Up(A,0) Up(B,0) Flip(A) Flip(B) Up(A,1) Up(B,1)
I1I_{1} false true false false false true
I2I_{2} false true false true true false
I3I_{3} false true true false true false
I4I_{4} false true true true true false
I5I_{5} false true false false true false

I2I_{2} and I3I_{3} exhibit the indirect effect of the action Flip. Only I5I_{5} is not intuitive because the fluent Up changes its value for no reason.

In the functional stable model semantics, the domain can be represented as

Up(s,1)=xUp(s,0)=yFlip(s)=true(xy)Up(s,1)=xUp(s,1)=y(ss,xy){Up(s,1)=x}chUp(s,0)=x{Flip(s)=x}chUp(A,0)=falseUp(B,0)=true\begin{array}[]{rclr}\hbox{\it Up\/}(s,1)\!=\!x&\ \leftarrow&\hbox{\it Up\/}(s,0)\!=\!y\land\hbox{\it Flip\/}(s)\!=\!\hbox{\sc true}&(x\neq y)\\ \hbox{\it Up\/}(s,1)\!=\!x&\leftarrow&\hbox{\it Up\/}(s^{\prime},1)\!=\!y&(s\neq s^{\prime},x\neq y)\\ \{\hbox{\it Up\/}(s,1)\!=\!x\}^{\rm ch}&\leftarrow&\hbox{\it Up\/}(s,0)\!=\!x\\ \{Flip(s)\!=\!x\}^{\rm ch}&\leftarrow&\top\\ \hbox{\it Up\/}(A,0)\!=\!\hbox{\sc false}&\leftarrow&\top\\ \hbox{\it Up\/}(B,0)\!=\!\hbox{\sc true}&\leftarrow&\top\end{array}

The program has four stable models I1,I2,I3,I4I_{1},I_{2},I_{3},I_{4}; The unintuitive causal model I5I_{5} is not its stable model.

7.2 Relation to Cabalar Semantics

As mentioned earlier, the stable model semantics by Cabalar [?] is defined in terms of partial satisfaction, which deviates from classical satisfaction. ? [?] show its relationship to FSM. There, it is shown that when we consider stable models to be total interpretations only, both semantics coincide on 𝐜{\bf{c}}-plain formulas. Also, FF and UF𝐜(F)\hbox{\it UF\/}_{\bf c}(F) have the same stable models under the Cabalar semantics, so any complex formula under the Cabalar semantics can be reduced to a 𝐜{\bf c}-plain formula by preserving stable models. Furthermore, partial stable models under the Cabalar semantics can be embedded into FSM by introducing an auxiliary object constant none to denote that the function is undefined. Consequently, the Cabalar semantics can be fully embedded into FSM by unfolding using an auxiliary constant. We refer the reader to [Bartholomew and Lee, 2013c, Section 4] for the details.

On the other hand, Theorem 10 of this paper shows that the reverse direction is not possible because the class of 𝐜{\bf c}-plain formulas is a restricted subset in the functional stable model semantics, which is not the case with the Cabalar semantics. In other words, non-𝐜{\bf c}-plain formulas are weaker than 𝐜{\bf c}-plain formulas under FSM whereas the Cabalar semantics does not distinguish them. For instance, under the Cabalar semantics, the formula a+b=5a+b=5 in Example 5 has many stable models II as long as aI+bI=5a^{I}+b^{I}=5; in Example 6, Dom(a)\hbox{\it Dom\/}(a) has many stable models rather than simply restricting the value of aa to the extent of Dom; in Example 7, f1=f2f_{1}=f_{2} has stable models as long as the functions are assigned the same values instead of merely stating that the functions are synonymous.

We observe that the weaker assertions by non-𝐜{\bf c}-plain formulas are often useful but they are not allowed in the Cabalar semantics. In particular, the use of “sort predicates” as in Example 6 is important in specifying the range of an intensional function, rather than a particular value. 131313 In Section 8.1 below, we formally show how to reduce many-sorted FSM into unsorted FSM and notes that the axioms used there is not expressible in the Cabalar semantics. The synonymity rule like Example 7 is useful for the design of modular action languages as described in [Lifschitz and Yang, 2011].

7.3 Relation to IF-Programs

The functional stable model semantics presented here is inspired by IF-programs from [Lifschitz, 2012], where intensional functions were defined without requiring the complex notion of partial functions and partial satisfaction but instead by imposing the uniqueness of values on total functions. It turns out that neither semantics is stronger than the other while they coincide on a certain syntactically restricted class of programs. However, the semantics of IF-programs exhibits an unintuitive behavior.

7.3.1 Review of IF-Programs

We consider rules of the form

HB,H\leftarrow B, (23)

where HH and BB are formulas that do not contain \rightarrow. As before, we identify a rule with the universal closure of the implication BHB\rightarrow H. An IF-program is a finite conjunction of those rules.

An occurrence of a symbol in a formula is negated if it belongs to a subformula that begins with negation, and is non-negated otherwise. Let FF be a formula, let 𝐟{\bf f} be a list of distinct function constants, and let 𝐟^{\bf\widehat{f}} be a list of distinct function variables similar to 𝐟{\bf f}. By F(𝐟^)F^{\diamond}(\widehat{{\bf{f}}}) we denote the formula obtained from FF by replacing each non-negated occurrence of a member of 𝐟{\bf f} with the corresponding function variable in 𝐟^\widehat{{\bf f}}. By IF[F;𝐟]\hbox{\rm IF}[F;{\bf{f}}] we denote the second-order sentence

F¬𝐟^(𝐟^𝐟F(𝐟^)).F\land\neg\exists\widehat{{\bf{f}}}(\widehat{{\bf{f}}}\neq{\bf{f}}\land F^{\diamond}(\widehat{{\bf{f}}})).

According to [Lifschitz, 2012], the 𝐟{\bf{f}}-stable models of an IF-program Π\Pi are defined as the models of IF[F;𝐟]\hbox{\rm IF}[F;{\bf{f}}], where FF is the FOL-representation of Π\Pi.

7.3.2 Comparison

The definition of the IF operator above looks close to our definition of the SM operator. However, they often behave quite differently.

Example 10

Let FF be the following program

d=2c=1,d=1\begin{array}[]{l}d=2\leftarrow c=1,\\ d=1\end{array}

and let II be an interpretation such that |I|={1,2}|I|=\{1,2\}, cI=2c^{I}=2 and dI=1d^{I}=1. II is a model of IF[F;cd]\hbox{\rm IF}[F;cd], but not a model of SM[F;cd]\hbox{\rm SM}[F;cd]. The former is not intuitive from the rationality principle because cc does not even appear in the head of a rule.

Example 11

Let FF be the following program

(c=1d=1)(c=2d=2)(c=1\lor d=1)\land(c=2\lor d=2)

and let I1I_{1} and I2I_{2} be interpretations such that |I1|=|I2|={1,2,3}|I_{1}|=|I_{2}|=\{1,2,3\} and I1(c)=1I_{1}(c)=1, I1(d)=2I_{1}(d)=2, I2(c)=2I_{2}(c)=2, I2(d)=1I_{2}(d)=1. The interpretations I1I_{1} and I2I_{2} are models of SM[F;cd]\hbox{\rm SM}[F;cd]. On the other hand, IF[F;cd]\hbox{\rm IF}[F;cd] has no models.

Example 12

Let F1F_{1} be ¬(c=1)\neg(c\!=\!1)\leftarrow\top and let F2F_{2} be c=1\bot\leftarrow c\!=\!1. Under the functional stable model semantics, they are strongly equivalent to each other, and neither of them has a stable model. However, this is not the case with IF-programs. For instance, let II be an interpretation such that |I|={1,2}|I|=\{1,2\} and I(c)=2I(c)=2. II satisfies IF[F2;c]\hbox{\rm IF}[F_{2};c] but not IF[F1;c]\hbox{\rm IF}[F_{1};c].

While F\bot\leftarrow F is a constraint in our formalism, in view of Theorem 1, the last example illustrates that F\bot\leftarrow F is not considered a constraint in the semantics of IF-programs. This behavior deviates from the standard stable model semantics. Unlike the functional stable model semantics, in general, it is not obvious how various mathematical results established for the first-order stable model semantics, such as the theorem on strong equivalence [Lifschitz et al., 2001], the theorem on completion [Ferraris et al., 2011], and the splitting theorem [Ferraris et al., 2009], can be extended to the above formalisms on intensional functions.

The following theorem gives a specific form of formulas on which the two semantics agree.

Theorem 12

Let TT be an IF-program whose rules have the form

f(𝐭)=t1¬¬Bf({\bf t})=t_{1}\leftarrow\neg\neg B (24)

where ff is an intensional function constant, 𝐭{\bf t} and t1t_{1} do not contain intensional function constants, and BB is an arbitrary formula. We identify TT with the corresponding first-order formula. Then we have ISM[T;𝐟]I\models\hbox{\rm SM}[T;{\bf{f}}] iff IIF[T;𝐟]I\models\hbox{\rm IF}[T;{\bf{f}}].

8 Many-Sorted FSM

The following is the standard definition of many-sorted first-order logic. A signature σ\sigma is comprised of a set of function and predicate constants and a set of sorts. To every function and predicate constant of arity nn, we assign argument sorts s1,,sns_{1},\dots,s_{n} and to every function constant of arity nn, we assign also its value sort sn+1s_{n+1}. We assume that there are infinitely many variables for each sort. Atomic formulas are built similar to the standard unsorted logic with the restriction that in a term f(t1,,tn)f(t_{1},\dots,t_{n}) (an atom p(t1,,tn)p(t_{1},\dots,t_{n}), respectively), the sort of tit_{i} must be a subsort of the ii-th argument of ff (pp, respectively). In addition t1=t2t_{1}=t_{2} is an atomic formula if the sorts and t1t_{1} and t2t_{2} have a common supersort.

A many-sorted interpretation II has a non-empty universe |I|s|I|^{s} for each sort ss. When s1s_{1} is a subsort of s2s_{2}, an interpretation must satisfy |I|s1|I|s2|I|^{s_{1}}\subseteq|I|^{s_{2}}. The notion of satisfaction is similar to the unsorted case with the restriction that an interpretation maps a term to an element in its associated sort.

The definition of many-sorted FSM is a straightforward extension of unsorted FSM. For any list 𝐜{\bf c} of constants in σ\sigma, an interpretation II is a stable model of FF relative to 𝐜{\bf c} if II satisfies SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}], where SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] is syntactically the same as in Section 3 but formulas are understood as in many-sorted logic.

8.1 Reducing Many-sorted FSM to unsorted FSM

We can turn many-sorted FSM into unsorted FSM as follows. Given a many-sorted signature σ\sigma, we define the signature σns\sigma^{ns} to contain every function and predicate constant from σ\sigma. In addition, for each sort sσs\in\sigma, we add a unary predicate 𝚜{\tt s} to σns\sigma^{ns}.

Given a formula FF of many-sorted signature σ\sigma, we obtain the formula FnsF^{ns} of the unsorted signature σns\sigma^{ns} as follows.

We replace every formula xF(x)\exists xF(x), where xx is a variable of sort ss, with the formula

y(𝚜(y)F(y))\exists y({\tt s}(y)\land F(y))

where yy is an unsorted variable and 𝚜{\tt s} is a predicate constant in σns\sigma^{ns} corresponding to ss in σ\sigma. Similarly, we replace every xF(x)\forall x\ F(x), where xx is a variable of sort ss, with the formula

y(𝚜(y)F(y)).\forall y({\tt s}(y)\rightarrow F(y)).

By SFσSF_{\sigma} we denote the conjunction of

  • the formulas y(𝚜i(y)𝚜j(y))\forall y({\tt s}_{i}(y)\rightarrow{\tt s}_{j}(y)) for every two sorts sis_{i} and sjs_{j} in σ\sigma such that sis_{i} is a subsort of sjs_{j} (sisjs_{i}\neq s_{j}),

  • the formulas y𝚜(y)\exists y\ {\tt s}(y) for every sort ss in σ\sigma

  • the formulas

    y1yk(𝚊𝚛𝚐𝚜1(y1)𝚊𝚛𝚐𝚜k(yk)𝚟𝚊𝚕𝚜(f(y1,,yk)))\forall y_{1}\dots y_{k}({\tt args}_{1}(y_{1})\land\dots\land{\tt args}_{k}(y_{k})\rightarrow{\tt vals}(f(y_{1},\dots,y_{k})))

    for each function constant ff in σ\sigma, where the arity of ff is kk, and the ii-th argument sort of ff is argsiargs_{i} and the value sort of ff is valsvals.

  • the formulas

    y1yk+1(¬𝚊𝚛𝚐𝚜1(y1)¬𝚊𝚛𝚐𝚜k(yk){f(y1,,yk)=yk+1}ch)\forall y_{1}\dots y_{k+1}(\neg{\tt args}_{1}(y_{1})\lor\dots\lor\neg{\tt args}_{k}(y_{k})\rightarrow\{f(y_{1},\dots,y_{k})=y_{k+1}\}^{\rm ch})

    for each function constant ff in σ\sigma, where the arity of ff is kk and the ii-th argument sort of ff is argsiargs_{i}.

  • the formulas

    y1yk(¬𝚊𝚛𝚐𝚜1(y1)¬𝚊𝚛𝚐𝚜k(yk){p(y1,,yk)}ch)\forall y_{1}\dots y_{k}(\neg{\tt args}_{1}(y_{1})\lor\dots\lor\neg{\tt args}_{k}(y_{k})\rightarrow\{p(y_{1},\dots,y_{k})\}^{\rm ch})

    for each predicate constant pp in σ\sigma, where the arity of pp is kk, and the ii-th argument sort of pp is argsiargs_{i}.

Note that only the first three items are necessary for classical logic but we need to add the fourth and fifth items for the FSM semantics so that the witness JJ to dispute the stability of II can only disagree with II on the atomic formulas that actually correspond to atomic formulas in the many-sorted setting (which has arguments adhering to the argument sorts). Also note that the formulas in item 3 are not 𝐜{\bf c}-plain, which illustrates the usefulness of non-𝐜{\bf c}-plain formulas.

We map an interpretation II of a many-sorted signature σ\sigma to an interpretation InsI^{ns} of an unsorted signature σns\sigma^{ns} as follows. First, the universe |Ins||I^{ns}| of σns\sigma^{ns} is s is a sort in σ|I|s\bigcup\limits_{s\text{ is a sort in }\sigma}|I|^{s}. We specify that the sort predicates and sorts correspond by defining the extent of sort predicate 𝚜{\tt s} for every sort sσs\in\sigma as

𝚜Ins=|I|s.{\tt s}^{I^{ns}}=|I|^{s}.

For every function constant ff in σ\sigma and every tuple 𝝃{{\boldsymbol{\xi}}} comprised of elements from |Ins||I^{ns}|, we take

fIns(𝝃)={fI(𝝃) if each ξi|I|argsi where argsi is the i-th argument sort of f|Ins|0 otherwise f^{I^{ns}}({{\boldsymbol{\xi}}})=\left\{\begin{array}[]{lr}f^{I}({{\boldsymbol{\xi}}})&\text{ if each }\xi_{i}\in|I|^{args_{i}}\text{ where $args_{i}$ is the $i$-th argument sort of $f$}\\ |I^{ns}|_{0}&\text{ otherwise }\end{array}\right.

where |Ins|0|I^{ns}|_{0} is an arbitrarily chosen element in the universe |Ins||I^{ns}| (we use the same element for every situation this case holds).

For every predicate constant pp in σ\sigma and every 𝝃{{\boldsymbol{\xi}}}, we take

pIns(𝝃)={pI(𝝃) if each ξi|I|argsi where argsi is the i-th argument sort of pfalseotherwise. p^{I^{ns}}({{\boldsymbol{\xi}}})=\left\{\begin{array}[]{lr}p^{I}({{\boldsymbol{\xi}}})&\text{ if each }\xi_{i}\in|I|^{args_{i}}\text{ where $args_{i}$ is the $i$-th argument sort of $p$}\\ \hbox{\sc false}&\text{otherwise. }\end{array}\right.

Note that false was arbitrarily chosen.

The choice of InsI^{ns} mapping a function whose arguments are not of the intended sort to the value |Ins|0|I^{ns}|_{0} is arbitrary and so there are many unsorted interpretations that correspond to the many-sorted interpretation. To characterize this one-to-many relationship, we say two unsorted interpretations II and JJ are related with relation RR, denoted R(I,J)R(I,J), if for every predicate or function constant cc, we have cI(ξ1,,ξk)=cJ(ξ1,,ξk)c^{I}(\xi_{1},\dots,\xi_{k})=c^{J}(\xi_{1},\dots,\xi_{k}) whenever each ξiargsi\xi_{i}\in args_{i} where argsiargs_{i} is the ii-th argument sort of cc.

Theorem 13

Let FF be a formula of a many-sorted signature σ\sigma, and let 𝐜{\bf c} be a set of function and predicate constants.

  • (a)

    If an interpretation II of signature σ\sigma is a model of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}], then InsI^{ns} is a model of SM[FnsSFσ;𝐜]\hbox{\rm SM}[F^{ns}\land SF_{\sigma};{\bf c}].

  • (b)

    If an interpretation LL of signature σns\sigma^{ns} is a model of SM[FnsSFσ;𝐜]\hbox{\rm SM}[F^{ns}\land SF_{\sigma};{\bf c}] then there is some interpretation II of signature σ\sigma such that II is a model of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] and R(L,Ins)R(L,I^{ns}).

Example 13

Consider σ={s1,s2,f/1,1,2}\sigma=\{s_{1},s_{2},f/1,1,2\} where both the argument and the value sort of function constant ff are s1s_{1}. Take FF to be f(1)=1f(2)=2f(1)=1\land f(2)=2. The many-sorted interpretation II such that |I|s1={1,2}|I|^{s_{1}}=\{1,2\}, |I|s2={3,4}|I|^{s_{2}}=\{3,4\}, nI=fI(n)=nn^{I}=f^{I}(n)=n for n{1,2}n\in\{1,2\} is clearly a stable model of FF. However, if we drop the last two items of SFσSF_{\sigma}, formula FnsSFσF^{ns}\land SF_{\sigma} is

f(1)=1f(2)=2y𝚜1(y)y𝚜𝟸(y)y1(𝚜1(y1)𝚜1(f(y1)))\begin{array}[]{l}f(1)=1\land f(2)=2\ \land\\ \exists y\,{\tt s}_{1}(y)\land\exists y\,{\tt s_{2}}(y)\ \land\\ \forall y_{1}({\tt s}_{1}(y_{1})\rightarrow{\tt s}_{1}(f(y_{1})))\end{array}

and KK is an unsorted interpretation such that |K|={1,2,3,4}|K|=\{1,2,3,4\}, (𝚜1)K={1,2}({\tt s}_{1})^{K}=\{1,2\}, (𝚜2)K={3,4}({\tt s}_{2})^{K}=\{3,4\}, nK=nn^{K}=n for n{1,2,3,4}n\in\{1,2,3,4\}, fK(n)=nf^{K}(n)=n for n{1,2,3,4}n\in\{1,2,3,4\}, which is not a stable model of FnsF^{ns} since we can take JJ that is different from KK only on f(4)f(4), i.e., fJ(4)=3f^{J}(4)=3, to dispute the stability of KK.

8.2 Relation to Multi-Valued Propositional Formulas Under the Stable Model Semantics

Multi-valued propositional formulas [Giunchiglia et al., 2004] are an extension of the standard propositional formulas where atomic parts of a formula are equalities of the kind found in constraint satisfaction problems. Action languages such as 𝒞{\mathcal{C}}+ [Giunchiglia et al., 2004] and 𝒞\mathcal{BC} [Lee et al., 2013] are defined based on multi-valued propositional formulas. In particular, the latter two languages are defined as shorthand for multi-valued propositional formulas under the stable model semantics, which is a special case of the functional stable model semantics as we show in this section.

A multi-valued propositional signature is a set σ\sigma of symbols called multi-valued propositional constants (mvp-constants), along with a nonempty finite set Dom(c)\hbox{\it Dom\/}(c) of symbols, disjoint from σ\sigma, assigned to each mvp-constant cc. We call Dom(c)\hbox{\it Dom\/}(c) the domain of cc. A multi-valued propositional atom (mvp-atom) of a signature σ\sigma is an expression of the form c=v{c\!=\!v} (“the value of cc is vv”) where cσc\in\sigma and vDom(c)v\in\hbox{\it Dom\/}(c). A multi-valued propositional formula (mvp-formula) of σ\sigma is a propositional combination of mvp-atoms.

A multi-valued propositional interpretation (mvp-interpretation) of σ\sigma is a function that maps every element of σ\sigma to an element of its domain. An mvp-interpretation II satisfies an mvp-atom c=v{c\!=\!v} (symbolically, Ic=v{I\models c\!=\!v}) if I(c)=vI(c)=v. The satisfaction relation is extended from mvp-atoms to arbitrary mvp-formulas according to the usual truth tables for the propositional connectives.

The reduct FIF^{I} of an mvp-formula FF relative to an mvp-interpretation II is the mvp-formula obtained from FF by replacing each maximal subformula that is not satisfied by II with \bot. II is called a stable model of FF if II is the only mvp-interpretation satisfying FIF^{I}.

Multi-valued propositional formulas can be viewed as a special class of ground first-order formulas of many-sorted signatures. We identify a multi-valued propositional signature with a many-sorted signature that consists of mvp-constants and their values understood as object constants. Each mvp-constant cc is identified with an intensional object constant whose sort is Dom(c)\hbox{\it Dom\/}(c). Each value in Dom(c)\hbox{\it Dom\/}(c) is identified with a non-intensional object constant of the same sort Dom(c)\hbox{\it Dom\/}(c), except that if the same value vv belongs to multiple domains, the sort of vv is the union of the domains.141414This is because in many-sorted logic with ordered sorts, the equality is defined when both terms have the same common supersort. For instance, if Dom(c1)={1,2}\hbox{\it Dom\/}(c_{1})=\{1,2\} and Dom(c2)={2,3}\hbox{\it Dom\/}(c_{2})=\{2,3\}, then the sort of 22 is Dom(c1)Dom(c2)\hbox{\it Dom\/}(c_{1})\cup\hbox{\it Dom\/}(c_{2}), while the sort of 11 is Dom(c1)\hbox{\it Dom\/}(c_{1}) and the sort of 33 is Dom(c2)\hbox{\it Dom\/}(c_{2}). An mvp-atom c=vc\!=\!v is identified with an equality between an intensional object constant cc and a non-intensional object constant vv.

We identify an mvp-interpretation with the many-sorted interpretation in which each non-intensional object constant is mapped to itself, and is identified with an element in Dom(c)\hbox{\it Dom\/}(c) for some intensional object constant cc.

It is easy to check that an mvp-interpretation II is a stable model of FF in the sense of multi-valued propositional formulas iff II is a stable model of FF in the sense of the functional stable model semantics. Under this view, every mvp-formula is identified with a 𝐜{\bf{c}}-plain formula, where 𝐜{\bf{c}} is the set of all mvp-constants. The elimination of intensional functions in favor of intensional predicates in Section 6.1 essentially turns mvp-formulas into the usual propositional formulas.

9 Answer Set Programming Modulo Theories

Sections 5 and 6 show that intensional predicate constants and intensional function constants are interchangeable in many cases. On the other hand, this section shows that considering intensional functions has the computational advantage of making use of efficient computation methods available in the work on satisfiability modulo theories.

We define ASPMT as a special case of many-sorted FSM by restricting attention to interpretations that conform to the background theory.

9.1 ASPMT as a Special Case of the Functional Stable Model Semantics

Formally, an SMT instance is a formula in many-sorted first-order logic, where some designated function and predicate constants are constrained by some fixed background interpretation. SMT is the problem of determining whether such a formula has a model that expands the background interpretation [Barrett et al., 2009].

Let σ𝒯\sigma^{\mathcal{T}} be the many-sorted signature of the background theory 𝒯{\mathcal{T}}. An interpretation of σ𝒯\sigma^{\mathcal{T}} is called the background interpretation if it satisfies the background theory. For instance, in the theory of reals, we assume that σ𝒯\sigma^{\mathcal{T}} contains the set \mathcal{R} of symbols for all real numbers, the set of arithmetic functions over real numbers, and the set {<,>,,}\{<,>,\leq,\geq\} of binary predicates over real numbers. A background interpretation interprets these symbols in the standard way.

Let σ\sigma be a signature that contains σ𝒯\sigma^{\mathcal{T}}. An interpretation of σ\sigma is called a 𝒯{\mathcal{T}}-interpretation if it agrees with the fixed background interpretation of σ𝒯\sigma^{\mathcal{T}} on the symbols in σ𝒯\sigma^{\mathcal{T}}.

A 𝒯{\mathcal{T}}-interpretation is a 𝒯{\mathcal{T}}-model of FF if it satisfies FF.

For any list 𝐜{\bf c} of constants in σσ𝒯\sigma\setminus\sigma^{\mathcal{T}}, a 𝒯{\mathcal{T}}-interpretation II is a 𝒯{\mathcal{T}}-stable model of FF relative to 𝐜{\bf c} if II satisfies SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}].

9.2 Describing Actions in ASPMT

The following example demonstrates how ASPMT can be applied to solve an instance of planning problem with the continuous time that requires real number computation. The encoding extends the standard ASP representation for transition systems [Lifschitz and Turner, 1999].

Example 14

Consider the following running example from a Texas Action Group discussion posted by Vladimir Lifschitz.151515http://www.cs.utexas.edu/users/vl/tag/continuous_problem

A car is on a road of length LL. If the accelerator is activated, the car will speed up with constant acceleration A{\rm A} until the accelerator is released or the car reaches its maximum speed MS{\rm MS}, whichever comes first. If the brake is activated, the car will slow down with acceleration A-{\rm A} until the brake is released or the car stops, whichever comes first. Otherwise, the speed of the car remains constant. Give a formal representation of this domain, and write a program that uses your representation to generate a plan satisfying the following conditions: at duration 0, the car is at rest at one end of the road; at duration TT, it should be at rest at the other end.

This example can be represented in ASPMT as follows. Below ss ranges over time steps, bb is a Boolean variable, x,y,a,c,dx,y,a,c,d are variables over nonnegative reals, and A{\rm A} and MS{\rm MS} are some specific real numbers.

We represent that the actions Accel and Decel are exogenous and the duration of each time step is to be arbitrarily selected as

{Accel(s)=b}ch,{Decel(s)=b}ch,{Duration(s)=x}ch.\begin{array}[]{l}\{\hbox{\it Accel\/}(s)=b\}^{\rm ch},\\ \{\hbox{\it Decel\/}(s)=b\}^{\rm ch},\\ \{\hbox{\it Duration\/}(s)=x\}^{\rm ch}.\end{array}

Both Accel and Decel cannot be performed at the same time:

Accel(s)=trueDecel(s)=true.\begin{array}[]{l}\bot\leftarrow\hbox{\it Accel\/}(s)=\hbox{\sc true}\land\hbox{\it Decel\/}(s)=\hbox{\sc true}.\\ \end{array}

The effects of Accel and Decel on Speed are described as

Speed(s+1)=yAccel(s)=trueSpeed(s)=xDuration(s)=d(y=x+A×d),Speed(s+1)=yDecel(s)=trueSpeed(s)=xDuration(s)=d(y=xA×d).\begin{array}[]{rl}\hbox{\it Speed\/}(s+1)=y\leftarrow&\hbox{\it Accel\/}(s)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(s)\!=\!x\ \land\ \hbox{\it Duration\/}(s)\!=\!d\\ &\land\ (y=x+{\rm A}\times d),\\ \hbox{\it Speed\/}(s+1)=y\leftarrow&\hbox{\it Decel\/}(s)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(s)\!=\!x\ \land\ \hbox{\it Duration\/}(s)\!=\!d\\ &\land\ (y=x-{\rm A}\times d).\end{array}

The preconditions of Accel and Decel are described as

Accel(s)=trueSpeed(s)=xDuration(s)=d(y=x+A×d)(y>MS),Decel(s)=trueSpeed(s)=xDuration(s)=d(y=xA×d)(y<0).\begin{array}[]{rl}\bot\leftarrow&\hbox{\it Accel\/}(s)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(s)\!=\!x\ \land\ \hbox{\it Duration\/}(s)\!=\!d\\ &\land\ (y=x+{\rm A}\times d)\ \land\ (y>{\rm MS}),\\ \bot\leftarrow&\hbox{\it Decel\/}(s)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(s)\!=\!x\ \land\ \hbox{\it Duration\/}(s)\!=\!d\\ &\land\ (y=x-{\rm A}\times d)\ \land\ (y<0).\end{array}

Speed is inertial:

{Speed(s+1)=x}chSpeed(s)=x.\{\hbox{\it Speed\/}(s+1)=x\}^{\rm ch}\leftarrow\hbox{\it Speed\/}(s)=x.

Speed at any moment does not exceed the maximum speed MS:

Speed(s)>MS.\bot\leftarrow\hbox{\it Speed\/}(s)>{\rm MS}.

Location is defined in terms of Speed and Duration as

Location(s+1)=yLocation(s)=xSpeed(s)=aSpeed(s+1)=cDuration(s)=dy=x+((a+c)/2)×d.\begin{array}[]{rl}\hbox{\it Location\/}(s+1)=y\leftarrow&\hbox{\it Location\/}(s)=x\land\hbox{\it Speed\/}(s)=a\land\hbox{\it Speed\/}(s+1)=c\\ &\land\ \hbox{\it Duration\/}(s)\!=\!d\ \land\ y=x+((a+c)/2)\times d.\end{array}

Theorem 4 tells us that a tight ASPMT theory in Clark normal form can be turned into an SMT instance.

Example 14 Continued  Since the formalization above can be written in Clark Normal Form that is tight, its stable models coincide with the models of the completion formulas. For instance, to form the completion of Speed(1)\hbox{\it Speed\/}(1), consider the rules that have Speed(1)\hbox{\it Speed\/}(1) in the head:

Speed(1)=yAccel(0)=trueSpeed(0)=xDuration(0)=d(y=x+A×d)(yMS),Speed(1)=yDecel(0)=trueSpeed(0)=xDuration(0)=d(y=xA×d)(y0),Speed(1)=ySpeed(0)=y¬¬(Speed(1)=y)\begin{array}[]{rl}\hbox{\it Speed\/}(1)\!=\!y\ \leftarrow&\hbox{\it Accel\/}(0)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(0)\!=\!x\ \land\ \hbox{\it Duration\/}(0)\!=\!d\\ &\land\ (y=x+{\rm A}\times d)\land\ (y\leq{\rm MS}),\\ \hbox{\it Speed\/}(1)\!=\!y\ \leftarrow&\hbox{\it Decel\/}(0)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(0)\!=\!x\ \land\ \hbox{\it Duration\/}(0)\!=\!d\\ &\land\ (y=x-{\rm A}\times d)\land\ (y\geq 0),\\ \hbox{\it Speed\/}(1)\!=\!y\ \leftarrow&\hbox{\it Speed\/}(0)\!=\!y\ \land\ \neg\neg(\hbox{\it Speed\/}(1)\!=\!y)\end{array}

({c=v}chG\{c\!=\!v\}^{\rm ch}\leftarrow G is strongly equivalent to c=vG¬¬(c=v)c\!=\!v\leftarrow G\land\neg\neg(c\!=\!v)). The completion turns them into the following equivalence:

Speed(1)=yxd((Accel(0)=trueSpeed(0)=xDuration(0)=d(y=x+A×d)(yMS))(Decel(0)=trueSpeed(0)=xDuration(0)=d(y=xA×d)(y0))Speed(0)=y).\begin{array}[]{l}\hbox{\it Speed\/}(1)=y\ \leftrightarrow\\ ~~\exists xd(~~(\hbox{\it Accel\/}(0)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(0)\!=\!x\ \land\ \hbox{\it Duration\/}(0)\!=\!d\\ \hskip 207.7052pt\land\ (y=x+{\rm A}\times d)\land(y\leq{\rm MS}))\\ ~~~~~~~\lor(\hbox{\it Decel\/}(0)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(0)\!=\!x\ \land\ \hbox{\it Duration\/}(0)\!=\!d\\ \hskip 207.7052pt\land\ (y=x-{\rm A}\times d)\land(y\geq 0))\\ ~~~~~~~\lor\hbox{\it Speed\/}(0)=y~~).\end{array} (25)

It is worth noting that most action descriptions can be represented by tight ASPMT theories due to the associated time stamps. In [Lee and Meng, 2013], ASPMT was used as the basis of extending action language 𝒞\mathcal{C}+ [Giunchiglia et al., 2004] to represent the durative action model of PDDL 2.1 [Fox and Long, 2003] and the start-process-stop model of representing continuous changes in PDDL+ [Fox and Long, 2006]. In [Lee et al., 2017], language 𝒞{\mathcal{C}}+ was further extended to allow ordinary differential equations (ODE), the concept borrowed from SAT modulo ODE. As our action language is based on ASPMT, which in turn is founded on the basis of ASP and SMT, it enjoys the development in SMT solving techniques as well as the expressivity of ASP language.

9.3 Implementations of ASPMT

A few implementations of ASPMT emerged based on the idea that reduces tight ASPMT theories to the input language of SMT solvers. System aspmt2smt
 [Bartholomew and Lee, 2014] is a proof-of-concept implementation of ASPMT by reducing ASPMT programs into the input language of SMT solver z3, and is shown to effectively handle real number computation for reasoning about continuous changes. The system allows a fragment of ASPMT in the input language, whose syntax resembles ASP rules and which can be effectively translated into the input language of SMT solvers. In particular, the language imposes a syntactic condition that quantified variables can be eliminated by equivalent rewriting.

? [?] extended the system aspmt2smt to handle nonmonotonic spatial reasoning that uses both qualitative and quantitative information, where spatial relations are encoded in theory of nonlinear real arithmetic.

In [Lee et al., 2017], based on the recent development in SMT called “Satisfiability Modulo Ordinary Differential Equations (ODE)” [Gao et al., 2013a] and its implementation dReal [Gao et al., 2013b], the system cplus2aspmt was built on top of aspmt2smt. The paper showed that a general class of hybrid automata with non-linear flow conditions and non-convex invariants can be turned into first-order action language 𝒞{\mathcal{C}}+, and cplus2aspmt can be used to compute the action language modulo ODE by translating 𝒞{\mathcal{C}}+ into ASPMT. For example, the effect of Accel in Example 14 can be represented using ODE as

Speed(s+1)=x+y\displaystyle\hbox{\it Speed\/}(s\!+\!1)=x+y\leftarrow\ \ Accel(s)=trueSpeed(s)=xDuration(s)=δ\displaystyle\hbox{\it Accel\/}(s)\!=\!\hbox{\sc true}\ \land\ \hbox{\it Speed\/}(s)\!=\!x\ \land\ \hbox{\it Duration\/}(s)\!=\!\delta\ \land\
y=0δA𝑑tyMS.\displaystyle y\!=\!\int_{0}^{\delta}{\rm A}\ dt\ \land\ y\!\leq\!{\rm MS}.

The theory of reals is decidable as shown by Tarski, and some SMT solvers do not always approximate reals with floating point numbers. Even for undecidable theories, such as formulas with trigonometric functions and differential equations, SMT solving techniques ensure certain error-bounds: A δ\delta-complete decision procedure [Gao et al., 2013a] for such an SMT formula FF returns false if FF is unsatisfiable, and returns true if its syntactic “numerical perturbation” of FF by bound δ\delta is satisfiable, where δ>0\delta>0 is number provided by the user to bound on numerical errors. This is practically useful since it is not possible to sample exact values of physical parameters in reality. ASPMT is able to take the advantage of the SMT solving techniques whereas it is shown that the ASPMT description of action domains is much more compact than the SMT counterpart.

In [Asuncion et al., 2015], the authors presented the “ordered completion,” that compiles logic programs with convex aggregates into the input language of SMT solvers. The focus there was to compute the standard ASP language using SMT solvers. So unlike the other systems mentioned above, neither intensional functions nor various background theories in SMT were considered there. On the other hand, the input programs are not restricted to tight programs.

10 Comparing ASPMT with Other Approaches to Combining ASP with CSP/SMT

We compare ASPMT with other approaches to combining ASP with CSP/SMT. These approaches can be related to a special case of ASPMT in which all functions are non-intensional.

10.1 Relation to Clingcon Programs

A constraint satisfaction problem (CSP) is a tuple (V,D,C)(V,D,C), where VV is a set of constraint variables with their respective domains in DD, and CC is a set of constraints that specify some legal assignments of values in the domains to the constraint variables.

A clingcon program Π\Pi [Gebser et al., 2009] with a constraint satisfaction problem (V,D,C)(V,D,C) is a set of rules of the form

aB,N,Cn,a\leftarrow B,N,\hbox{\it Cn\/}, (26)

where aa is a propositional atom or \bot, BB is a set of positive propositional literals, NN is a set of negative propositional literals, and Cn is a set of constraints from CC, possibly preceded by not.

Clingcon programs can be viewed as ASPMT instances. Below is a reformulation of the semantics using the terminologies in ASPMT. We assume that constraints are expressed by ASPMT sentences of signature Vσ𝒯V\cup\sigma^{\mathcal{T}}, where VV is a set of object constants, which is identified with the set of constraint variables VV in (V,D,C)(V,D,C), whose value sorts are identified with the domains in DD; we assume that σ𝒯\sigma^{\mathcal{T}} is disjoint from VV and contains all values in DD as object constants, and other symbols to represent constraints, such as ++, ×\times, and \geq. In other words, we represent a constraint as a formula F(v1,,vn)F(v_{1},\dots,v_{n}) over Vσ𝒯V\cup\sigma^{\mathcal{T}} where F(x1,,xn)F(x_{1},\dots,x_{n}) is a formula of the signature σ𝒯\sigma^{\mathcal{T}} and F(v1,,vn)F(v_{1},\dots,v_{n}) is obtained from F(x1,,xn)F(x_{1},\dots,x_{n}) by substituting the object constants (v1,,vn)(v_{1},\dots,v_{n}) in VV for (x1,,xn)(x_{1},\dots,x_{n}). We say this background theory 𝒯{\mathcal{T}} conforms to (V,D,C)(V,D,C).

For any signature σ\sigma that consists of object constants and propositional constants, we identify an interpretation II of σ\sigma as the tuple If,X\langle I^{f},X\rangle, where IfI^{f} is the restriction of II onto the object constants in σ\sigma, and XX is a set of propositional constants in σ\sigma that are true under II.

Given a clingcon program Π\Pi with (V,D,C)(V,D,C), and a 𝒯{\mathcal{T}}-interpretation I=If,XI=\langle I^{f},X\rangle, we define the constraint reduct of Π\Pi relative to XX and IfI^{f} (denoted by ΠIfX\Pi^{X}_{I^{f}}) as the set of rules aBa\leftarrow B for each rule (26) in Π\Pi such that IfCnI^{f}\models\hbox{\it Cn\/}, and XNX\models N. We say that a set XX of propositional atoms is a constraint answer set of Π\Pi relative to IfI^{f} if XX is a minimal model of ΠIfX\Pi^{X}_{I^{f}}.

Example 1 continued  The rules

Amt1=$Amt0+1notFlush,Amt1=$0Flush\begin{array}[]{l}\hbox{\it Amt\/}_{1}=^{\$}\hbox{\it Amt\/}_{0}\!+\!1\leftarrow\hbox{\it not\/}\ \hbox{\it Flush\/},\\ \hbox{\it Amt\/}_{1}=^{\$}0\leftarrow\hbox{\it Flush\/}\end{array}

are identified with

notFlush,not(Amt1=$Amt0+1)Flush,not(Amt1=$0)\begin{array}[]{l}\bot\leftarrow\hbox{\it not\/}\ \hbox{\it Flush\/},\hbox{\it not\/}(\hbox{\it Amt\/}_{1}=^{\$}\hbox{\it Amt\/}_{0}\!+\!1)\\ \bot\leftarrow\hbox{\it Flush\/},\hbox{\it not\/}(\hbox{\it Amt\/}_{1}=^{\$}0)\end{array}

under the semantics of clingcon programs with the theory of integers as the background theory; Amt0\hbox{\it Amt\/}_{0}, Amt1\hbox{\it Amt\/}_{1} are object constants and Flush is a propositional constant. Consider I1I_{1} in Example 1, which can be represented as (I1)f,X\langle(I_{1})^{f},X\rangle where (I1)f(I_{1})^{f} maps Amt0\hbox{\it Amt\/}_{0} to 55, and Amt1\hbox{\it Amt\/}_{1} to 66, and X=X=\emptyset. The set XX is the constraint answer set relative to (I1)f(I_{1})^{f} because XX is the minimal model of the constraint reduct relative to XX and (I1)f(I_{1})^{f}, which is the empty set.

Similar to the way that rules are identified as a special case of formulas [Ferraris et al., 2011], we identify a clingcon program Π\Pi with the conjunction of implications BNCnaB\land N\land\hbox{\it Cn\/}\rightarrow a for all rules (26) in Π\Pi. The following theorem tells us that clingcon programs are a special case of ASPMT in which the background theory 𝒯{\mathcal{T}} conforms to (V,D,C)(V,D,C), and intensional constants are limited to propositional constants only, and do not allow function constants, so the language cannot express the default assignment of values to a function.

Theorem 14

Let Π\Pi be a clingcon program with CSP (V,D,C)(V,D,C), let 𝐩{\bf p} be the set of all propositional constants occurring in Π\Pi, let 𝒯{\mathcal{T}} be the background theory conforming to (V,D,C)(V,D,C), and let If,X\langle I^{f},X\rangle be a 𝒯{\mathcal{T}}-interpretation. Set XX is a constraint answer set of Π\Pi relative to IfI^{f} iff If,X\langle I^{f},X\rangle is a 𝒯{\mathcal{T}}-stable model of Π\Pi relative to 𝐩{\bf p}.

Note that a clingcon program does not allow an atom that consists of elements from both VV and 𝐩{\bf p}. Thus the truth value of an atom is determined by either IfI^{f} or XX, but not by involving both of them.

In [Lierler and Susman, 2016], the authors compared Constraint ASP and SMT by relating the different terminologies and concepts used in each of them. This is related to the relationship shown in Theorem 14 since 𝒯{\mathcal{T}}-stable models of an ASPMT program Π\Pi relative to \emptyset are precisely SMT models of Π\Pi with background theory 𝒯{\mathcal{T}}. One main difference between the two comparisons is that an answer set in [Lierler and Susman, 2016] is a set containing ordinary atoms and theory/constraint atoms, while a stable model in this paper is a classical model.

10.2 Relation to ASP(LC) Programs

? [?] consider logic programs with linear constraints, or ASP(LC) programs, comprised of rules of the form

aB,N,LCa\leftarrow B,N,LC (27)

where aa is a propositional atom or \bot, BB is a set of positive propositional literals, and NN is a set of negative propositional literals, and LCLC is a set of theory atoms—linear constraints of the form i=1n(ci×xi)k\displaystyle\sum\limits_{i=1}^{n}(c_{i}\times x_{i})\ \bowtie\ k where {,,=}\bowtie\in\{\leq,\geq,=\}, each xix_{i} is an object constant whose value sort is integers (or reals), and each cic_{i}, kk is an integer (or real).

An ASP(LC) program Π\Pi can be viewed as an ASPMT formula whose background theory 𝒯{\mathcal{T}} is the theory of integers or the theory of reals. We identify an ASP(LC) program Π\Pi with the conjunction of ASPMT formulas BNLCaB\land N\land LC\rightarrow a for all rules (27) in Π\Pi.

An LJN-intepretation is a pair (X,T)(X,T) where XX is a set of propositional atoms and TT is a subset of theory atoms occurring in Π\Pi such that there is some 𝒯{\mathcal{T}}-interpretation II that satisfies TT¯T\cup\overline{T}, where T¯\overline{T} is the set of negations of each theory atom occurring in Π\Pi but not in TT. An LJN-interpretation (X,T)(X,T) satisfies an atom bb if bXb\in X, the negation of an atom notcnot\ c if cXc\notin X, and a theory atom tt if tTt\in T. The notion of satisfaction is extended to other propositional connectives as usual.

The LJN-reduct of a program Π\Pi with respect to an LJN-interpretation (X,T)(X,T), denoted by Π(X,T)\Pi^{(X,T)}, consists of rules aBa\leftarrow B for each rule (27) such that (X,T)(X,T) satisfies NLCN\land LC. (X,T)(X,T) is an LJN-answer set of Π\Pi if (X,T)(X,T) satisfies Π\Pi, and XX is the smallest set of atoms satisfying Π(X,T)\Pi^{(X,T)}.

The following theorem tells us that there is a one-to-many relationship between LJN-answer sets and the stable models in the sense of ASPMT. Essentially, the set of theory atoms in an LJN-answer set encodes all valid mappings for functions in the stable model semantics.

Theorem 15

Let Π\Pi be an ASP(LC) program of signature σp,σf\langle\sigma^{p},\sigma^{f}\rangle where σp\sigma^{p} is a set of propositional constants, and let σf\sigma^{f} be a set of object constants, and let IfI^{f} be an interpretation of σf\sigma^{f}.

  • (a)

    If (X,T)(X,T) is an LJN-answer set of Π\Pi, then for any 𝒯{\mathcal{T}}-interpretation II such that IfTT¯I^{f}\models T\cup\overline{T}, we have If,XSM[Π;σp]\langle I^{f},X\rangle\models\hbox{\rm SM}[\Pi;\sigma^{p}].

  • (b)

    For any 𝒯{\mathcal{T}}-interpretation I=If,XI=\langle I^{f},X\rangle, if If,XSM[Π;σp]\langle I^{f},X\rangle\models\hbox{\rm SM}[\Pi;\sigma^{p}], then an LJN-interpretation (X,T)(X,T) where

    T={tt is a theory atom in Π such that Ift}T=\{t\mid\text{$t$ is a theory atom in $\Pi$ such that $I^{f}\models t$}\}

    is an LJN-answer set of Π\Pi.

Example 15

Let FF be

axz>0.bxy0.cb,yz0.nota.bc.\begin{array}[]{ll}a\leftarrow x\!-\!z\!>\!0.&b\leftarrow x\!-\!y\!\leq\!0.\\ c\leftarrow b,\ y\!-\!z\!\leq\!0.&\leftarrow\hbox{\it not\/}\ a.\\ b\leftarrow c.\end{array}

The LJN-interpretation L={a},{xz>0}L=\langle\{a\},\{x\!-\!z\!>\!0\}\rangle is an answer set of FF since {(xz>0,¬(xy0),¬(yz0)}\{(x\!-\!z\!>\!0,\neg(x\!-\!y\!\leq\!0),\neg(y\!-\!z\!\leq\!0)\} is satisfiable (e.g., take xI=2,yI=1,zI=0x^{I}\!=\!2,y^{I}\!=\!1,z^{I}\!=\!0) and the set {a}\{a\} is the minimal model satisfying the reduct FLF^{L}, which is equivalent to (a)(cb)(\top\rightarrow a)\land(c\rightarrow b). In accordance with Theorem 15, the interpretation II such that xI=2,yI=1,zI=0,aI=true,bI=false,cI=falsex^{I}\!=\!2,y^{I}\!=\!1,z^{I}\!=\!0,a^{I}\!=\!\hbox{\sc true},b^{I}\!=\!\hbox{\sc false},c^{I}\!=\!\hbox{\sc false} satisfies ISM[F;abc]I\models\hbox{\rm SM}[F;abc].

As with clingcon programs, ASP(LC) programs do not allow intensional functions.

10.3 Relation to Lin-Wang Programs

? (?) extended answer set semantics with functions by extending the definition of a reduct, and also provided loop formulas for such programs. We can provide an alternative account of their results by considering the notions there as special cases of the definitions presented in this paper. Essentially, they restricted attention to a special case of non-Herbrand interpretations such that object constants form the universe, and ground terms other than object constants are mapped to the object constants. More precisely, according to [Lin and Wang, 2008], an LW-program PP consists of type definitions and a set of rules of the form

AB1,,Bm,notC1,,notCnA\leftarrow B_{1},\dots,B_{m},\hbox{\it not\/}\ C_{1},\dots,\hbox{\it not\/}\ C_{n} (28)

where AA is \bot or an atom, and BiB_{i} (1im1\leq i\leq m) and CjC_{j} (1jn1\leq j\leq n) are atomic formulas possibly containing equality. Type definitions are essentially a special case of many-sorted signature declarations, where each sort is a set of object constants. For such many-sorted signature, we say that a many-sorted interpretation II is a PP-interpretation if it evaluates each object constant to itself, and each ground term other than object constants to an object constant conforming to the type definitions of PP. The functional reduct of PP under II is a normal logic program without functions obtained from PP by

  1. 1.

    replacing each functional term f(t1,,tn)f(t_{1},\dots,t_{n}) with cc where fI(t1,,tn)=cf^{I}(t_{1},\dots,t_{n})=c;

  2. 2.

    removing any rule containing ccc\neq c or c=dc=d where cc, dd are distinct constants;

  3. 3.

    removing any remaining equalities from the remaining rules;

  4. 4.

    removing any rule containing notA\hbox{\it not\/}\ A in the body of the rule where AI=trueA^{I}=\hbox{\sc true};

  5. 5.

    removing any remaining notA\hbox{\it not\/}\ A from the bodies of the remaining rules.

A PP-interpretation is an answer set of PP in the sense of [Lin and Wang, 2008] if II is the minimal model of PIP^{I}.

The following theorem tells us that LWLW programs are a special case of FSM formulas whose function constants are non-intensional.

Theorem 16

Let PP be an LW-program and let FF be the FOL-representation of the set of rules in PP. The following conditions are equivalent to each other:

  • (a)

    II is an answer set of PP in the sense of [Lin and Wang, 2008];

  • (b)

    II is a PP-interpretation that satisfies SM[F;𝐩]\hbox{\rm SM}[F;{\bf p}] where 𝐩{\bf p} is the list of all predicate constants occurring in FF.

In other words, like clingcon programs, Lin-Wang programs can be identified with a special case of the first-order stable model semantics from [Ferraris et al., 2011], which do not allow intensional functions.

11 Conclusion

In this paper, we presented the functional stable model semantics, which properly extends the first-order stable model semantics to distinguish between intensional and non-intensional functions. We observe that many properties known for the first-order stable model semantics naturally extend to the functional stable model semantics.

The presented semantics turns out to be useful for overcoming the limitations of the stable model semantics originating from the propositional setting, and enables us to combine with other related formalisms where general functions play a central role in efficient computation. ASPMT benefits from the expressiveness of ASP modeling language while leveraging efficient constraint/theory solving methods originating from SMT. For instance, it provides a viable approach to nonmonotonic reasoning about hybrid transitions where discrete and continuous changes co-exist.

The relationship between ASPMT and SMT is similar to the relationship between ASP and SAT. We expect that, in addition to completion and the results shown in this paper, many other results known between ASP and SAT can be carried over to the relationship between ASPMT and SMT, thereby contributing to efficient first-order reasoning in answer set programming. A future work is to lift the limitation of the current ASPMT implementation limited to tight programs by designing and implementing a native computation algorithm which borrows the techniques from SMT, similar to the way that ASP solvers adapted SAT solving computation.

Acknowledgements  We are grateful to Yi Wang and Nikhil Loney for many useful discussions and to the anonymous referees for their constructive comments. This work was partially supported by the National Science Foundation under Grants IIS-1319794, IIS-1526301, and IIS-1815337.

References

  • [Asuncion et al., 2015] Vernon Asuncion, Yin Chen, Yan Zhang, and Yi Zhou. Ordered completion for logic programs with aggregates. Artificial Intelligence, 224:72–102, 2015.
  • [Babb and Lee, 2013] Joseph Babb and Joohyung Lee. Cplus2ASP: Computing action language 𝒞\mathcal{C}+ in answer set programming. In Proceedings of International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR), pages 122–134, 2013.
  • [Balduccini, 2009] Marcello Balduccini. Representing constraint satisfaction problems in answer set programming. In Working Notes of the Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP), 2009.
  • [Balduccini, 2012] Marcello Balduccini. A “conservative” approach to extending answer set programming with non-Herbrand functions. In Correct Reasoning - Essays on Logic-Based AI in Honour of Vladimir Lifschitz, pages 24–39, 2012.
  • [Barrett et al., 2009] Clark W. Barrett, Roberto Sebastiani, Sanjit A. Seshia, and Cesare Tinelli. Satisfiability modulo theories. In Armin Biere, Marijn Heule, Hans van Maaren, and Toby Walsh, editors, Handbook of Satisfiability, volume 185 of Frontiers in Artificial Intelligence and Applications, pages 825–885. IOS Press, 2009.
  • [Bartholomew and Lee, 2012] Michael Bartholomew and Joohyung Lee. Stable models of formulas with intensional functions. In Proceedings of International Conference on Principles of Knowledge Representation and Reasoning (KR), pages 2–12, 2012.
  • [Bartholomew and Lee, 2013a] Michael Bartholomew and Joohyung Lee. Functional stable model semantics and answer set programming modulo theories. In Proceedings of International Joint Conference on Artificial Intelligence (IJCAI), 2013.
  • [Bartholomew and Lee, 2013b] Michael Bartholomew and Joohyung Lee. A functional view of strong negation. In Working Notes of the 5th Workshop on Answer Set Programming and Other Computing Paradigms (ASPOCP), 2013.
  • [Bartholomew and Lee, 2013c] Michael Bartholomew and Joohyung Lee. On the stable model semantics for intensional functions. Theory and Practice of Logic Programming, 13(4-5):863–876, 2013.
  • [Bartholomew and Lee, 2014] Michael Bartholomew and Joohyung Lee. System ASPMT2SMT: Computing aspmt theories by smt solvers. In Proceedings of European Conference on Logics in Artificial Intelligence (JELIA), pages 529–542, 2014.
  • [Brewka et al., 2011] Gerhard Brewka, Ilkka Niemelä, and Miroslaw Truszczynski. Answer set programming at a glance. Communications of the ACM, 54(12):92–103, 2011.
  • [Cabalar, 2011] Pedro Cabalar. Functional answer set programming. Theory and Practice of Logic Programming, 11(2-3):203–233, 2011.
  • [Clark, 1978] Keith Clark. Negation as failure. In Herve Gallaire and Jack Minker, editors, Logic and Data Bases, pages 293–322. Plenum Press, New York, 1978.
  • [Ferraris et al., 2007] Paolo Ferraris, Joohyung Lee, and Vladimir Lifschitz. A new perspective on stable models. In Proceedings of International Joint Conference on Artificial Intelligence (IJCAI), pages 372–379, 2007.
  • [Ferraris et al., 2009] Paolo Ferraris, Joohyung Lee, Vladimir Lifschitz, and Ravi Palla. Symmetric splitting in the general theory of stable models. In Proceedings of International Joint Conference on Artificial Intelligence (IJCAI), pages 797–803. AAAI Press, 2009.
  • [Ferraris et al., 2011] Paolo Ferraris, Joohyung Lee, and Vladimir Lifschitz. Stable models and circumscription. Artificial Intelligence, 175:236–263, 2011.
  • [Fox and Long, 2003] Maria Fox and Derek Long. PDDL2.1: An extension to PDDL for expressing temporal planning domains. J. Artif. Intell. Res. (JAIR), 20:61–124, 2003.
  • [Fox and Long, 2006] Maria Fox and Derek Long. Modelling mixed discrete-continuous domains for planning. J. Artif. Intell. Res. (JAIR), 27:235–297, 2006.
  • [Gao et al., 2013a] Sicun Gao, Soonho Kong, and Edmund Clarke. Satisfiability modulo ODEs. arXiv preprint arXiv:1310.8278, 2013.
  • [Gao et al., 2013b] Sicun Gao, Soonho Kong, and Edmund M Clarke. dReal: An SMT solver for nonlinear theories over the reals. In International Conference on Automated Deduction, pages 208–214. Springer Berlin Heidelberg, 2013.
  • [Gebser et al., 2009] M. Gebser, M. Ostrowski, and T. Schaub. Constraint answer set solving. In Proceedings of International Conference on Logic Programming (ICLP), pages 235–249, 2009.
  • [Gelfond and Kahl, 2014] Michael Gelfond and Yulia Kahl. Knowledge Representation, Reasoning, and the Design of Intelligent Agents. Cambridge University Press, 2014.
  • [Gelfond and Lifschitz, 1988] Michael Gelfond and Vladimir Lifschitz. The stable model semantics for logic programming. In Robert Kowalski and Kenneth Bowen, editors, Proceedings of International Logic Programming Conference and Symposium, pages 1070–1080. MIT Press, 1988.
  • [Giunchiglia et al., 2004] Enrico Giunchiglia, Joohyung Lee, Vladimir Lifschitz, Norman McCain, and Hudson Turner. Nonmonotonic causal theories. Artificial Intelligence, 153(1–2):49–104, 2004.
  • [Janhunen et al., 2011] Tomi Janhunen, Guohua Liu, and Ilkka Niemelä. Tight integration of non-ground answer set programming and satisfiability modulo theories. In Working notes of the 1st Workshop on Grounding and Transformations for Theories with Variables, 2011.
  • [Lee and Meng, 2013] Joohyung Lee and Yunsong Meng. Answer set programming modulo theories and reasoning about continuous changes. In Proceedings of International Joint Conference on Artificial Intelligence (IJCAI), 2013.
  • [Lee et al., 2013] Joohyung Lee, Vladimir Lifschitz, and Fangkai Yang. Action language C\mathcal{B}C: Preliminary report. In Proceedings of International Joint Conference on Artificial Intelligence (IJCAI), 2013.
  • [Lee et al., 2017] Joohyung Lee, Nikhil Loney, and Yunsong Meng. Representing hybrid automata by action language modulo theories. Theory and Practice of Logic Programming, 2017.
  • [Lierler and Susman, 2016] Yuliya Lierler and Benjamin Susman. Constraint answer set programming versus satisfiability modulo theories. In IJCAI, pages 1181–1187, 2016.
  • [Lifschitz and Turner, 1999] Vladimir Lifschitz and Hudson Turner. Representing transition systems by logic programs. In Proceedings of International Conference on Logic Programming and Nonmonotonic Reasoning (LPNMR), pages 92–106, 1999.
  • [Lifschitz and Yang, 2011] Vladimir Lifschitz and Fangkai Yang. Eliminating function symbols from a nonmonotonic causal theory. In Gerhard Lakemeyer and Sheila A. McIlraith, editors, Knowing, Reasoning, and Acting: Essays in Honour of Hector J. Levesque. College Publications, 2011.
  • [Lifschitz and Yang, 2013] Vladimir Lifschitz and Fangkai Yang. Functional completion. Journal of Applied Non-Classical Logics, 23(1-2):121–130, 2013.
  • [Lifschitz et al., 2001] Vladimir Lifschitz, David Pearce, and Agustin Valverde. Strongly equivalent logic programs. ACM Transactions on Computational Logic, 2:526–541, 2001.
  • [Lifschitz, 1988] Vladimir Lifschitz. On the declarative semantics of logic programs with negation. In Jack Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 177–192. Morgan Kaufmann, San Mateo, CA, 1988.
  • [Lifschitz, 1994] Vladimir Lifschitz. Circumscription. In D.M. Gabbay, C.J. Hogger, and J.A. Robinson, editors, Handbook of Logic in AI and Logic Programming, volume 3, pages 298–352. Oxford University Press, 1994.
  • [Lifschitz, 1997] Vladimir Lifschitz. On the logic of causal explanation. Artificial Intelligence, 96:451–465, 1997.
  • [Lifschitz, 2008] Vladimir Lifschitz. What is answer set programming? In Proceedings of the AAAI Conference on Artificial Intelligence, pages 1594–1597. MIT Press, 2008.
  • [Lifschitz, 2011] Vladimir Lifschitz. Datalog programs and their stable models. In O. de Moor, G. Gottlob, T. Furche, and A. Sellers, editors, Datalog Reloaded: First International Workshop, Datalog 2010, Oxford, UK, March 16-19, 2010. Revised Selected Papers. Springer, 2011.
  • [Lifschitz, 2012] Vladimir Lifschitz. Logic programs with intensional functions. In Proceedings of International Conference on Principles of Knowledge Representation and Reasoning (KR), pages 24–31, 2012.
  • [Lin and Wang, 2008] Fangzhen Lin and Yisong Wang. Answer set programming with functions. In Proceedings of International Conference on Principles of Knowledge Representation and Reasoning (KR), pages 454–465, 2008.
  • [Lin, 1995] Fangzhen Lin. Embracing causality in specifying the indirect effects of actions. In Proceedings of International Joint Conference on Artificial Intelligence (IJCAI), pages 1985–1991, 1995.
  • [Liu et al., 2012] Guohua Liu, Tomi Janhunen, and Ilkka Niemelä. Answer set programming via mixed integer programming. In Proceedings of International Conference on Principles of Knowledge Representation and Reasoning (KR), pages 32–42, 2012.
  • [McCarthy, 1980] John McCarthy. Circumscription—a form of non-monotonic reasoning. Artificial Intelligence, 13:27–39,171–172, 1980.
  • [Mellarkod et al., 2008] Veena S Mellarkod, Michael Gelfond, and Yuanlin Zhang. Integrating answer set programming and constraint logic programming. Annals of Mathematics and Artificial Intelligence, 53(1-4):251–287, 2008.
  • [Wałega et al., 2015] Przemysław Andrzej Wałega, Mehul Bhatt, and Carl Schultz. ASPMT(QS): non-monotonic spatial reasoning with answer set programming modulo theories. In Logic Programming and Nonmonotonic Reasoning, pages 488–501. Springer, 2015.

Appendix A Review of Reduct-Based Definition of Stable Models

Some of the proofs below use the definition of functional stable models based on the notions of an infinitary ground formula and a reduct from [Bartholomew and Lee, 2013c]. We review the semantics below.

A.1 Infinitary Ground Formulas

We assume that a signature and an interpretation are defined the same as in the standard first-order logic. For each element ξ\xi in the universe |I||I| of II, we introduce a new symbol ξ\xi^{\diamond}, called an object name. By σI\sigma^{I} we denote the signature obtained from σ\sigma by adding all object names ξ\xi^{\diamond} as additional object constants. We will identify an interpretation II of signature σ\sigma with its extension to σI\sigma^{I} defined by I(ξ)=ξI(\xi^{\diamond})=\xi.

We assume the primary connectives of infinitary ground formulas to be \bot, {}\{\}^{\land}, {}\{\}^{\lor}, and \rightarrow. The usual propositional connectives ,\land,\lor are considered as shorthands: FGF\land G as {F,G}\{F,G\}^{\land}, and FGF\lor G as {F,G}\{F,G\}^{\lor}.

Let AA be the set of all ground atomic formulas of signature σI\sigma^{I}. The sets 0,1,{\mathcal{F}}_{0},{\mathcal{F}}_{1},\dots are defined recursively as follows:

  • 0=A{}{\mathcal{F}}_{0}=A\cup\{\bot\};

  • i+1(i0){\mathcal{F}}_{i+1}(i\geq 0) consists of expressions {\mathcal{H}}^{\lor} and {\mathcal{H}}^{\land}, for all subsets {\mathcal{H}} of 0i{\mathcal{F}}_{0}\cup\ldots\cup{\mathcal{F}}_{i}, and of the expressions FGF\rightarrow G, where FF and GG belong to 0i{\mathcal{F}}_{0}\cup\dots\cup{\mathcal{F}}_{i}.

We define Ainf=i=0i{\mathcal{L}}_{A}^{inf}=\bigcup_{i=0}^{\infty}{\mathcal{F}}_{i}, and call elements of Ainf{\mathcal{L}}_{A}^{inf} infinitary ground formulas of σ\sigma w.r.t. II.

For any interpretation II of σ\sigma and any infinitary ground formula FF w.r.t. II, the definition of satisfaction, IFI\models F, is as follows:

  • For atomic formulas, the definition of satisfaction is the same as in the standard first-order logic;

  • II\models{\mathcal{H}}^{\lor} if there is a formula GG\in{\mathcal{H}} such that IGI\models G;

  • II\models{\mathcal{H}}^{\land} if, for every formula GG\in{\mathcal{H}}, IGI\models G;

  • IGHI\models G\rightarrow H if I⊧̸GI\not\models G or IHI\models H.

Given an interpretation, we identify any first-order sentence with an infinitary ground formula via the process of grounding relative to that interpretation. Let FF be any first-order sentence of a signature σ\sigma, and let II be an interpretation of σ\sigma. By grI[F]gr_{I}[F] we denote the infinitary ground formula w.r.t. II that is obtained from FF by the following process:

  • If FF is an atomic formula, grI[F]gr_{I}[F] is FF;

  • grI[GH]=grI[G]grI[H]({,,})gr_{I}[G\odot H]=gr_{I}[G]\odot gr_{I}[H]\ \ \ \ (\odot\in\{\land,\lor,\rightarrow\});

  • grI[xG(x)]={grI[G(ξ)]ξ|I|}gr_{I}[\exists xG(x)]=\{gr_{I}[G(\xi^{\diamond})]\mid\xi\in|I|\}^{\lor};   

  • grI[xG(x)]={grI[G(ξ)]ξ|I|}gr_{I}[\forall xG(x)]=\{gr_{I}[G(\xi^{\diamond})]\mid\xi\in|I|\}^{\land}.

A.2 Stable Models in terms of Grounding and Reduct

For any two interpretations II, JJ of the same signature and any list 𝐜{\bf{c}} of distinct predicate and function constants, we write J<𝐜IJ<^{\bf{c}}I if

  • JJ and II have the same universe and agree on all constants not in 𝐜{\bf{c}},

  • pJpIp^{J}\subseteq p^{I} for all predicate constants pp in 𝐜{\bf{c}},161616For any symbol cc in a signature, cIc^{I} denotes the evaluation of II on cc. and

  • JJ and II do not agree on 𝐜{\bf{c}}.

The reduct FI¯F^{\mathit{\underline{I}}} of an infinitary ground formula FF relative to an interpretation II is defined as follows:

  • For any atomic formula FF, FI¯={ if I⊧̸F F otherwise. F^{\mathit{\underline{I}}}=\left\{\begin{array}[]{ll}\bot&\text{ if $I\not\models F$ }\\ F&\text{ otherwise. }\end{array}\right.

  • ()I¯={GI¯G}({\mathcal{H}}^{\land})^{\mathit{\underline{I}}}=\{G^{\mathit{\underline{I}}}\mid G\in{\mathcal{H}}\}^{\land}

  • ()I¯={GI¯G}({\mathcal{H}}^{\lor})^{\mathit{\underline{I}}}=\{G^{\mathit{\underline{I}}}\mid G\in{\mathcal{H}}\}^{\lor}

  • (GH)I¯={ if I⊧̸GH GI¯HI¯ otherwise. (G\rightarrow H)^{\mathit{\underline{I}}}=\left\{\begin{array}[]{ll}\bot&\text{ if $I\not\models G\rightarrow H$ }\\ G^{\mathit{\underline{I}}}\rightarrow H^{\mathit{\underline{I}}}&\text{ otherwise. }\end{array}\right.

The following theorem presents an alternative definition of a stable model that is equivalent to the one in the previous section.

Theorem 17 (Theorem 1 from [Bartholomew and Lee, 2013c])

Let FF be a sentence and let 𝐜{\bf{c}} be a list of intensional constants. An interpretation II satisfies SM[F;𝐜]\hbox{\rm SM}[F;{\bf{c}}] iff

  • II satisfies FF, and

  • no interpretation JJ such that J<𝐜IJ<^{\bf{c}}I satisfies (grI[F])I¯(gr_{I}[F])^{\mathit{\underline{I}}}.

Appendix B Proofs

B.1 Proof of Theorem 1

Theorem 1  For any first-order formulas FF and GG, if GG is negative on 𝐜{\bf{c}}, SM[FG;𝐜]\hbox{\rm SM}[F\land G;{\bf{c}}] is equivalent to SM[F;𝐜]G\hbox{\rm SM}[F;{\bf{c}}]\land G.

Proof.  By Lemma 2,

SM[F¬G;𝐜]\displaystyle\hbox{\rm SM}[F\land\neg G;\ {\bf{c}}]\ =F¬G¬𝐜^((𝐜^<𝐜)(F¬G)(𝐜^))\displaystyle\ =F\land\neg G\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land(F\land\neg G)^{*}({\widehat{\bf{c}}}))
F¬G¬𝐜^((𝐜^<𝐜)F(𝐜^)¬G)\displaystyle\ \Leftrightarrow F\land\neg G\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land F^{*}({\widehat{\bf{c}}})\land\neg G)
F¬𝐜^((𝐜^<𝐜)F(𝐜^))¬G\displaystyle\ \Leftrightarrow F\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land F^{*}({\widehat{\bf{c}}}))\land\neg G
=SM[F;𝐜]¬G.\displaystyle\ =\hbox{\rm SM}[F;\ {\bf{c}}]\land\neg G.
 

B.2 Proof of Theorem 2

Lemma 4

Choice(𝐜)(𝐜^)\hbox{\it Choice\/}({\bf{c}})^{*}({\widehat{\bf{c}}}) is equivalent to

(𝐜pred𝐜^pred)(𝐜func=𝐜^func).({\bf{c}}^{pred}\leq{\widehat{\bf{c}}}^{pred})\land({\bf{c}}^{func}={\widehat{\bf{c}}}^{func}).

Proof.  Choice(𝐜)\hbox{\it Choice\/}({\bf{c}}) is the conjunction for each predicate pp in 𝐜pred{\bf{c}}^{pred} of 𝐱(p(𝐱)¬p(𝐱))\forall{\bf x}(p({\bf x})\lor\neg p({\bf x})) and for each function ff in 𝐜func{\bf{c}}^{func} of 𝐱y(f(𝐱)=y¬f(𝐱)=y)\forall{\bf x}y(f({\bf x})=y\lor\neg f({\bf x})=y).

First,

[𝐱(p(𝐱)¬p(𝐱))](𝐜^)[\forall{\bf x}(p({\bf x})\lor\neg p({\bf x}))]^{*}({\widehat{\bf{c}}})

is equivalent to

𝐱(p^(𝐱)(¬p^(𝐱)¬p(𝐱))),\forall{\bf x}(\widehat{p}({\bf x})\lor(\neg\widehat{p}({\bf x})\land\neg p({\bf x}))),

which is further equivalent to

𝐱(p(𝐱)p^(𝐱)),\forall{\bf x}(p({\bf x})\rightarrow\widehat{p}({\bf x})),

or simply pp^p\leq\widehat{p}.

Next,

[𝐱y(f(𝐱)=y¬(f(𝐱)=y))](𝐜^)[\forall{\bf x}y(f({\bf x})=y\lor\neg(f({\bf x})=y))]^{*}({\widehat{\bf{c}}})

is equivalent to

𝐱y((f^(𝐱)=yf(𝐱)=y)(¬(f^(𝐱)=y)¬(f(𝐱)=y))),\forall{\bf x}y((\widehat{f}({\bf x})=y\land f({\bf x})=y)\lor(\neg(\widehat{f}({\bf x})=y)\land\neg(f({\bf x})=y))),

which is further equivalent to

𝐱y(f(𝐱)=yf^(𝐱)=y),\forall{\bf x}y(f({\bf x})=y\leftrightarrow\widehat{f}({\bf x})=y),

or simply f=f^f=\widehat{f}.

Thus, Choice(𝐜)(𝐜^)\hbox{\it Choice\/}({\bf{c}})^{*}({\widehat{\bf{c}}}) is the conjunction for each predicate pp in 𝐜pred{\bf{c}}^{pred} of pp^p\leq\widehat{p} and for each function ff in 𝐜func{\bf{c}}^{func} of f=f^f=\widehat{f}, or simply Choice(𝐜)(𝐜^)\hbox{\it Choice\/}({\bf{c}})^{*}(\widehat{{\bf{c}}}) is

(𝐜pred𝐜^pred)(𝐜func=𝐜^func). ({\bf{c}}^{pred}\leq{\widehat{\bf{c}}}^{pred})\land({\bf{c}}^{func}={\widehat{\bf{c}}}^{func}).\quad\vrule height=7.5pt,width=4.17pt,depth=0.0pt\vskip 6.0pt plus 2.0pt minus 2.0pt

Theorem 2   For any first-order formula FF and any disjoint lists 𝐜{\bf{c}}, 𝐝{\bf{d}} of distinct constants, the following formulas are logically valid:

(i)SM[F;𝐜𝐝]SM[F;𝐜](ii)SM[FChoice(𝐝);𝐜𝐝]SM[F;𝐜].\begin{array}[]{l}(i)\hskip 14.22636pt\hbox{\rm SM}[F;{\bf{c}}{\bf{d}}]\rightarrow\hbox{\rm SM}[F;{\bf{c}}]\\ (ii)\hskip 11.38109pt\hbox{\rm SM}[F\land\hbox{\it Choice\/}({\bf{d}});{\bf{c}}{\bf{d}}]\leftrightarrow\hbox{\rm SM}[F;{\bf{c}}].\end{array}

Proof.  The proof is not long, but there is a notational difficulty that we need to overcome before we can present it. The notation F(𝐜^)F^{*}({\widehat{\bf{c}}}) does not take into account the fact that the construction of this formula depends on the choice of the list 𝐜{\bf{c}} of intensional constants. Since the dependence on 𝐜{\bf{c}} is essential in the proof of Theorem 2, we use here the more elaborate notation F[𝐜](𝐜^)F^{*[{\bf{c}}]}({\widehat{\bf{c}}}). For instance, if FF is p(x)q(x)p(x)\land q(x) then

F[p](p^) is p^(x)q(x),F[pq](p^,q^) is p^(x)q^(x).\begin{array}[]{rcl}F^{*[p]}(\widehat{p})&\hbox{ is }&\widehat{p}(x)\land q(x),\\ F^{*[pq]}(\widehat{p},\widehat{q})&\hbox{ is }&\widehat{p}(x)\land\widehat{q}(x).\end{array}

It is easy to verify by induction on FF that for any disjoint lists 𝐜{\bf{c}}, 𝐝{\bf{d}} of distinct predicate constants,

F[𝐜](𝐜^)=F[𝐜𝐝](𝐜^,𝐝).F^{*[{\bf{c}}]}({\widehat{\bf{c}}})\,=\,F^{*[{\bf{c}}{\bf{d}}]}({\widehat{\bf{c}}},{\bf{d}}). (29)

(i) In the notation introduced above, SM[F;𝐜]\hbox{\rm SM}[F;{\bf{c}}] is

F¬𝐜^((𝐜^<𝐜)F[𝐜](𝐜^)).F\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land F^{*[{\bf{c}}]}({\widehat{\bf{c}}})).

By (29), this formula can be written also as

F¬𝐜^((𝐜^<𝐜)F[𝐜𝐝](𝐜^,𝐝)),F\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land F^{*[{\bf{c}}{\bf{d}}]}({\widehat{\bf{c}}},{\bf{d}})),

which is equivalent to

F¬𝐜^(((𝐜^,𝐝)<(𝐜,𝐝))F[𝐜𝐝](𝐜^,𝐝)).F\land\neg\exists{\widehat{\bf{c}}}((({\widehat{\bf{c}}},{\bf{d}})<({\bf{c}},{\bf{d}}))\land F^{*[{\bf{c}}{\bf{d}}]}({\widehat{\bf{c}}},{\bf{d}})). (30)

On the other hand, SM[F;𝐜𝐝]\hbox{\rm SM}[F;{\bf{c}}{\bf{d}}] is

F¬𝐜^𝐝^(((𝐜^,𝐝^)<(𝐜,𝐝))F[𝐜𝐝](𝐜^,𝐝^)).F\land\neg\exists{\widehat{\bf{c}}}{\widehat{\bf{d}}}((({\widehat{\bf{c}}},{\widehat{\bf{d}}})<({\bf{c}},{\bf{d}}))\land F^{*[{\bf{c}}{\bf{d}}]}({\widehat{\bf{c}}},{\widehat{\bf{d}}})). (31)

It is clear that (31) entails (30).

(ii) Note that, by (29) and Lemma 4, the formula

𝐜^𝐝^(((𝐜^,𝐝^)<(𝐜,𝐝))F[𝐜𝐝](𝐜^,𝐝^)Choice(𝐝)[𝐜𝐝](𝐜^,𝐝^))\exists{\widehat{\bf{c}}}{\widehat{\bf{d}}}(({\bf({\widehat{\bf{c}}},{\widehat{\bf{d}}})}<{\bf(c,d)})\land F^{*[{\bf cd}]}({\widehat{\bf{c}}},{\widehat{\bf{d}}})\land\hbox{\it Choice\/}({\bf d})^{*[{\bf cd}]}({\widehat{\bf{c}}},{\widehat{\bf{d}}}))

is equivalent to

𝐜^𝐝^(((𝐜^,𝐝^)<(𝐜,𝐝))F[𝐜𝐝](𝐜^,𝐝^)(𝐝=𝐝^)).\exists{\widehat{\bf{c}}}{\widehat{\bf{d}}}((({\widehat{\bf{c}}},{\widehat{\bf{d}}})<{\bf(c,d)})\land F^{*[{\bf cd}]}({\widehat{\bf{c}}},{\widehat{\bf{d}}})\land({\bf d}={\widehat{\bf{d}}})).

It follows that it can be also equivalently rewritten as

𝐜^((𝐜^<𝐜)F[𝐜𝐝](𝐜^,𝐝)).\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf c})\land F^{*[{\bf cd}]}({\widehat{\bf{c}}},{\bf d})).

By (29), the last formula can be represented as

𝐜^((𝐜^<𝐜)F[𝐜](𝐜^)).\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf c})\land F^{*[{\bf c}]}({\widehat{\bf{c}}})).
 

B.3 Proof of Theorem 3

Recall that about first-order formulas FF and GG we say that FF is strongly equivalent to GG if, for any formula HH, any occurrence of FF in HH, and any list 𝐜{\bf{c}} of distinct predicate and function constants, SM[H;𝐜]\hbox{\rm SM}[H;{\bf{c}}] is equivalent to SM[H;𝐜]\hbox{\rm SM}[H^{\prime};{\bf{c}}], where HH^{\prime} is obtained from HH by replacing the occurrence of FF by GG.

Lemma 5

Formula

(FG)((F(𝐜^)G(𝐜^))(H(𝐜^)(H)(𝐜^)))(F\leftrightarrow G)\land((F^{*}({\widehat{\bf{c}}})\leftrightarrow G^{*}({\widehat{\bf{c}}}))\rightarrow(H^{*}({\widehat{\bf{c}}})\leftrightarrow(H^{\prime})^{*}({\widehat{\bf{c}}})))

is logically valid.

Proof.  By induction on the structure of HH.   

The following lemma is equivalent to the “only if” part of Theorem 3.

Lemma 6

If the formula (9) is logically valid, then FF is strongly equivalent to GG.

Proof.  Assume that (9) is logically valid. We need to show that

H¬𝐜^((𝐜^<𝐜)H(𝐜^))H\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land H^{*}({\widehat{\bf{c}}})) (32)

is equivalent to

H¬𝐜^((𝐜^<𝐜)(H)(𝐜^)).H^{\prime}\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land(H^{\prime})^{*}({\widehat{\bf{c}}})). (33)

Since (9) is logically valid, the first conjunctive term of (32) is equivalent to the first conjunctive term of (33). By Lemma 5, it also follows that the same relationship holds between the two second conjunctive terms of the same formulas.  

The following lemma is equivalent to the “if” part of Theorem 3.

Lemma 7

If FF is strongly equivalent to GG, then (9) is logically valid.

Proof.  Let CC be the formula Choice(𝐜)\hbox{\it Choice\/}({\bf{c}}). Let EE stand for FGF\leftrightarrow G, and EE^{\prime} be FFF\leftrightarrow F. Since FF is strongly equivalent to GG, the formula SM[EC]\hbox{\rm SM}[E\leftrightarrow C] is equivalent to SM[EC]\hbox{\rm SM}[E^{\prime}\leftrightarrow C].

Recall that by Lemma 4, Choice(𝐜)(𝐜^)\hbox{\it Choice\/}({\bf{c}})^{*}({\widehat{\bf{c}}}), which we abbreviate as CC^{*}, is equivalent to

(𝐜pred𝐜^pred)(𝐜func=𝐜^func).({\bf{c}}^{pred}\leq{\widehat{\bf{c}}}^{pred})\land({\bf{c}}^{func}={\widehat{\bf{c}}}^{func}).

On the other hand, 𝐜^<𝐜{\widehat{\bf{c}}}<{\bf{c}} can be equivalently rewritten as

(𝐜^pred<𝐜pred)((𝐜^pred=𝐜pred)(𝐜^func𝐜func)).({\widehat{\bf{c}}}^{pred}<{\bf{c}}^{pred})\lor(({\widehat{\bf{c}}}^{pred}={\bf{c}}^{pred})\land({\widehat{\bf{c}}}^{func}\neq{\bf{c}}^{func})).

It follows that

𝐜^<𝐜(C){\widehat{\bf{c}}}<{\bf{c}}\rightarrow(C^{*}\leftrightarrow\bot)

is logically valid.

It is easy to see that (EC)(E\leftrightarrow C)^{*} can be rewritten as

E(E(𝐜^)C),E\land(E^{*}({\widehat{\bf{c}}})\leftrightarrow C^{*}),

and that E(𝐜^)E^{*}({\widehat{\bf{c}}}) is equivalent to

E(F(𝐜^)G(𝐜^)).E\land(F^{*}({\widehat{\bf{c}}})\leftrightarrow G^{*}({\widehat{\bf{c}}})).

Using these two facts and Lemma 1, we can simplify SM[EC]\hbox{\rm SM}[E\leftrightarrow C] as follows:

SM[EC]\displaystyle\hbox{\rm SM}[E\leftrightarrow C]\ (EC)¬𝐜^((𝐜^<𝐜)E(E(𝐜^)C))\displaystyle\Leftrightarrow(E\leftrightarrow C)\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land E\land(E^{*}({\widehat{\bf{c}}})\leftrightarrow C^{*}))
E¬𝐜^((𝐜^<𝐜)(E(𝐜^)))\displaystyle\Leftrightarrow E\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land(E^{*}({\widehat{\bf{c}}})\leftrightarrow\bot))
E¬𝐜^((𝐜^<𝐜)¬E(𝐜^))\displaystyle\Leftrightarrow E\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land\neg E^{*}({\widehat{\bf{c}}}))
E¬𝐜^((𝐜^<𝐜)¬(F(𝐜^)G(𝐜^)))\displaystyle\Leftrightarrow E\land\neg\exists{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\land\neg(F^{*}({\widehat{\bf{c}}})\leftrightarrow G^{*}({\widehat{\bf{c}}})))
=(FG)𝐜^((𝐜^<𝐜)(F(𝐜^)G(𝐜^))).\displaystyle=(F\leftrightarrow G)\land\forall{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\rightarrow(F^{*}({\widehat{\bf{c}}})\leftrightarrow G^{*}({\widehat{\bf{c}}}))).

Similarly, SM[EC]\hbox{\rm SM}[E^{\prime}\leftrightarrow C] is equivalent to

(FF)𝐜^((𝐜^<𝐜)(F(𝐜^)F(𝐜^))),(F\leftrightarrow F)\land\forall{\widehat{\bf{c}}}(({\widehat{\bf{c}}}<{\bf{c}})\rightarrow(F^{*}({\widehat{\bf{c}}})\leftrightarrow F^{*}({\widehat{\bf{c}}}))),

which is logically valid. Consequently, (9) is logically valid also.  

Theorem 3  Let FF and GG be first-order formulas, let 𝐜{\bf{c}} be the list of all constants occurring in FF or GG, and let 𝐜^\widehat{{\bf{c}}} be a list of distinct predicate and function variables corresponding to 𝐜{\bf{c}}. The following conditions are equivalent to each other.

  • FF and GG are strongly equivalent to each other;

  • Formula

    (FG)(𝐜^<𝐜(F(𝐜^)G(𝐜^)))(F\leftrightarrow G)\land(\widehat{{\bf{c}}}<{\bf{c}}\rightarrow(F^{*}(\widehat{{\bf{c}}})\leftrightarrow G^{*}(\widehat{{\bf{c}}})))

    is logically valid.


Proof.  Immediate from Lemma 6 and Lemma 7.  

B.4 Proof of Theorem 4

Lemma 8

For any first-order sentence FF, any list 𝐜{\bf{c}} of constants, and any interpretations II and JJ such that J<𝐜IJ<^{\bf{c}}I, if IgrI(F)I¯I\models gr_{I}(F)^{\mathit{\underline{I}}} and J⊧̸grI(F)I¯J\not\models gr_{I}(F)^{\mathit{\underline{I}}}, then there is some constant dd occurring strictly positively in FF such that dIdJd^{I}\neq d^{J}.

Proof.  By induction on the structure of FF.   

Lemma 9

If a ground formula FF is negative on a list 𝐜{\bf c} of predicate and function constants, then for every J<𝐜IJ<^{\bf c}I,

JFI iff IF.J\models F^{I}\text{ iff }I\models F.

Proof.  By induction on the structure of FF.   

Theorem 4  For any formula FF in Clark normal form relative to 𝐜{\bf c} that is tight on 𝐜{\bf c}, an interpretation II that satisfies xy(xy)\exists xy(x\neq y) is a model of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] iff II is a model of COMP[F;𝐜]\hbox{\rm COMP}[F;{\bf c}].

Proof.  In this proof, we use Theorem 17 and refer to the reduct-based characterization of a stable model.

()(\Leftarrow) Take an interpretation II that is a model of COMP[F;𝐜]\hbox{\rm COMP}[F;{\bf c}]. II is clearly a model of FF. We wish to show that, for any interpretation JJ such that J<𝐜IJ<^{\bf c}I, we have J⊧̸grI[F]I¯J\not\models gr_{I}[F]^{\mathit{\underline{I}}}. Let SS be a subset of 𝐜{\bf c} consisting of constants cc on which II and JJ disagree, that is, cIcJc^{I}\neq c^{J}. Let s0s_{0} be a constant from SS such that there is no edge in the dependency graph from s0s_{0} to any constant in SS. Such an s0s_{0} is guaranteed to exist since FF is tight on 𝐜{\bf c}.

If s0s_{0} is a predicate, then for some ξ\xi, we have s0(ξ)I=trues_{0}({\bf\xi})^{I}=\hbox{\sc true} and s0(ξ)J=falses_{0}({\bf\xi})^{J}=\hbox{\sc false} by definition of J<𝐜IJ<^{\bf c}I. If s0s_{0} is a function, then for some ξ\xi, we have s0(ξ)I=vs_{0}({\bf\xi})^{I}=v and s0(ξ)Jvs_{0}({\bf\xi})^{J}\neq v.

Since FF is in Clark normal form, there must be a rule in grI[F]gr_{I}[F] of the form Bs0(ξ)B\rightarrow s_{0}({\bf\xi}^{\diamond}) if s0s_{0} is a predicate (Bs0(ξ)=vB\rightarrow s_{0}({\bf\xi}^{\diamond})=v if s0s_{0} is a function) where BB may be \top. Further it must be that IBI\models B since if not, II would not be a model of COMP[F;𝐜]\hbox{\rm COMP}[F;{\bf c}]. Thus, the corresponding rule in grI[F]I¯gr_{I}[F]^{\mathit{\underline{I}}} is BI¯s0(ξ)B^{\mathit{\underline{I}}}\rightarrow s_{0}({\bf\xi}^{\diamond}) (BI¯s0(ξ)=vB^{\mathit{\underline{I}}}\rightarrow s_{0}({\bf\xi}^{\diamond})=v if s0s_{0} is a function).

Now there are two cases to consider:

  • Case 1: JBI¯J\models B^{\mathit{\underline{I}}}. In this case, J⊧̸BI¯s0(ξ)J\not\models B^{\mathit{\underline{I}}}\rightarrow s_{0}({\bf\xi}^{\diamond}) (or J⊧̸BI¯s0(ξ)=vJ\not\models B^{\mathit{\underline{I}}}\rightarrow s_{0}({\bf\xi}^{\diamond})=v if s0s_{0} is a function) and so J⊧̸grI[F]I¯J\not\models gr_{I}[F]^{\mathit{\underline{I}}}.

  • Case 2: J⊧̸BI¯J\not\models B^{\mathit{\underline{I}}}. By Lemma 8, there is a constant dd occurring strictly positively in BB that II and JJ disagree on. However, this means there is an edge from s0s_{0} to dd and since II and JJ disagree on dd, dd belongs to SS which contradicts the fact that s0s_{0} was chosen so that it had no edge to any element in SS. Thus this case cannot arise.

(\Rightarrow) Assume ISM[F;𝐜]I\models\hbox{\rm SM}[F;{\bf c}]. FF can be viewed as the conjunction of 𝐱(H(𝐱)G(𝐱))\forall{\bf x}(H({\bf x})\leftarrow G({\bf x})), where each HH is an atomic formula containing each intensional constant cic_{i}. It is sufficient to prove that I𝐱(H(𝐱)G(𝐱))I\models\forall{\bf x}(H({\bf x})\rightarrow G({\bf x})) for each such formula. Assume for the sake of contradiction that for some formula 𝐱(H(𝐱)G(𝐱))\forall{\bf x}(H({\bf x})\rightarrow G({\bf x})) whose HH contains an intensional constant cc, IH(ξ)I\models H(\xi) and I⊧̸G(ξ)I\not\models G(\xi) for some list ξ\xi of object names.

Consider an interpretation JJ that differs from II only in that J⊧̸H(ξ)J\not\models H(\xi). (Ixy(xy)I\models\exists xy(x\neq y) means there are at least two elements in the universe so this is possible when cc is a function constant.)

  • Clearly, J(H(ξ)G(ξ))I¯J\models(H(\xi)\leftarrow G(\xi))^{\mathit{\underline{I}}} because G(ξ)I¯=G(\xi)^{\mathit{\underline{I}}}=\bot.

  • For other rules H(ξ)G(ξ)H(\xi^{\prime})\leftarrow G(\xi^{\prime}) where ξ\xi^{\prime} is a list of object names different from ξ\xi, clearly, JH(ξ)J\models H(\xi^{\prime}) iff IH(ξ)I\models H(\xi^{\prime}). Since GG is negative on 𝐜{\bf{c}} and J<𝐜IJ<^{\bf{c}}I, by Lemma 9 we have IG(ξ)I\models G(\xi^{\prime}) iff JG(ξ)I¯J\models G(\xi^{\prime})^{\mathit{\underline{I}}}. Since IH(ξ)G(ξ)I\models H(\xi^{\prime})\leftarrow G(\xi^{\prime}), it follows that J(H(ξ)G(ξ))I¯J\models(H(\xi^{\prime})\leftarrow G(\xi^{\prime}))^{\mathit{\underline{I}}}.

  • For all other rules H(ξ)G(ξ)H^{\prime}(\xi)\leftarrow G^{\prime}(\xi) whose HH^{\prime} has an intensional constant different from cc, we have IH(ξ)G(ξ)I\models H^{\prime}(\xi)\leftarrow G^{\prime}(\xi). Since H(ξ)G(ξ)H^{\prime}(\xi)\leftarrow G^{\prime}(\xi) is negative on 𝐜{\bf{c}} and J<𝐜IJ<^{\bf{c}}I, by Lemma 9, we have J(H(ξ)G(ξ))I¯J\models(H^{\prime}(\xi)\leftarrow G^{\prime}(\xi))^{\mathit{\underline{I}}}.

The presence of JJ contradicts that ISM[F;𝐜]I\models\hbox{\rm SM}[F;{\bf c}].  

B.5 Proof of Theorem 5

Theorem 5   The set of formulas consisting of

𝐱(f(𝐱)=1p(𝐱)),\forall{\bf x}(f({\bf x})=1\leftrightarrow p({\bf x})), (34)

and FCf\hbox{\it FC\/}_{f} entails

SM[F;p𝐜]SM[FfpDFf;f𝐜].\hbox{\rm SM}[F;p{\bf c}]\leftrightarrow\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}].

Proof.  For any interpretation II of signature σ{f,p,𝐜}\sigma\supseteq\{f,p,{\bf c}\} satisfying (34), it is clear that IFI\models F iff IFfpDFfI\models F^{p}_{f}\land\hbox{\it DF\/}_{f} since DFf\hbox{\it DF\/}_{f} is a tautology and FfpF^{p}_{f} is equivalent to FF under (34). Thus it only remains to be shown that

Ip^𝐜^((p^𝐜^<p𝐜)F(p^𝐜^))I\models\exists\widehat{p}\widehat{\bf c}((\widehat{p}\widehat{\bf c}<p{\bf c})\land F^{*}(\widehat{p}\widehat{\bf c}))

iff

If^𝐜^((f^𝐜^<f𝐜)(Ffp)(f^𝐜^)DFf(f^𝐜^)).I\models\exists\widehat{f}\widehat{\bf c}((\widehat{f}\widehat{\bf c}<f{\bf c})\land(F^{p}_{f})^{*}(\widehat{f}\widehat{\bf c})\land\hbox{\it DF\/}_{f}^{*}(\widehat{f}\widehat{\bf c})).

Let σ=σ{g,q,𝐝}\sigma^{\prime}=\sigma\cup\{g,q,{\bf{d}}\} be an extended signature such that g,q,𝐝g,q,{\bf{d}} are similar to f,p,𝐜f,p,{\bf{c}} respectively, and do not belong to σ\sigma.

(\Rightarrow) Assume Ip^𝐜^((p^𝐜^<p𝐜)F(p^𝐜^))I\models\exists\widehat{p}\widehat{\bf c}((\widehat{p}\widehat{\bf c}<p{\bf c})\land F^{*}(\widehat{p}\widehat{\bf c})). This is equivalent to saying that there is an interpretation JJ of σ\sigma that agrees with II on all constants other than pp and 𝐜{\bf{c}} such that =Jq𝐝p𝐜I\mathcal{I}=J^{p{\bf{c}}}_{q{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (q𝐝<p𝐜F(q𝐝))(q{\bf d}<p{\bf c}\land F^{*}(q{\bf d})).

It is sufficient to show that there is an interpretation KK of σ\sigma that agrees with JJ on all constants other than ff such that =Kg𝐝f𝐜I\mathcal{I^{\prime}}=K^{f{\bf{c}}}_{g{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (g𝐝<f𝐜(Ffp)(g𝐝)DFf(g𝐝))(g{\bf d}<f{\bf c}\land(F^{p}_{f})^{*}(g{\bf d})\land\hbox{\it DF\/}_{f}^{*}(g{\bf d})). We define the interpretation of KK on ff as follows:

fK(ξ)={1 if pJ(ξ)=true0 otherwise. f^{K}({\vec{\xi}})=\left\{\begin{array}[]{ll}1&\text{ if }p^{J}({\vec{\xi}})=\hbox{\sc true}\\ 0&\text{ otherwise. }\end{array}\right.

We now show g𝐝<f𝐜\mathcal{I^{\prime}}\models g{\bf d}<f{\bf c}:

  • Case 1: (q=p)\mathcal{I}\models(q=p). Since q𝐝<p𝐜\mathcal{I}\models q{\bf d}<p{\bf c}, by definition 𝐝pred𝐜pred\mathcal{I}\models{\bf d}^{pred}\leq{\bf c}^{pred} and ¬(q𝐝=p𝐜)\mathcal{I}\models\neg(q{\bf d}=p{\bf c}) and since in this case, (q=p)\mathcal{I}\models(q=p), it must be that ¬(𝐝=𝐜)\mathcal{I}\models\neg({\bf d}={\bf c}). From this, we conclude ¬(g𝐝=f𝐜)\mathcal{I^{\prime}}\models\neg(g{\bf d}=f{\bf c}). Further, since 𝐝pred𝐜pred\mathcal{I^{\prime}}\models{\bf d}^{pred}\leq{\bf c}^{pred}, we conclude g𝐝<f𝐜\mathcal{I^{\prime}}\models g{\bf d}<f{\bf c}.

  • Case 2: ¬(q=p)\mathcal{I}\models\neg(q=p). Since q𝐝<p𝐜\mathcal{I}\models q{\bf d}<p{\bf c}, by definition, 𝐝pred𝐜pred\mathcal{I}\models{\bf d}^{pred}\leq{\bf c}^{pred} and (qp)\mathcal{I}\models(q\leq p). Thus, since in this case ¬(q=p)\mathcal{I}\models\neg(q=p), it must be that 𝐱(p(𝐱)¬q(𝐱))\mathcal{I}\models\exists{\bf x}(p({\bf x})\land\neg q({\bf x})). From the definition of fKf^{K} and from (34), this is equivalent to 𝐱(f(𝐱)=1g(𝐱)=0)\mathcal{I^{\prime}}\models\exists{\bf x}(f({\bf x})=1\land g({\bf x})=0). Thus, we conclude ¬(f=g)\mathcal{I^{\prime}}\models\neg(f=g) and since 𝐝pred𝐜pred\mathcal{I^{\prime}}\models{\bf d}^{pred}\leq{\bf c}^{pred}, we further conclude that g𝐝<f𝐜\mathcal{I^{\prime}}\models g{\bf d}<f{\bf c}.

We now show DFf(g𝐝)\mathcal{I^{\prime}}\models\hbox{\it DF\/}_{f}^{*}(g{\bf d}):
Since q𝐝<p𝐜\mathcal{I}\models q{\bf d}<p{\bf c}, by definition, (qp)\mathcal{I}\models(q\leq p), or equivalently 𝐱(q(𝐱)p(𝐱))\mathcal{I}\models\forall{\bf x}(q({\bf x})\rightarrow p({\bf x})) and by contraposition, 𝐱(¬p(𝐱)¬q(𝐱))\mathcal{I}\models\forall{\bf x}(\neg p({\bf x})\rightarrow\neg q({\bf x})). Finally, by (34),FCfFC_{f}, and the definition of fKf^{K}, 𝐱(f(𝐱)=0g(𝐱)=0)\mathcal{I^{\prime}}\models\forall{\bf x}(f({\bf x})=0\rightarrow g({\bf x})=0) or simply DFf(g𝐝)\mathcal{I^{\prime}}\models\hbox{\it DF\/}_{f}^{*}(g{\bf d}).

We now show (Ffp)(g𝐝)\mathcal{I^{\prime}}\models(F^{p}_{f})^{*}(g{\bf d}) by proving the following:

Claim: F(q𝐝)\mathcal{I}\models F^{*}(q{\bf d}) iff (Ffp)(g𝐝)\mathcal{I^{\prime}}\models(F^{p}_{f})^{*}(g{\bf d}).

The proof of the claim is by induction on the structure of FF.

  • Case 1: FF is an atomic formula not containing pp. FfpF^{p}_{f} is exactly FF thus F(q𝐝)F^{*}(q{\bf d}) is exactly (Ffp)(g𝐝)(F^{p}_{f})^{*}(g{\bf d}) so certainly the claim holds.

  • Case 2: FF is p(𝐭)p({\bf t}) where 𝐭{\bf t} contains an intensional function constant from 𝐜{\bf c}. F(q𝐝)F^{*}(q{\bf d}) is p(𝐭)q(𝐭)p({\bf t})\land q({\bf t^{\prime}}) where 𝐭{\bf t^{\prime}} is the result of replacing all intensional functions from 𝐜{\bf c} occurring in 𝐭{\bf t} with the corresponding function from 𝐝{\bf d}. Since FfpF^{p}_{f} is f(𝐭)=1f({\bf t})=1, formula (Ffp)(g𝐝)(F^{p}_{f})^{*}(g{\bf d}) is f(𝐭)=1g(𝐭)=1f({\bf t})=1\land g({\bf t^{\prime}})=1. The claim follows from (34) and the definition of fKf^{K}.

  • Case 3: FF is p(𝐭)p({\bf t}) where 𝐭{\bf t} does not contain any intensional function constant from 𝐜{\bf c}. F(q𝐝)F^{*}(q{\bf d}) is q(𝐭)q({\bf t}). Since FfpF^{p}_{f} is f(𝐭)=1f({\bf t})=1, formula (Ffp)(g𝐝)(F^{p}_{f})^{*}(g{\bf d}) is f(𝐭)=1g(𝐭)=1f({\bf t})=1\land g({\bf t})=1. Since (qp)\mathcal{I}\models(q\leq p), if q(𝐭)\mathcal{I}\models q({\bf t}), then p(𝐭)\mathcal{I}\models p({\bf t}). The claim follows from (34) and the definition of fKf^{K}.

  • The other cases are straightforward from I.H.

(\Leftarrow) Assume If^𝐜^((f^𝐜^<f𝐜)(Ffp)(f^𝐜^)DFf(f^𝐜^))I\models\exists\widehat{f}\widehat{\bf c}((\widehat{f}\widehat{\bf c}<f{\bf c})\land(F^{p}_{f})^{*}(\widehat{f}\widehat{\bf c})\land\hbox{\it DF\/}_{f}^{*}(\widehat{f}\widehat{\bf c})). This is equivalent to saying that there is an interpretation JJ of σ\sigma that agrees with II on all constants other than ff and 𝐜{\bf{c}} such that =Jg𝐝f𝐜I{\mathcal{I}}=J^{f{\bf{c}}}_{g{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (g𝐝<f𝐜)(Ffp)(f𝐜)DFf(f𝐜)(g{\bf{d}}<f{\bf{c}})\land(F^{p}_{f})^{*}(f{\bf{c}})\land\hbox{\it DF\/}_{f}^{*}(f{\bf{c}}).

It is sufficient to show that there is an interpretation KK of σ\sigma that agrees with JJ on all constants other than pp such that =Kq𝐝p𝐜I\mathcal{I^{\prime}}=K^{p{\bf{c}}}_{q{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (q𝐝<p𝐜F(q𝐝)(q{\bf d}<p{\bf c}\land F^{*}(q{\bf d}). We define the interpretation of KK on pp as follows:

pK(ξ)={true if fJ(ξ)=1falseotherwise.p^{K}({\vec{\xi}})=\left\{\begin{array}[]{lll}\hbox{\sc true}&&\text{ if }f^{J}({\vec{\xi}})=1\\ \hbox{\sc false}&&\text{otherwise}.\end{array}\right.

We now show q𝐝<p𝐜\mathcal{I^{\prime}}\models q{\bf d}<p{\bf c}:

  • Case 1: (g=f)\mathcal{I}\models(g=f). By definition of pKp^{K} and by (34), in this case, q=p\mathcal{I}\models q=p and in particular, qp\mathcal{I}\models q\leq p. Since g𝐝<f𝐜\mathcal{I}\models g{\bf d}<f{\bf c}, by definition 𝐝pred𝐜pred\mathcal{I}\models{\bf d}^{pred}\leq{\bf c}^{pred} and ¬(g𝐝=f𝐜)\mathcal{I}\models\neg(g{\bf d}=f{\bf c}) and since in this case, (g=f)\mathcal{I}\models(g=f), it must be that ¬(𝐝=𝐜)\mathcal{I}\models\neg({\bf d}={\bf c}). From this, we conclude ¬(q𝐝=p𝐜)\mathcal{I^{\prime}}\models\neg(q{\bf d}=p{\bf c}). Further, since 𝐝pred𝐜pred\mathcal{I^{\prime}}\models{\bf{d}}^{pred}\leq{\bf{c}}^{pred}, we conclude q𝐝<p𝐜\mathcal{I^{\prime}}\models q{\bf d}<p{\bf c}.

  • Case 2: ¬(g=f)\mathcal{I}\models\neg(g=f). Since DFf(g𝐝)\mathcal{I}\models\hbox{\it DF\/}_{f}^{*}(g{\bf d}), it must be that 𝐱(f(𝐱)=0g(𝐱)=0)\mathcal{I}\models\forall{\bf x}(f({\bf x})=0\rightarrow g({\bf x})=0). From this, we conclude by definition of pKp^{K}, FCf\hbox{\it FC\/}_{f} (note that 010\neq 1 is essential here) and (34) that 𝐱(¬p(𝐱)¬q(𝐱))\mathcal{I^{\prime}}\models\forall{\bf x}(\neg p({\bf x})\rightarrow\neg q({\bf x})). Equivalently, this is 𝐱(q(𝐱)p(𝐱))\mathcal{I^{\prime}}\models\forall{\bf x}(q({\bf x})\rightarrow p({\bf x})) or simply qp\mathcal{I^{\prime}}\models q\leq p.

    Now, since FCf\mathcal{I}\models FC_{f}, then 𝐱(f(𝐱)=0f(𝐱)=1)\mathcal{I}\models\forall{\bf x}(f({\bf x})=0\lor f({\bf x})=1). Thus, for the assumption in this case that ¬(g=f)\mathcal{I}\models\neg(g=f) to hold, it must be that 𝐱(f(𝐱)=1¬(g(𝐱)=1))\mathcal{I}\models\exists{\bf x}(f({\bf x})=1\land\neg(g({\bf x})=1)). By defintion of pKp^{K} and (34), it follows that 𝐱(p(𝐱)¬q(𝐱))\mathcal{I^{\prime}}\models\exists{\bf x}(p({\bf x})\land\neg q({\bf x})). Thus, since ¬(q=p)\mathcal{I^{\prime}}\models\neg(q=p), then ¬(q𝐝=p𝐜)\mathcal{I^{\prime}}\models\neg(q{\bf d}=p{\bf c}). Also, since g𝐝<f𝐜\mathcal{I}\models g{\bf d}<f{\bf c}, by definition 𝐝pred𝐜pred\mathcal{I^{\prime}}\models{\bf d}^{pred}\leq{\bf c}^{pred}, and thus we conclude that q𝐝<p𝐜\mathcal{I^{\prime}}\models q{\bf d}<p{\bf c}.

The proof of F(q𝐝)\mathcal{I^{\prime}}\models F^{*}(q{\bf d}) is by induction similar to the proof of the claim above.   

B.6 Proof of Corollary 6

For two interpretations II of signature σ1\sigma_{1} and JJ of signature σ2\sigma_{2}, by IJI\cup J we denote the interpretation of signature σ1σ2\sigma_{1}\cup\sigma_{2} and universe |I||J||I|\cup|J| that interprets all symbols occurring only in σ1\sigma_{1} in the same way II does and similarly for σ2\sigma_{2} and JJ. For symbols appearing in both σ1\sigma_{1} and σ2\sigma_{2}, II must interpret these the same as JJ does, in which case IJI\cup J also interprets the symbol in this way.

Corollary 6

  • (a)

    An interpretation II of the signature of FF is a model of SM[F;p𝐜]\hbox{\rm SM}[F;p{\bf c}] iff IfpI^{p}_{f} is a model of SM[FfpDFfFCf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}].

  • (b)

    An interpretation JJ of the signature of FfpF^{p}_{f} is a model of SM[FfpDFfFCf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}] iff J=IfpJ=I^{p}_{f} for some model II of SM[F;p𝐜]\hbox{\rm SM}[F;p{\bf c}].

Proof.

(a\Rightarrow) Assume II of the signature of FF is a model of SM[F;p𝐜]\hbox{\rm SM}[F;p{\bf c}]. By definition of IfpI^{p}_{f}, IIfp𝐱(f(𝐱)=1p(𝐱))FCfI\cup I^{p}_{f}\models\forall{\bf x}(f({\bf x})=1\leftrightarrow p({\bf x}))\land\hbox{\it FC\/}_{f}. Since ISM[F;p𝐜]I\models\hbox{\rm SM}[F;p{\bf c}], it must be that IIfpSM[F;p𝐜]I\cup I^{p}_{f}\models\hbox{\rm SM}[F;p{\bf c}] and further by Theorem 5, IIfpSM[FfpDFf;f𝐜]I\cup I^{p}_{f}\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}]. By Theorem 1, we have IIfpSM[FfpDFfFCf;f𝐜]I\cup I^{p}_{f}\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}]. Finally, since the signature of II does not contain ff, we conclude IfpSM[FfpDFfFCf;f𝐜]I^{p}_{f}\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}].

(a\Leftarrow) Assume IfpI^{p}_{f} is a model of SM[FfpDFfFCf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}]. By Theorem 1, IfpI^{p}_{f} is a model of SM[FfpDFf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}]. By definition of IfpI^{p}_{f}, IIfp𝐱(f(𝐱)=1p(𝐱))FCfI\cup I^{p}_{f}\models\forall{\bf x}(f({\bf x})=1\leftrightarrow p({\bf x}))\land\hbox{\it FC\/}_{f}. Since IfpSM[FfpDFf;f𝐜]I^{p}_{f}\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}], it must be that IIfpSM[FfpDFf;f𝐜]I\cup I^{p}_{f}\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}] and further by Theorem 5, IIfpSM[F;p𝐜]I\cup I^{p}_{f}\models\hbox{\rm SM}[F;p{\bf c}]. Finally, since the signature of IfpI^{p}_{f} does not contain pp, we conclude ISM[F;p𝐜]I\models\hbox{\rm SM}[F;p{\bf c}].

(b\Rightarrow) Assume an interpretation JJ of the signature of FfpF^{p}_{f} is a model of SM[FfpDFfFCf;f𝐜]\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}]. Let I=JpfI=J^{f}_{p}, where JpfJ^{f}_{p} denotes the interpretation of the signature FF obtained from JJ by replacing fJf^{J} with the set pIp^{I} that consists of the tuples ξ1,,ξn\langle\xi_{1},\dots,\xi_{n}\rangle for all ξ1,,ξn\xi_{1},\dots,\xi_{n} from the universe of JJ such that fJ(ξ1,,ξn)=1f^{J}(\xi_{1},\dots,\xi_{n})=1. By definition of II, IJ𝐱(f(𝐱)=1p(𝐱))I\cup J\models\forall{\bf x}(f({\bf x})=1\leftrightarrow p({\bf x})). Since JSM[FfpFCfDFf;f𝐜]J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it FC\/}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}], it must be that IJSM[FfpDFfFCf;f𝐜]I\cup J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}]. Since FCf\hbox{\it FC\/}_{f} is comprised of constraints, by Theorem 1, IJSM[FfpDFf;f𝐜]FCfI\cup J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}]\land\hbox{\it FC\/}_{f}. In particular, IJSM[FfpDFf;f𝐜]I\cup J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}] and further by Theorem 5, IJSM[F;p𝐜]I\cup J\models\hbox{\rm SM}[F;p{\bf c}]. Finally, since the signature of JJ does not contain pp, we conclude ISM[F;p𝐜]I\models\hbox{\rm SM}[F;p{\bf c}].

(b\Leftarrow) Take any II such that J=IfpJ=I^{p}_{f} and ISM[F;p𝐜]I\models\hbox{\rm SM}[F;p{\bf c}]. By definition of IfpI^{p}_{f}, IJ𝐱(f(𝐱)=1p(𝐱))FCfI\cup J\models\forall{\bf x}(f({\bf x})=1\leftrightarrow p({\bf x}))\land\hbox{\it FC\/}_{f}. Since ISM[F;p𝐜]I\models\hbox{\rm SM}[F;p{\bf c}], it must be that IJSM[F;p𝐜]I\cup J\models\hbox{\rm SM}[F;p{\bf c}] and further by Theorem 5, IJSM[FfpDFf;f𝐜]I\cup J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}]. Since the signature of II does not contain ff, we conclude JSM[FfpDFf;f𝐜]J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f};f{\bf c}]. Finally, since by definition of IfpI^{p}_{f}, JFCfJ\models\hbox{\it FC\/}_{f}, and since FCf\hbox{\it FC\/}_{f} is comprised of constraints, by Theorem 1 we conclude JSM[FfpDFfFCf;f𝐜]J\models\hbox{\rm SM}[F^{p}_{f}\land\hbox{\it DF\/}_{f}\land\hbox{\it FC\/}_{f};f{\bf c}].   

B.7 Proof of Theorem 7

Theorem 7   For any ff-plain formula FF, the set of formulas consisting of

𝐱y(p(𝐱,y)f(𝐱)=y)\forall{\bf x}y(p({\bf x},y)\leftrightarrow f({\bf x})=y) (35)

and xy(xy)\exists xy(x\neq y) entails

SM[F;f𝐜]SM[Fpf;p𝐜].\hbox{\rm SM}[F;f{\bf c}]\leftrightarrow\hbox{\rm SM}[F^{f}_{p};p{\bf c}].

Proof.  For any interpretation II of signature σ{f,p,𝐜}\sigma\supseteq\{f,p,{\bf c}\} satisfying (35), it is clear that IFI\models F iff IFpfI\models F^{f}_{p} since FpfF^{f}_{p} is simply the result of replacing all f(𝐱)=yf({\bf x})=y with p(𝐱,y)p({\bf x},y). Thus it only remains to be shown that

If^𝐜^((f^𝐜^<f𝐜)F(f^𝐜^))I\models\exists\widehat{f}\widehat{\bf c}((\widehat{f}\widehat{\bf c}<f{\bf c})\land F^{*}(\widehat{f}\widehat{\bf c}))

iff

Ip^𝐜^((p^𝐜^<p𝐜)(Fpf)(p^𝐜^)).I\models\exists\widehat{p}\widehat{\bf c}((\widehat{p}\widehat{\bf c}<p{\bf c})\land(F^{f}_{p})^{*}(\widehat{p}\widehat{\bf c})).

Let σ=σ{g,q,𝐝}\sigma^{\prime}=\sigma\cup\{g,q,{\bf{d}}\} be an extended signature such that g,q,𝐝g,q,{\bf{d}} are similar to f,p,𝐜f,p,{\bf{c}} respectively, and do not belong to σ\sigma.

(\Rightarrow) Assume If^𝐜^((f^𝐜^<f𝐜)F(f^,𝐜^))I\models\exists\widehat{f}\widehat{\bf c}((\widehat{f}\widehat{\bf c}<f{\bf c})\land F^{*}(\widehat{f},\widehat{\bf c})). This is equivalent to saying that there is an interpretation JJ of σ\sigma that agrees with II on all constants other than ff and 𝐜{\bf{c}} such that =Jg𝐝f𝐜I\mathcal{I}=J^{f{\bf{c}}}_{g{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (g𝐝<f𝐜)F(g𝐝)(g{\bf{d}}<f{\bf{c}})\land F^{*}(g{\bf{d}}).

It is sufficient to show that there is an interpretation KK of σ\sigma that agrees with JJ on all constants other than pp such that =Kq𝐝p𝐜I\mathcal{I^{\prime}}=K^{p{\bf{c}}}_{q{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (q𝐝<p𝐜)(Fpf)(q𝐝)(q{\bf d}<p{\bf c})\land(F^{f}_{p})^{*}(q{\bf{d}}). We define the interpretation of KK on pp as follows:

pK(ξ,ξ)={true if f(ξ)=ξg(ξ)=ξfalseotherwise.p^{K}({\vec{\xi}},\xi^{\prime})=\left\{\begin{array}[]{lll}\hbox{\sc true}&&\text{ if }\mathcal{I}\models f({\vec{\xi}})=\xi^{\prime}\land g({\vec{\xi}})=\xi^{\prime}\\ \hbox{\sc false}&&\text{otherwise}.\end{array}\right.

We first show that if (g𝐝<f𝐜)\mathcal{I}\models(g{\bf d}<f{\bf c}) then (q𝐝<p𝐜)\mathcal{I^{\prime}}\models(q{\bf d}<p{\bf c}):
Observe that from the definition of pKp^{K}, it follows that 𝐱y(q(𝐱,y)f(𝐱)=y)\mathcal{I}\models\forall{\bf x}y(q({\bf x},y)\rightarrow f({\bf x})=y) and from (35), this is equivalent to 𝐱y(q(𝐱,y)p(𝐱,y))\forall{\bf x}y(q({\bf x},y)\rightarrow p({\bf x},y)) or simply qpq\leq p. Thus, since 𝐝pred𝐜pred\mathcal{I^{\prime}}\models{\bf{d}}^{pred}\leq{\bf{c}}^{pred}, we have q𝐝predp𝐜pred\mathcal{I^{\prime}}\models q{\bf{d}}^{pred}\leq p{\bf{c}}^{pred}.

  • Case 1: 𝐱y(f(𝐱)=yg(𝐱)=y)\mathcal{I}\models\forall{\bf x}y(f({\bf x})=y\leftrightarrow g({\bf x})=y).
    In this case it then must be the case that 𝐝𝐜\mathcal{I}\models{\bf d}\neq{\bf c}. Thus it follows that q𝐝p𝐜\mathcal{I^{\prime}}\models q{\bf d}\neq p{\bf c}. Consequently, we conclude that

    (q𝐝predp𝐜pred)q𝐝p𝐜\mathcal{I^{\prime}}\models(q{\bf{d}}^{pred}\leq p{\bf{c}}^{pred})\land q{\bf d}\neq p{\bf c}

    or simply, (q𝐝<p𝐜)\mathcal{I^{\prime}}\models(q{\bf d}<p{\bf c}).

  • Case 2: ¬𝐱y(f(𝐱)=yg(𝐱)=y)\mathcal{I}\models\neg\forall{\bf x}y(f({\bf x})=y\leftrightarrow g({\bf x})=y).
    In this case it then must be the case that for some 𝐭{\bf t} and cc that f(𝐭)=cg(𝐭)c\mathcal{I}\models f({\bf t})=c\land g({\bf t})\neq c. By the definition of pKp^{K}, this means that q(𝐭,c)=falseq({\bf t},c)^{\mathcal{I^{\prime}}}=\hbox{\sc false} but by (35), p(𝐭,c)=truep({\bf t},c)^{\mathcal{I^{\prime}}}=\hbox{\sc true}. Therefore, pq\mathcal{I^{\prime}}\models p\neq q and thus q𝐝p𝐜\mathcal{I^{\prime}}\models q{\bf d}\neq p{\bf c}. Consequently, we conclude

    (q𝐝predp𝐜pred)q𝐝p𝐜\mathcal{I^{\prime}}\models(q{\bf{d}}^{pred}\leq p{\bf{c}}^{pred})\land q{\bf d}\neq p{\bf c}

    or simply, (q𝐝<p𝐜)\mathcal{I^{\prime}}\models(q{\bf d}<p{\bf c}).

We now show that (Fpf)(q𝐝)\mathcal{I}\models(F^{f}_{p})^{*}(q{\bf d}) by proving the following:

Claim: F(g𝐝)\mathcal{I}\models F^{*}(g{\bf d}) iff (Fpf)(q𝐝)\mathcal{I^{\prime}}\models(F^{f}_{p})^{*}(q{\bf d})

The proof of the claim is by induction on the structure of FF.

  • Case 1: FF is an atomic formula not containing ff. FpfF^{f}_{p} is exactly FF thus F(g𝐝)F^{*}(g{\bf d}) is exactly (Fpf)(q𝐝)(F^{f}_{p})^{*}(q{\bf d}) so certainly the claim holds.

  • Case 2: FF is f(𝐭)=t1f({\bf t})=t_{1}. F(g𝐝)F^{*}(g{\bf d}) is f(𝐭)=t1g(𝐭)=t1f({\bf t})=t_{1}\land g({\bf t})=t_{1}. FpfF^{f}_{p} is p(𝐭,t1)p({\bf t},t_{1}) and (Fpf)(q𝐝)(F^{f}_{p})^{*}(q{\bf d}) is q(𝐭,t1)q({\bf t},t_{1}). By the definition of pKp^{K}, it is clear that f(𝐭)=t1g(𝐭)=t1\mathcal{I}\models f({\bf t})=t_{1}\land g({\bf t})=t_{1} iff q(𝐭,t1)\mathcal{I^{\prime}}\models q({\bf t},t_{1}), so certainly the claim holds.

  • The other cases are straightforward from I.H.

(\Leftarrow) Assume p^𝐜^((p^𝐜^<p𝐜)(Fpf)(p^𝐜^))\mathcal{I}\models\exists\widehat{p}\widehat{\bf c}((\widehat{p}\widehat{\bf c}<p{\bf c})\land(F^{f}_{p})^{*}(\widehat{p}\widehat{\bf c})). This is equivalent to saying that there is an interpretation JJ of σ\sigma that agrees with II on all constants other than pp and 𝐜{\bf{c}} such that =Jq𝐝p𝐜I\mathcal{I}=J^{p{\bf{c}}}_{q{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (q𝐝<p𝐜)(Fpf)(q𝐝)(q{\bf{d}}<p{\bf{c}})\land(F^{f}_{p})^{*}(q{\bf{d}}).

It is sufficient to show that there is an interpretation KK of σ\sigma that agrees with JJ on all constants other than ff such that =Kg𝐝f𝐜I\mathcal{I^{\prime}}=K^{f{\bf{c}}}_{g{\bf{d}}}\cup I of signature σ\sigma^{\prime} satisfies (g𝐝<f𝐜)F(g𝐝)(g{\bf{d}}<f{\bf{c}})\land F^{*}(g{\bf{d}}). We define the interpretation of KK on ff as follows:

fK(ξ)={ξ if p(ξ,ξ)q(ξ,ξ)ξ′′ if p(ξ,ξ)¬q(ξ,ξ) where ξξ′′.f^{K}({\vec{\xi}})=\left\{\begin{array}[]{lll}\xi^{\prime}&&\text{ if }\mathcal{I}\models p({\vec{\xi}},\xi^{\prime})\land q({\vec{\xi}},\xi^{\prime})\\ \xi^{\prime\prime}&&\text{ if }\mathcal{I}\models p({\vec{\xi}},\xi^{\prime})\land\neg q({\vec{\xi}},\xi^{\prime})\text{ where }\xi^{\prime}\neq\xi^{\prime\prime}.\end{array}\right.

Note that the assumption that there are at least two elements in the universe is essential to this definition. This definition is sound due to (35)(\ref{fpequiv}) entailing ξξ(p(ξ,ξ))\forall{\vec{\xi}}\exists\xi^{\prime}(p(\vec{\xi},\xi^{\prime})).

We first show if (q𝐝<p𝐜)\mathcal{I}\models(q{\bf d}<p{\bf c}) then (g𝐝<f𝐜)\mathcal{I^{\prime}}\models(g{\bf d}<f{\bf c}):
Observe that (q𝐝<p𝐜)\mathcal{I}\models(q{\bf d}<p{\bf c}) by definition entails (q𝐝predp𝐜pred)\mathcal{I}\models(q{\bf d}^{pred}\leq p{\bf c}^{pred}) and further by definition, (𝐝pred𝐜pred)\mathcal{I}\models({\bf d}^{pred}\leq{\bf c}^{pred}) and then since ff and gg are not predicates, ((g𝐝)pred(f𝐜)pred)\mathcal{I^{\prime}}\models((g{\bf d})^{pred}\leq(f{\bf c})^{pred}).

  • Case 1: 𝐱y(p(𝐱,y)q(𝐱,y))\mathcal{I}\models\forall{\bf x}y(p({\bf x},y)\leftrightarrow q({\bf x},y)). In this case, (p=q)\mathcal{I}\models(p=q) so for it to be the case that (q𝐝<p𝐜)\mathcal{I}\models(q{\bf d}<p{\bf c}), it must be that ¬(𝐜=𝐝)\mathcal{I}\models\neg({\bf c}={\bf d}). It then follows that ¬(f𝐜=g𝐝)\mathcal{I^{\prime}}\models\neg(f{\bf c}=g{\bf d}). Consequently, in this case, ((g𝐝)pred(f𝐜)pred)¬(f𝐜=g𝐝)\mathcal{I^{\prime}}\models((g{\bf d})^{pred}\leq(f{\bf c})^{pred})\land\neg(f{\bf c}=g{\bf d}) or simply (g𝐝<f𝐜)\mathcal{I^{\prime}}\models(g{\bf d}<f{\bf c}).

  • Case 2: ¬𝐱y(p(𝐱,y)q(𝐱,y))\mathcal{I}\models\neg\forall{\bf x}y(p({\bf x},y)\leftrightarrow q({\bf x},y)). In this case, since (qp)\mathcal{I}\models(q\leq p), then it follows that 𝐱y(p(𝐱,y)¬q(𝐱,y))\exists{\bf x}y(p({\bf x},y)\land\neg q({\bf x},y)). It follows from the definition of pKp^{K} that 𝐱yz((p(𝐱,y)g(𝐱)=z)yz)\mathcal{I^{\prime}}\models\exists{\bf x}yz((p({\bf x},y)\leftrightarrow g({\bf x})=z)\land y\neq z) and then from (35), it follows that 𝐱yz((f(𝐱)=yg(𝐱)=z)yz)\mathcal{I^{\prime}}\models\exists{\bf x}yz((f({\bf x})=y\leftrightarrow g({\bf x})=z)\land y\neq z) or simply fg\mathcal{I^{\prime}}\models f\neq g. It then follows that ¬(f𝐜=g𝐝)\mathcal{I^{\prime}}\models\neg(f{\bf c}=g{\bf d}). Consequently, in this case ((g𝐝)pred(f𝐜)pred)¬(f𝐜=g𝐝)\mathcal{I^{\prime}}\models((g{\bf d})^{pred}\leq(f{\bf c})^{pred})\land\neg(f{\bf c}=g{\bf d}) or simply (g𝐝<f𝐜)\mathcal{I^{\prime}}\models(g{\bf d}<f{\bf c}).

Next, the proof of F(g𝐝)\mathcal{I^{\prime}}\models F^{*}(g{\bf d}) is by induction similar to the proof of the claim above.

B.8 Proof of Corollary 8

Corollary 8  Let FF be an ff-plain sentence.

  • (a)

    An interpretation II of the signature of FF that satisfies xy(xy)\exists xy(x\neq y) is a model of SM[F;f𝐜]\hbox{\rm SM}[F;f{\bf c}] iff IpfI^{f}_{p} is a model of SM[FpfUECp;p𝐜]\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};\ p{\bf c}].

  • (b)

    An interpretation JJ of the signature of FpfF^{f}_{p} that satisfies xy(xy)\exists xy(x\neq y) is a model of SM[FpfUECp;p𝐜]\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};\ p{\bf c}] iff J=IpfJ=I^{f}_{p} for some model II of SM[F;f𝐜]\hbox{\rm SM}[F;f{\bf c}].

Proof.

(a\Rightarrow) Assume ISM[F;f𝐜]xy(xy)I\models\hbox{\rm SM}[F;f{\bf c}]\land\exists xy(x\neq y). Since Ixy(xy)I\models\exists xy(x\neq y), IIpfxy(xy)I\cup I^{f}_{p}\models\exists xy(x\neq y) since by definition of IpfI^{f}_{p}, II and IpfI^{f}_{p} share the same universe.

By definition of IpfI^{f}_{p}, IIpf(35)I\cup I^{f}_{p}\models(\ref{fpequiv}). Since ISM[F;f𝐜]I\models\hbox{\rm SM}[F;f{\bf c}], we have IIpfSM[F;f𝐜]I\cup I^{f}_{p}\models\hbox{\rm SM}[F;f{\bf c}] and by Theorem 7, we have IIpfSM[Fpf;p𝐜]I\cup I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}]. It’s clear that IUECpI\models\hbox{\it UEC\/}_{p}, so by Theorem 1, we have IIpfSM[FpfUECp;p𝐜]I\cup I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};p{\bf{c}}]. Since the signature of II does not contain ff, we conclude IpfSM[FpfUECp;p𝐜]I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};p{\bf{c}}].

(a\Leftarrow) Assume Ixy(xy)I\models\exists xy(x\neq y) and IpfSM[FpfUECp;p𝐜]I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};p{\bf c}]. By Theorem 1, IpfSM[Fpf;p𝐜]I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p};p{\bf{c}}]. Since Ixy(xy)I\models\exists xy(x\neq y), we have IIpfxy(xy)I\cup I^{f}_{p}\models\exists xy(x\neq y) since by definition of IpfI^{f}_{p}, II and IpfI^{f}_{p} share the same universe.

By definition of IpfI^{f}_{p}, IIpf(35)I\cup I^{f}_{p}\models(\ref{fpequiv}). Since IpfSM[Fpf;p𝐜]I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}], we have IIpfSM[Fpf;p𝐜]I\cup I^{f}_{p}\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}] and by Theorem 7, we have IIpfSM[F;f𝐜]I\cup I^{f}_{p}\models\hbox{\rm SM}[F;f{\bf c}]. Since the signature of IpfI^{f}_{p} does contain ff, we conclude ISM[F;f𝐜]I\models\hbox{\rm SM}[F;f{\bf c}].

(b\Rightarrow) Assume Jxy(xy)J\models\exists xy(x\neq y) and JSM[FpfUECp;p𝐜]J\models\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};p{\bf c}]. Let I=JfpI=J^{p}_{f} where JfpJ^{p}_{f} denotes the interpretation of the signature of FF obtained from JJ by replacing the set pJp^{J} with the function fIf^{I} such that fI(ξ1,,ξk)=ξk+1f^{I}(\xi_{1},\dots,\xi_{k})=\xi_{k+1} for all tuples ξ1,,ξk,ξk+1\langle\xi_{1},\dots,\xi_{k},\xi_{k+1}\rangle in pJp^{J}. This is a valid definition of a function since we assume JSM[FpfUECp;p𝐜]J\models\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};p{\bf c}], from which we obtain by Theorem 1 that JSM[Fpf;p𝐜]UECpJ\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}]\land\hbox{\it UEC\/}_{p} and specifically, JUECpJ\models\hbox{\it UEC\/}_{p}. Clearly, J=IpfJ=I^{f}_{p} so it only remains to be shown that ISM[F;f𝐜]I\models\hbox{\rm SM}[F;f{\bf c}].

Since II and JJ have the same universe and Jxy(xy)J\models\exists xy(x\neq y), it follows that IJxy(xy)I\cup J\models\exists xy(x\neq y). Also by the definition of JfpJ^{p}_{f}, we have IJ(35)I\cup J\models(\ref{fpequiv}). Thus by Theorem 7, IJSM[F;f𝐜]SM[Fpf;p𝐜]I\cup J\models\hbox{\rm SM}[F;f{\bf c}]\leftrightarrow\hbox{\rm SM}[F^{f}_{p};p{\bf c}].

Since we assume JSM[Fpf;p𝐜]J\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}], it is the case that IJSM[Fpf;p𝐜]I\cup J\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}] and thus it must be the case that IJSM[F;f𝐜]I\cup J\models\hbox{\rm SM}[F;f{\bf c}]. Now since the signature of JJ does not contain ff, we conclude ISM[F;f𝐜]I\models\hbox{\rm SM}[F;f{\bf c}].

(b\Leftarrow)Take any II such that J=IpfJ=I^{f}_{p} and ISM[F;f𝐜]I\models\hbox{\rm SM}[F;f{\bf c}]. Since Jxy(xy)J\models\exists xy(x\neq y) and II and JJ share the same universe, IJxy(xy)I\cup J\models\exists xy(x\neq y). By definition of J=IpfJ=I^{f}_{p}, IJ(35)I\cup J\models(\ref{fpequiv}). Thus by Theorem 7, IJSM[F;f𝐜]SM[Fpf;p𝐜]I\cup J\models\hbox{\rm SM}[F;f{\bf c}]\leftrightarrow\hbox{\rm SM}[F^{f}_{p};p{\bf c}].

Since we assume ISM[F;f𝐜]I\models\hbox{\rm SM}[F;f{\bf c}], it is the case that IJSM[F;f𝐜]I\cup J\models\hbox{\rm SM}[F;f{\bf c}] and thus it must be the case that IJSM[Fpf;p𝐜]I\cup J\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}]. Further, due to the nature of functions, (35) entails UECp\hbox{\it UEC\/}_{p} so IJUECpI\cup J\models\hbox{\it UEC\/}_{p}. However since the signature of II does not contain pp, we conclude JSM[Fpf;p𝐜]UECpJ\models\hbox{\rm SM}[F^{f}_{p};p{\bf c}]\land\hbox{\it UEC\/}_{p} and since UECp\hbox{\it UEC\/}_{p} is comprised of constraints only, by Theorem 1 JSM[FpfUECp;p𝐜]J\models\hbox{\rm SM}[F^{f}_{p}\land\hbox{\it UEC\/}_{p};p{\bf c}].   

B.9 Proof of Theorem 9

Theorem 9  For any head-𝐜{\bf{c}}-plain sentence FF that is tight on 𝐜{\bf{c}} and any interpretation II satisfying xy(xy)\exists xy(x\neq y), we have ISM[F;𝐜]I\models\hbox{\rm SM}[F;{\bf{c}}] iff ISM[UF𝐜(F);𝐜]I\models\hbox{\rm SM}[\hbox{\it UF\/}_{\bf{c}}(F);{\bf{c}}].

Proof.  It is easy to check that the completion of UF𝐜(F)\hbox{\it UF\/}_{\bf{c}}(F) relative to 𝐜{\bf{c}} is equivalent to the completion of FF relative to 𝐜{\bf{c}}. By Theorem 4, we conclude that SM[UF𝐜(F);𝐜]\hbox{\rm SM}[\hbox{\it UF\/}_{\bf{c}}(F);{\bf{c}}] is equivalent to SM[F;𝐜]\hbox{\rm SM}[F;{\bf{c}}].   

B.10 Proof of Theorem 10

For any formula FF containing object constants ff and gg, we call it fg{fg}-indistinguishable if every occurrence of ff and gg in FF is in a subformula of the form (f=t)(g=t)(f=t)\wedge(g=t) that is fg{fg}-plain. For any interpretations II and JJ of FF, we say II and JJ satisfy the relation R(I,J)R(I,J) if

  • |I|=|J||I|=|J|,

  • I(f)I(g)I(f)\neq I(g),

  • J(f)J(g)J(f)\neq J(g), and

  • for all symbols cc other than ff and gg, I(c)=J(c)I(c)=J(c).

Lemma 10

If a formula FF is fgfg-indistinguishable, then for any interpretations II and JJ such that R(I,J)R(I,J), FI=FJF^{I}=F^{J}.

Proof.   Notice that any fgfg-indistinguishable formula is built on atomic formulas not containing ff and gg, and formula of the form (f=t)(g=t)(f=t)\land(g=t), using propositional connectives and quantifiers. The proof is by induction on such formulas.


Theorem 10  For any set 𝐜{\bf{c}} of constants, there is no strongly equivalent transformation that turns an arbitrary sentence into a 𝐜{\bf{c}}-plain sentence.

Proof.  The proof follows from the claim.

Claim: There is no f{f}-plain formula that is strongly equivalent to p(f)p(1)p(2)¬p(3)p(f)\land p(1)\land p(2)\land\neg p(3).

Let FF be p(f)p(1)p(2)¬p(3)p(f)\land p(1)\land p(2)\land\neg p(3). Then F(g)F^{*}(g) is p(f)p(g)p(1)p(2)¬p(3)p(f)\land p(g)\land p(1)\land p(2)\land\neg p(3). Let I={p(1),p(2),f=1,g=2}I=\{p(1),p(2),f\!=\!1,g\!=\!2\} and J={p(1),p(2),f=1,g=3}J=\{p(1),p(2),f\!=\!1,g\!=\!3\} (numbers are interpreted as themselves). It is easy to check that IF(g)I\models F^{*}(g) and J⊧̸F(g)J\not\models F^{*}(g).

Assume for the sake of contradiction that there is a f{f}-plain formula GG that is strongly equivalent to FF. Since GG is ff-plain, G(g)G^{*}(g) is fgfg-indistinguishable. Since R(I,J)R(I,J) holds, by Lemma 10, IG(g)I\models G^{*}(g) iff JG(g)J\models G^{*}(g), but this contradicts Theorem 3.   

B.11 Proof of Theorem 11

Theorem 11   For any definite causal theory TT, ICM[T;𝐟]I\models\hbox{\rm CM}[T;{\bf{f}}] iff ISM[Tr(T);𝐟]I\models\hbox{\rm SM}[\hbox{\it Tr\/}(T);{\bf{f}}].

Proof.  Assume that, without loss of generality, the rules (21)–(22) have no free variables. It is sufficient to prove that under the assumption that II satisfies TT, for every rule (21), J𝐠𝐟IJ^{\bf{f}}_{\bf{g}}\cup I satisfies

Bg(𝐭)=t1B\,\rightarrow\,g({\bf t})\!=\!t_{1}

iff J𝐠𝐟IJ^{\bf{f}}_{\bf{g}}\cup I satisfies

(¬¬B)(𝐠)g(𝐭)=t1f(𝐭)=t1.(\neg\neg B)^{*}({\bf{g}})\,\rightarrow\,g({\bf t})\!=\!t_{1}\land f({\bf t})\!=\!t_{1}.

Indeed, this is true since BB is equivalent to (¬¬B)(𝐠)(\neg\neg B)^{*}({\bf{g}}) (Lemma 2), and II satisfies TT.   

B.12 Proof of Theorem 12

Theorem 12  ISM[T;𝐟]I\models\hbox{\rm SM}[T;{\bf{f}}] iff IIF[T;𝐟]I\models\hbox{\rm IF}[T;{\bf{f}}].

Proof.  We wish to show that IT¬𝐟^(𝐟^<𝐟F(𝐟^))I\models T\land\neg\exists\widehat{\bf f}(\widehat{\bf f}<{\bf f}\land F^{*}(\widehat{\bf f})) iff IT¬𝐟^(𝐟^𝐟F(𝐟^))I\models T\land\neg\exists\widehat{\bf f}(\widehat{\bf f}\neq{\bf f}\land F^{\diamond}(\widehat{\bf f})). The first conjunctive terms are identical and if I⊧̸TI\not\models T then the claim holds.

Let us assume then, that ITI\models T. By definition, 𝐟^<𝐟\widehat{\bf f}<{\bf f} is equivalent to 𝐟^𝐟\widehat{\bf f}\neq{\bf f}. What remains to be shown is the correspondence between F(𝐟^)F^{*}(\widehat{\bf f}) and F(𝐟^)F^{\diamond}(\widehat{\bf f}).

Consider any list of functions 𝐠{\bf g} of the same length as 𝐟{\bf f}. Let =J𝐠𝐟I\mathcal{I}=J^{\bf f}_{\bf g}\cup I be an interpretation of an extended signature σ=σ𝐠\sigma^{\prime}=\sigma\cup{\bf g} where JJ is an interpretation of σ\sigma and JJ and II agree on functions not belonging to 𝐟{\bf f}.

Consider any rule f(𝐭)=t1¬¬Bf({\bf t})=t_{1}\leftarrow\neg\neg B from TT. The corresponding rule in F(𝐠)F^{*}({\bf g}) is equivalent to

f(𝐭)=t1g(𝐭)=t1B.f({\bf t})=t_{1}\land g({\bf t})=t_{1}\leftarrow B.

The corresponding rule in F(𝐠)F^{\diamond}({\bf g}) is equivalent to

g(𝐭)=t1B.g({\bf t})=t_{1}\leftarrow B.

Now we consider cases

  • I⊧̸BI\not\models B. Clearly, both versions of the rule are vacuously satisfied by \mathcal{I}.

  • IBI\models B. Then, since ITI\models T it must be that If(𝐭)=t1I\models f({\bf t})=t_{1} and so the corresponding rule in F(𝐠)F^{*}({\bf g}) is further equivalent to

    g(𝐭)=t1Bg({\bf t})=t_{1}\leftarrow B

    which is equivalent to the corresponding rule in F(𝐠)F^{\diamond}({\bf g}) and so certainly \mathcal{I} satisfies both corresponding rules or neither.

Thus, F(𝐠)\mathcal{I}\models F^{*}({\bf g}) iff F(𝐠)\mathcal{I}\models F^{\diamond}({\bf g}) and so the claim holds.   

B.13 Proof of Theorem 13

Lemma 11

Given a formula FF of many-sorted signature σ\sigma and an interpretation II of σ\sigma, IgrI[F]I\models gr_{I}[F] iff InsgrIns[Fns]I^{ns}\models gr_{I^{ns}}[F^{ns}].

Proof.  By induction on the structure of FF.   

Lemma 12

Given a formula FF of many-sorted signature σ\sigma, interpretations II and JJ of σ\sigma and an interpretation KK of σns\sigma^{ns} such that

  • for every sort ss in σ\sigma, |I|s=|J|s=sK|I|^{s}=|J|^{s}=s^{K},

  • for every predicate and function constant cc and for every tuple 𝝃{{\boldsymbol{\xi}}} composed of elements from |Ins||I^{ns}| such that ξi|I|argsi\xi_{i}\in|I|^{args_{i}} for every ξi𝝃\xi_{i}\in{{\boldsymbol{\xi}}} , where argsiargs_{i} is the ii-th argument sort of cc, we have c(𝝃)K=c(𝝃)Jc({{\boldsymbol{\xi}}})^{K}=c({{\boldsymbol{\xi}}})^{J},

  • for every predicate and function constant cc and for every tuple 𝝃{{\boldsymbol{\xi}}} composed of elements from |Ins||I^{ns}| such that ξi|I|argsi\xi_{i}\notin|I|^{args_{i}} for some ξi|I|argsi\xi_{i}\in|I|^{args_{i}}, where argsiargs_{i} is the ii-th argument sort of cc, we have c(𝝃)K=c(𝝃)Insc({{\boldsymbol{\xi}}})^{K}=c({{\boldsymbol{\xi}}})^{I^{ns}},

JJ is a model of grI[F]I¯gr_{I}[F]^{\mathit{\underline{I}}} iff KK is a model of grIns[Fns]I¯nsgr_{I^{ns}}[F^{ns}]^{\mathit{\underline{I}}^{ns}}.

Proof.  By induction on the structure of FF.   

Lemma 13

Given a formula FF of many-sorted signature σ\sigma and two interpretations LL and L1L_{1} of σns\sigma^{ns} such that R(L,L1)R(L,L_{1}), if LFnsSFσL\models F^{ns}\land SF_{\sigma}, then L1FnsSFσL_{1}\models F^{ns}\land SF_{\sigma}.

Proof.  Assume that LFnsSFσL\models F^{ns}\land SF_{\sigma}. We first show that L1SFσL_{1}\models SF_{\sigma}. Since R(L,L1)R(L,L_{1}), LL and L1L_{1} agree on all sort predicates 𝚜{{\tt s}} corresponding to sorts sσs\in\sigma. Thus, L1L_{1} clearly satisfies the first two items of SFσSF_{\sigma}. We now consider the third item of SFσSF_{\sigma}. For tuples ξ1,,ξk\xi_{1},\dots,\xi_{k} such that each ξiargsi\xi_{i}\in args_{i} where argsiargs_{i} is the ii-th argument sort of ff, since R(L,L1)R(L,L_{1}), LL and L1L_{1} agree on f(ξ1,,ξk)f(\xi_{1},\dots,\xi_{k}) so L1L_{1} satisfies the implication. For all other tuples, the implication is vacuously satisfied. Finally, the fourth and fifth items of SFσSF_{\sigma} are tautologies in classical logic so we conclude that L1SFσL_{1}\models SF_{\sigma}.

Next, L1FnsL_{1}\models F^{ns} can be shown by induction on the structure of FnsF^{ns}.   

Lemma 14

Given a formula FF of many-sorted signature σ\sigma, a set of function and predicate constants 𝐜{\bf c} from σ\sigma and two interpretations LL and L1L_{1} of σns\sigma^{ns} such that R(L,L1)R(L,L_{1}), if LL is a stable model of FnsSFσF^{ns}\land SF_{\sigma} w.r.t. 𝐜{\bf c}, then L1L_{1} is a stable model of FnsSFσF^{ns}\land SF_{\sigma} w.r.t. 𝐜{\bf c}.

Proof.  Omitted. The proof is long but not complicated.   

Theorem 13   Let FF be a formula of a many-sorted signature σ\sigma, and let 𝐜{\bf c} be a set of function and predicate constants.

  • (a)

    If an interpretation II of signature σ\sigma is a model of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}], then InsI^{ns} is a model of SM[FnsSFσ;𝐜]\hbox{\rm SM}[F^{ns}\land SF_{\sigma};{\bf c}].

  • (b)

    If an interpretation LL of signature σns\sigma^{ns} is a model of SM[FnsSFσ;𝐜]\hbox{\rm SM}[F^{ns}\land SF_{\sigma};{\bf c}] then there is some interpretation II of signature σ\sigma such that II is a model of SM[F;𝐜]\hbox{\rm SM}[F;{\bf c}] and R(L,Ins)R(L,I^{ns}).

Proof.

(a) Consider an interpretation II (of many-sorted signature σ\sigma) that is a stable model of FF w.r.t. 𝐜{\bf c}. This means that IFI\models F and there is no interpretation JJ such that J<𝐜IJ<^{\bf c}I and JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}. We wish to show that InsFnsSFσI^{ns}\models F^{ns}\land SF_{\sigma} and there is no (unsorted) interpretation KK such that K<𝐜InsK<^{\bf c}I^{ns} and KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}. From Lemma 11, IFI\models F iff InsFnsI^{ns}\models F^{ns}. It follows from the definition of InsI^{ns} that InsSFσI^{ns}\models SF_{\sigma} so we conclude that IFI\models F iff InsFnsSFσI^{ns}\models F^{ns}\land SF_{\sigma}. For the second item, we will prove the contrapositive: if there is an (unsorted) interpretation KK such that K<𝐜InsK<^{\bf c}I^{ns} and KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}, then there is a (many-sorted) interpretation JJ such that J<𝐜IJ<^{\bf c}I and JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}.

Assume there is an interpretation KK such that K<𝐜InsK<^{\bf c}I^{ns} and KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}. We obtain the interpretation JJ as follows. For every sort ss in σ\sigma, |J|s=|I|s|J|^{s}=|I|^{s}. For every predicate and function constant cc in σ\sigma and every tuple 𝝃{\boldsymbol{\xi}} such that each element ξi|I|si\xi_{i}\in|I|^{s_{i}} where sis_{i} is the sort of the ii-th argument of cc, we let cJ(𝝃)=cK(𝝃)c^{J}({\boldsymbol{\xi}})=c^{K}({\boldsymbol{\xi}}). For predicate constants, it is not hard to see that this is a valid assignment as atoms are either true or false regardless of considering many-sorted or unsorted logic.

We argue that this assignment is also valid for function constants. That is, KK does not map a function ff to a value outside of |I|s|I|^{s} where ss is the value sort of ff. This follows from the fact that InsSFσI^{ns}\models SF_{\sigma} and in particular, the third item of SFσSF_{\sigma}. Thus, since KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}, it follows that KK too maps functions to elements of the appropriate sort.

We now show that J<𝐜IJ<^{\bf c}I. Since KgrIns[SFσ]I¯nsK\models gr_{I^{ns}}[SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}, the fourth and fifth rules in SFσSF_{\sigma} are choice formulas that force KK to agree with InsI^{ns} on every predicate and function constant cc for every tuple that has at least one element outside of the corresponding sort. For every predicate and function constant cc and all tuples that have all elements in the appropriate sort, KK and JJ agree. Further, since II and InsI^{ns} agree on these as well, it follows immediately since K<𝐜InsK<^{\bf c}I^{ns}, that J<𝐜IJ<^{\bf c}I.

To apply Lemma 12, we verify the conditions of the lemma. It is clear that the second condition is true. The first condition follows from the definition of K<𝐜InsK<^{\bf c}I^{ns}: since the sort predicates are not in 𝐜{\bf c}, KK and InsI^{ns} agree on these predicates. The third condition follows from the fact that since KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}} it follows that KgrIns[SFσ]I¯nsK\models gr_{I^{ns}}[SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}; the fourth and fifth rules in SFσSF_{\sigma} are choice formulas that force KK to agree with InsI^{ns} for every tuple that has at least one element outside of the corresponding sort. Thus, by Lemma 12, since KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}} and thus, KgrIns[Fns]I¯nsK\models gr_{I^{ns}}[F^{ns}]^{\mathit{\underline{I}}^{ns}}, it follows that JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}.

(b) Given an interpretation LL that is a stable model of FnsSFσF^{ns}\land SF_{\sigma} w.r.t. 𝐜{\bf c}, we first obtain the interpretation L1L_{1} of σns\sigma^{ns} as follows.

  • |L1|=|L||L_{1}|=|L|;

  • 𝚜L1{{\tt s}}^{L_{1}} = 𝚜L{{\tt s}}^{L} for every 𝚜{{\tt s}} corresponding to a sort ss from σ\sigma;

  • c(ξ1,,ξk)L1=c(ξ1,,ξk)Lc(\xi_{1},\dots,\xi_{k})^{L_{1}}=c(\xi_{1},\dots,\xi_{k})^{L} for every tuple ξ1,,ξk\xi_{1},\dots,\xi_{k} such that ξisi\xi_{i}\in s_{i} where sis_{i} is the ii-th argument sort of cc;

  • c(ξ1,,ξk)L1=|L1|0c(\xi_{1},\dots,\xi_{k})^{L_{1}}=|L_{1}|_{0} for every tuple ξ1,,ξk\xi_{1},\dots,\xi_{k} such that ξisi\xi_{i}\notin s_{i} for some ii where sis_{i} is the ii-th argument sort of cc.

It is easy to see that R(L,L1)R(L,L_{1}). By Lemma 14, L1L_{1} is a stable model of FnsSFσF^{ns}\land SF_{\sigma} w.r.t. 𝐜{\bf c}. We then obtain the interpretation II of signature σ\sigma as follows.

For every sort ss in σ\sigma, |I|s=sL1|I|^{s}=s^{L_{1}}. For every predicate and function constant cc in σ\sigma and every tuple 𝝃{\boldsymbol{\xi}} such that ξi|L|si\xi_{i}\in|L|^{s_{i}} where sis_{i} is the sort of the ii-th argument of cc, we have c(𝝃)I=c(𝝃)L1c({\boldsymbol{\xi}})^{I}=c({\boldsymbol{\xi}})^{L_{1}}. For predicate constants, it is not hard to see that this is a valid assignment as atoms are either true or false regardless of considering many-sorted or unsorted logic.

We argue that this assignment is also valid for function constants. That is, II does not map a function ff to a value outside of |I|s|I|^{s} where ss is the value sort of ff. This follows from the fact that L1SFσL_{1}\models SF_{\sigma} (by Lemma 13) and in particular, the third item of SFσSF_{\sigma}. Thus, it follows that II too maps functions to elements of the appropriate sort.

Now it is clear that L1=InsL_{1}=I^{ns} and so we have R(L,Ins)R(L,I^{ns}). We now show that II is a stable model of FF.

We have an interpretation II (of many-sorted signature σ\sigma) such that InsI^{ns} is a stable model of FnsSFσF^{ns}\land SF_{\sigma} w.r.t. 𝐜{\bf c}. This means that InsFnsSFσI^{ns}\models F^{ns}\land SF_{\sigma} and there is no interpretation KK such that K<𝐜InsK<^{\bf c}I^{ns} and KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}. We wish to show that IFI\models F and there is no interpretation JJ such that J<𝐜IJ<^{\bf c}I and JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}. From Lemma 11, IFI\models F iff InsFnsI^{ns}\models F^{ns} so we conclude that IFI\models F. For the second item, we will prove the contrapositive; if there is a (many-sorted) interpretation JJ such that J<𝐜IJ<^{\bf c}I and JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}, then there is an (unsorted) interpretation KK such that K<𝐜InsK<^{\bf c}I^{ns} and KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}.

Assume there is an interpretation JJ such that J<𝐜IJ<^{\bf c}I and JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}. We obtain the interpretation KK be JnsJ^{ns}.

We now show that K<𝐜InsK<^{\bf c}I^{ns}. For every predicate and function constant cc for every tuple that has at least one element outside of the corresponding sort, by definition of K=JnsK=J^{ns}, cK=cIns=|Ins|0c^{K}=c^{I^{ns}}=|I^{ns}|_{0} if cc is a function constant and cK=cIns=falsec^{K}=c^{I^{ns}}=\hbox{\sc false} if cc is a predicate constant. That is, for every predicate and function constant cc for every tuple that has at least one element outside of the corresponding sort, KK and InsI^{ns} agree. For every predicate and function constant cc and all tuples of elements in the appropriate sort, KK and JJ agree. Further, since II and InsI^{ns} agree on these as well, K<𝐜InsK<^{\bf c}I^{ns} follows immediately from J<𝐜IJ<^{\bf c}I.

To apply Lemma 12, we must verify the conditions of the lemma. It is clear that the second condition is true. The first condition follows from the definition of K=JnsK=J^{ns}. The third condition follows from the observation above: by definition of K=JnsK=J^{ns}, cK=cIns=|Ins|0c^{K}=c^{I^{ns}}=|I^{ns}|_{0} if cc is a function constant and cK=cIns=falsec^{K}=c^{I^{ns}}=\hbox{\sc false} if cc is a predicate constant. Thus, by Lemma 12, since JgrI[F]I¯J\models gr_{I}[F]^{\mathit{\underline{I}}}, it follows that KgrIns[Fns]I¯nsK\models gr_{I^{ns}}[F^{ns}]^{\mathit{\underline{I}}^{ns}}.

Then, it is easy to see that by definition of InsI^{ns}, InsSFσI^{ns}\models SF_{\sigma}. Then, by definition of K=JnsK=J^{ns}, it is clear that KSFσK\models SF_{\sigma}. We will show that K(SFσ)I¯nsK\models(SF_{\sigma})^{\mathit{\underline{I}}^{ns}}.

Since KK and InsI^{ns} agree on all sort predicates, it is clear that KK satisfies the formulas in the first two items of (SFσ)I¯ns(SF_{\sigma})^{\mathit{\underline{I}}^{ns}}.

Since KK and InsI^{ns} agree on all function constants ff for tuples ξi,,ξk\xi_{i},\dots,\xi_{k} such that each ξi\xi_{i} is in |I|si|I|^{s_{i}} where sis_{i} is the ii-th argument sort of ff, it is clear that KK satisfies the third item of (SFσ)I¯ns(SF_{\sigma})^{\mathit{\underline{I}}^{ns}}.

The last two items of (SFσ)I¯ns(SF_{\sigma})^{\mathit{\underline{I}}^{ns}} are only satisfied if KK agrees with InsI^{ns} on all predicate (function) constants cc and all tuples ξ1,,ξk\xi_{1},\dots,\xi_{k} such that some ξi\xi_{i} is not in |I|si|I|^{s_{i}} where sis_{i} is the ii-th argument sort of cc. However, by definition of K=JnsK=J^{ns} and InsI^{ns}, both KK and InsI^{ns} map this to |Ins|0|I^{n}s|_{0} if cc is a function constant or false if cc is a predicate constant so KK satisfies these items. So we conclude that KgrIns[FnsSFσ]I¯nsK\models gr_{I^{ns}}[F^{ns}\land SF_{\sigma}]^{\mathit{\underline{I}}^{ns}}.  

B.14 Proof of Theorem 14

Lemma 15

Let Π\Pi be a clingcon program with CSP (V,D,C)(V,D,C), let 𝒯{\mathcal{T}} be the background theory conforming to (V,D,C)(V,D,C), let 𝐩{\bf p} be the set of all propositional constants occurring in Π\Pi, let II be a 𝒯{\mathcal{T}}-interpretation If,X\langle I^{f},X\rangle and let JJ be an interpretation If,Y\langle I^{f},Y\rangle such that YXY\subset X. If IΠI\models\Pi, then YΠIfXY\models\Pi^{X}_{I^{f}} iff JΠI¯J\models\Pi^{\mathit{\underline{I}}}.

Proof.  Assume IΠI\models\Pi.

(\Rightarrow) Assume YΠIfXY\models\Pi^{X}_{I^{f}}. This means that YY satisfies every rule in the reduct ΠIfX\Pi^{X}_{I_{f}}. For each rule rr of the form (26) in Π\Pi, there are two cases:

  • Case 1: XBX\models B and IfCnI^{f}\models\hbox{\it Cn\/}. In this case, rIfXr^{X}_{I_{f}} is

    aB,a\leftarrow B, (36)

    and rI¯r^{\mathit{\underline{I}}} is equivalent to

    aI¯BI¯a^{\mathit{\underline{I}}}\leftarrow B^{\mathit{\underline{I}}} (37)

    under the assumption IΠI\models\Pi.

    • Subcase 1: IBI\models B. Since IΠI\models\Pi, it must be that IaI\models a. Consequently, (37) is the same as (36), so it follows that JrI¯J\models r^{\mathit{\underline{I}}}.

    • Subcase 2: I⊧̸BI\not\models B. Since BI¯=B^{\mathit{\underline{I}}}=\bot, clearly, JrI¯J\models r^{\mathit{\underline{I}}}.

  • Case 2: X⊧̸BX\not\models B or If⊧̸CnI^{f}\not\models\hbox{\it Cn\/}. Clearly, rI¯r^{\mathit{\underline{I}}} is equivalent to \top, so JrI¯J\models r^{\mathit{\underline{I}}}.

(\Leftarrow) Assume JΠI¯J\models\Pi^{\mathit{\underline{I}}}. For each rule rr of the form (26) in Π\Pi, there are two cases:

  • Case 1: I⊧̸NCnI\not\models N\land\hbox{\it Cn\/}. In this case, the reduct rIfXr^{X}_{I_{f}} is empty. Clearly, YrIfXY\models r^{X}_{I_{f}}.

  • Case 2: INCnI\models N\land\hbox{\it Cn\/}. The reduct rIfXr^{X}_{I_{f}} is aBa\leftarrow B.

    • Subcase 1: IBI\models B. rI¯r^{\mathit{\underline{I}}} is equivalent to aI¯(BNCn)I¯a^{\mathit{\underline{I}}}\leftarrow(B\land N\land\hbox{\it Cn\/})^{\mathit{\underline{I}}}. Since JrI¯J\models r^{\mathit{\underline{I}}}, it must be that aI¯=aa^{\mathit{\underline{I}}}=a and JaJ\models a. Consequently, YaY\models a, so YrIfXY\models r^{X}_{I_{f}}.

    • Subcase 2: I⊧̸BI\not\models B (i.e., X⊧̸BX\not\models B). Since YXY\subset X, we have Y⊧̸BY\not\models B so YrIfXY\models r^{X}_{I_{f}}.

 

Theorem 14   Let Π\Pi be a clingcon program with CSP (V,D,C)(V,D,C), let 𝐩{\bf p} be the set of all propositional constants occurring in Π\Pi, let 𝒯{\mathcal{T}} be the background theory conforming to (V,D,C)(V,D,C), and let If,X\langle I^{f},X\rangle be a 𝒯{\mathcal{T}}-interpretation. Set XX is a constraint answer set of Π\Pi relative to IfI^{f} iff If,X\langle I^{f},X\rangle is a 𝒯{\mathcal{T}}-stable model of Π\Pi relative to 𝐩{\bf p}.

Proof.

XX is a constraint answer set of Π\Pi relative to IfI^{f}

iff

XX satisfies ΠIfX\Pi^{X}_{I_{f}}, and no proper subset YY of XX satisfies ΠIfX\Pi^{X}_{I_{f}}

iff (by Lemma 15)

If,X\langle I^{f},X\rangle is a 𝒯{\mathcal{T}}-model of Π\Pi, and no interpretation JJ such that J<𝐩If,XJ<^{\bf p}\langle I^{f},X\rangle satisfies ΠI¯\Pi^{\mathit{\underline{I}}}

iff

If,X is a 𝒯-stable model of Π relative to 𝐩.\text{$\langle I^{f},X\rangle$ is a ${\mathcal{T}}$-stable model of $\Pi$ relative to~${\bf p}$}.
 

B.15 Proof of Theorem 15

Lemma 16

For any ASP(LC) program Π\Pi, any LJN interpretation (X,T)(X,T), and any 𝒯{\mathcal{T}}-interpretation I=If,YI=\langle I^{f},Y\rangle, the following conditions are equivalent:

  • ITT¯I\models T\cup\overline{T};

  • For every theory atom tt occurring in Π\Pi, it holds that (X,T)t(X,T)\models t iff ItI\models t.

Proof.

  • (i)

    Assume ITT¯I\models T\cup\overline{T}. Take any theory atom tt occurring in Π\Pi.
    (\Rightarrow) Assume (X,T)t(X,T)\models t. It is immediate that tTt\in T and so by the assumption on II, we have ItI\models t.
    (\Leftarrow) Assume ItI\models t. Since ITI\models T, it follows that tTt\in T and so (X,T)t(X,T)\models t.

  • (ii)

    Assume that, for every theory atom tt occurring in Π\Pi, it holds that (X,T)t(X,T)\models t iff ItI\models t. By definition of (X,T)t(X,T)\models t, for every tt occurring in Π\Pi, it follows that tTt\in T iff ItI\models t. Thus ITI\models T and IT¯I\models\overline{T} so ITT¯I\models T\cup\overline{T}.

 
Lemma 17

Given an ASP(LC) program Π\Pi, two LJN-interpretations (X,T)(X,T) and (Y,T)(Y,T) such that (X,T)Π(X,T)\models\Pi and YXY\subseteq X, and two 𝒯{\mathcal{T}}-interpretations I=If,XI=\langle I^{f},X\rangle and J=If,YJ=\langle I^{f},Y\rangle such that IΠI\models\Pi, and IfTT¯I^{f}\models T\cup\overline{T}, It holds that YΠ(X,T)Y\models\Pi^{(X,T)} iff JΠI¯J\models\Pi^{\mathit{\underline{I}}}.

Proof.  (\Rightarrow) Assume YΠ(X,T)Y\models\Pi^{(X,T)}. This means that YY satisfies every rule in the reduct Π(X,T)\Pi^{(X,T)}. For each rule rr of the form (27) in Π\Pi, there are two cases:

  • Case 1: (X,T)NLC(X,T)\models N\land LC.
    In this case, the corresponding rule in the reduct Π(X,T)\Pi^{(X,T)} is

    aB.a\leftarrow B.

    On the other hand, rI¯r^{\mathit{\underline{I}}} has two cases:

    • Subcase 1: IBI\models B.
      Since we assume IΠI\models\Pi, it must be that IaI\models a. By Lemma 16, since (X,T)t(X,T)\models t for all tt in LCLC, so too does II and so ILCI\models LC. In this case, rI¯r^{\mathit{\underline{I}}} is

      aB,,,,LCI¯.a\leftarrow B,\top,\dots,\top,LC^{\mathit{\underline{I}}}.

      Since II and JJ interpret object constants in the same way and ILCI¯I\models LC^{\mathit{\underline{I}}}, we have JLCI¯J\models LC^{\mathit{\underline{I}}}. Thus by definition of JJ, it follows that JBJ\models B iff YBY\models B and JaJ\models a iff YaY\models a, so the claim holds.

    • Subcase 2: I⊧̸BI\not\models B. The reduct rI¯r^{\mathit{\underline{I}}} is either aa\leftarrow\bot or \bot\leftarrow\bot and in either case, JrI¯J\models r^{\mathit{\underline{I}}}.

  • Case 2: (X,T)⊧̸NLC(X,T)\not\models N\land LC.
    By the condition of II and by Lemma 16, I⊧̸NLCI\not\models N\land LC so rI¯r^{\mathit{\underline{I}}} is aa\leftarrow\bot or \bot\leftarrow\bot depending on whether IaI\models a. Thus, JJ trivially satisfies rI¯r^{\mathit{\underline{I}}}.

(\Leftarrow) Assume JΠI¯J\models\Pi^{\mathit{\underline{I}}}. This means that JJ satisfies every rule in ΠI¯\Pi^{\mathit{\underline{I}}}. For any rule rr of the form (27) in Π\Pi, there are two cases.

  • Case 1: I⊧̸NLCI\not\models N\land LC.
    By the condition of II and by Lemma 16, (X,T)⊧̸NLC(X,T)\not\models N\land LC. Thus the reduct Π(X,T)\Pi^{(X,T)} does not contain a corresponding rule so there is nothing for YY to satisfy.

  • Case 2: INLCI\models N\land LC.
    By the condition of II and by Lemma 16, (X,T)NLC(X,T)\models N\land LC so the reduct r(X,T)r^{(X,T)} is aBa\leftarrow B.

    • Subcase 1: I⊧̸BI\not\models B.
      By the condition of II, X⊧̸BX\not\models B and since YXY\subseteq X, Y⊧̸BY\not\models B. Thus, Yr(X,T)Y\models r^{(X,T)}.

    • Subcase 2: IBI\models B.
      Since IΠI\models\Pi, it must be that IaI\models a so the reduct rI¯r^{\mathit{\underline{I}}} is aBLCI¯a\leftarrow B\land LC^{\mathit{\underline{I}}}. Now since JJ and II agree on every object constant and since ILCI¯I\models LC^{\mathit{\underline{I}}}, we have JLCI¯J\models LC^{\mathit{\underline{I}}}. Thus, JrI¯J\models r^{\mathit{\underline{I}}} iff JaBJ\models a\leftarrow B. Since we assume JΠIJ\models\Pi^{I}, we conclude JaBJ\models a\leftarrow B. Now by definition of JJ, it follows that Yr(X,T)Y\models r^{(X,T)}.

 

Theorem 15   Let Π\Pi be an ASP(LC) program of signature σp,σf\langle\sigma^{p},\sigma^{f}\rangle where σp\sigma^{p} is a set of propositional constants, and let σf\sigma^{f} be a set of object constants, and let IfI^{f} be an interpretation of σf\sigma^{f}.

  • (a)

    If (X,T)(X,T) is an LJN-answer set of Π\Pi, then for any 𝒯{\mathcal{T}}-interpretation II such that IfTT¯I^{f}\models T\cup\overline{T}, we have If,XSM[Π;σp]\langle I^{f},X\rangle\models\hbox{\rm SM}[\Pi;\sigma^{p}].

  • (b)

    For any 𝒯{\mathcal{T}}-interpretation I=If,XI=\langle I^{f},X\rangle, if If,XSM[Π;σp]\langle I^{f},X\rangle\models\hbox{\rm SM}[\Pi;\sigma^{p}], then an LJN-interpretation (X,T)(X,T) where

    T={tt is a theory atom in Π such that Ift}T=\{t\mid\text{$t$ is a theory atom in $\Pi$ such that $I^{f}\models t$}\}

    is an LJN-answer set of Π\Pi.

Proof.  In this proof, we refer to the reduct-based characterization of a stable model from [Bartholomew and Lee, 2013c].

(a)(a) Assume (X,T)(X,T) is an LJN-answer set of Π\Pi. Take any 𝒯{\mathcal{T}}-interpretation I=If,XI=\langle I^{f},X\rangle such that IfbgTT¯I^{f}\models_{bg}T\cup\overline{T}.

Now for any atom pp, by the condition of II, we have IpI\models p iff (X,T)p(X,T)\models p. Similarly, for any theory atom tt occurring in Π\Pi, by the condition of II and by Lemma 16, ItI\models t iff (X,T)t(X,T)\models t. Thus, since (X,T)Π(X,T)\models\Pi, IΠI\models\Pi.

We must now show that there is no interpretation JJ such that J<σpIJ<^{\sigma_{p}}I and JΠI¯J\models\Pi^{\mathit{\underline{I}}}. Take any J<σpIJ<^{\sigma_{p}}I. That is, J=If,YJ=\langle I^{f},Y\rangle such that YXY\subset X. By Lemma 17, JΠI¯J\models\Pi^{\mathit{\underline{I}}} iff YΠ(X,T)Y\models\Pi^{(X,T)} but since (X,T)(X,T) is an LJN-answer set of Π\Pi, Y⊧̸Π(X,T)Y\not\models\Pi^{(X,T)} and thus J⊧̸ΠI¯J\not\models\Pi^{\mathit{\underline{I}}} so II is a stable model of Π\Pi.

(bb) Assume I=If,XI=\langle I^{f},X\rangle is a stable model of Π\Pi.

Now for any atom pp, by definition of (X,T)(X,T), (X,T)p(X,T)\models p iff IpI\models p. Similarly, for any theory atom tt occurring in Π\Pi, by the condition of II and Lemma 16, (X,T)t(X,T)\models t iff ItI\models t. Thus, since IΠI\models\Pi, (X,T)Π(X,T)\models\Pi.

We must now show that there is no set of atoms YY such that YXY\subset X and YΠ(X,T)Y\models\Pi^{(X,T)}. Take any YXY\subset X. By Lemma 17, YΠ(X,T)Y\models\Pi^{(X,T)} iff JΠI¯J\models\Pi^{\mathit{\underline{I}}} where J=If,YJ=\langle I^{f},Y\rangle. Since J<σpIJ<^{\sigma^{p}}I and II is a stable model of Π\Pi, J⊧̸ΠI¯J\not\models\Pi^{\mathit{\underline{I}}}. Thus Y⊧̸Π(X,T)Y\not\models\Pi^{(X,T)} and so (X,T)(X,T) is an LJN-answer set of Π\Pi.   

B.16 Proof of Theorem 16

The proof of the theorem is rather obvious once we view the type declarations of LW-program as a special case of the many-sorted signature declarations. So we omit the proof here.