First-Order Stable Model Semantics
with Intensional Functions
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 Theories1 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 is a variable for time stamps, is a variable for integers, not stands for default negation, and stands for strong negation:
(1) |
An attempt to replace the predicate by equality using a function, e.g. “,” does not work under the standard stable model semantics: “” is not even syntactically valid because strong negation precedes equality, rather than an ordinary ASP atom. Besides, is false under any Herbrand interpretation unless is the term itself, implying that 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
(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 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: While it is possible to say that and 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 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 |
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--plain formulas to -plain formulas, the usefulness of non--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 are called object constants, and predicate constants of arity are called propositional constants. A term of a signature is formed from object constants of and object variables using function constants of . An atom of is an -ary predicate constant followed by a list of terms; atomic formulas of are atoms of , equalities between terms of , and the -place connective (falsity). First-order formulas of are built from atomic formulas of using the primitive propositional connectives as well as quantifiers . We understand as an abbreviation of ; symbol stands for , and stands for , and stands for .
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) and , expression is defined as shorthand for ; expression is defined as . For lists of predicate symbols and , expression is defined as , expression is defined as , and expression is defined as .
For any first-order formula and any finite list of predicate constants , formula is defined as
where is a list of distinct predicate variables , and is defined recursively as follows:
-
•
When is an atomic formula, is a formula obtained from by replacing all predicate constants in it with the corresponding predicate variables from ;
-
•
;
-
•
;
-
•
;
-
•
;
-
•
.
The predicate constants in are called intensional: these are the predicates that we “intend to characterize” by .444Intensional predicates are analogous to output predicates in Datalog, and non-intensional predicates are analogous to input predicates in Datalog [Lifschitz, 2011]. When is a sentence (i.e., formula without free variables), the models of the second-order sentence are called the stable models of relative to : they are the models of that are “stable” on .
Answer sets are defined as a special class of first-order stable models as follows. By we denote the signature consisting of the function and predicate constants occurring in . If contains at least one object constant, an Herbrand interpretation of that satisfies is called an answer set of , where is the list of all predicate constants in . The answer sets of a logic program are defined as the answer sets of the FOL-representation of , which is obtained from by
-
•
replacing every comma by conjunction and every not by 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, can be represented by .
-
•
turning every rule into a formula rewriting it as the implication , and
-
•
forming the conjunction of the universal closures of these formulas.
For example, the FOL-representation of the program
is
(3) |
and is
which is equivalent to the first-order sentence
(4) |
[Ferraris et al., 2007, Example 3]. The stable models of are any first-order models of (4). The only answer set of is the Herbrand model .
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 with a simpler expression (which substitutes for ), then the definition of reduces to the definition of .
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 as if and are function symbols. For lists of predicate and function symbols and , expression is defined as .
Let be a list of distinct predicate and function constants, and let be a list of distinct predicate and function variables corresponding to . By (, respectively) we mean the list of all predicate constants (function constants, respectively) in , and by (, respectively) the list of the corresponding predicate variables (function variables, respectively) in . For any formula , expression is defined as
(5) |
where is shorthand for , and is defined recursively in the same way as except for the base case, which is defined as follows.
-
•
When is an atomic formula, is where is obtained from by replacing all (predicate and function) constants in it with the corresponding variables from .
As before, we say that an interpretation that satisfies a stable model of relative to . Clearly, every stable model of is a model of 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 in this section reduces to the one in the previous section when all intensional constants in are predicate constants only.
When all intensional constants are function constants only, the definition of is similar to the first-order nonmonotonic causal theories defined in [Lifschitz, 1997]. The only difference is that, instead of , a different expression is used there. A more detailed comparison is given in Section 7.1.
We will often write as and identify a finite set of formulas with the conjunction of the universal closures of each formula in that set.
For any formula , expression denotes the “choice” formula .
The following two lemmas are often useful in simplifying , as we demonstrate in Example 1 below. They are natural extensions of Lemmas 5 and 6 from [Ferraris et al., 2011].
Lemma 1
Formula
is logically valid.
Proof. By induction on the structure of .
Lemma 2
Formula
is logically valid.
Proof. Immediate from Lemma 1.
Example 1
The following program describes the level of an unlimited water tank that is filled up unless it is flushed.
(6) |
Here is an intensional function constant, and 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 .
Using Lemmas 1 and 2, under the assumption , one can check that formula is equivalent to the conjunction consisting of (6) and
(7) |
so that
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.
Flush | |||
---|---|---|---|
false | |||
false | |||
true |
-
•
Interpretation is in accordance with the intuitive reading of the rules above, and it is indeed a model of .
-
•
Interpretation is not intuitive (the amount suddenly jumps up with no reason). It is not a model of though it is a model of .
-
•
Interpretation is in accordance with the intuitive reading of the rules above. It is a model of .
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 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 containing that occurrence in the antecedent is . For example, in , the occurrences of and are both positive, but only the occurrence of is strictly positive.777Recall that we understand as shorthand for .
About a formula we say that it is negative on a list of predicate and function constants if has no strictly positive occurrence of a constant from . Since any formula of the form is shorthand for , such a formula is negative on any list of constants. The formulas of the form 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 and , if is negative on , then is equivalent to .
Example 2
Consider where is . Since is negative on , according to Theorem 1, is equivalent to , which is equivalent to .
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 , by we denote the formula (recall that is shorthand for ), where is a list of distinct object variables. For any function constant , by we denote the formula , where is an object variable that is distinct from . For any finite list of predicate and function constants , the expression stands for the conjunction of the formulas for all members of . 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 and any disjoint lists , of distinct constants, the following formulas are logically valid:
For example,
is equivalent to
A formula , where is an intensional function constant and , contain no intensional function constants, intuitively represents that takes the value by default. For example, the stable models of relative to map to . On the other hand, the default behavior is overridden when we conjoin the formula with : the stable models of
relative to map to , and no longer to .
The treatment of as is similar to the choice rule in ASP for propositional constant , which stands for , with an exception that has to satisfy a functional requirement, i.e., it is mapped to a unique value. Under that requirement, an interpretation that maps to is a stable model but another assignment to is not a stable model because the choice rule itself does not force one to believe that 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
(8) |
where Loc is an intensional function constant, represents that the location of a block 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 and , we say that is strongly equivalent to if, for any formula , any occurrence of in , and any list of distinct predicate and function constants, is equivalent to , where is obtained from by replacing the occurrence of by .
The following theorem tells us that strong equivalence can be characterized in terms of equivalence in classical logic.
Theorem 3
Let and be first-order formulas, let be the list of all predicate and function constants occurring in or , and let be a list of distinct predicate and function variables corresponding to . The following conditions are equivalent to each other.
-
•
and are strongly equivalent to each other;
-
•
Formula
(9) is logically valid.
For instance, choice formula is strongly equivalent to . This can be shown, in accordance with Theorem 3, by checking that not only they are classically equivalent but also
and
are classically equivalent under . Indeed, in view of Lemma 2, is equivalent to and is equivalent to . This fact allows us to rewrite formula as an implication in which the consequent is an atomic formula:
For another example, is strongly equivalent to . 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 is in Clark normal form (relative to a list of intensional constants) if it is a conjunction of sentences of the form
(10) |
and
(11) |
one for each intensional predicate constant in and each intensional function constant in , where is a list of distinct object variables, is another object variable, and is a formula that has no free variables other than those in and .
The completion of a formula in Clark normal form relative to , denoted by , is obtained from by replacing each conjunctive term (10) with
(12) |
and each conjunctive term (11) with
(13) |
The dependency graph of (relative to ), denoted by , is the directed graph that
-
•
has all members of as its vertices, and
-
•
has an edge from to if, for some strictly positive occurrence of in ,
-
–
has a strictly positive occurrence in , and
-
–
has a strictly positive occurrence in .
-
–
We say that is tight (on c) if the dependency graph of (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 in Clark normal form relative to that is tight on , an interpretation that satisfies is a model of iff is a model of .
Example 1 Continued Formula is not in Clark normal Form relative to , but it is strongly equivalent to
and further to
which is in Clark normal form relative to and is tight on . In accordance with Theorem 4, the stable models of relative to coincide with the classical models of
The assumption 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 in the presence of intensional function constants, one needs another interpretation that is different from on intensional function constants. If the universe contains only one element, the stability of a model is trivial. For example, take to be and to be an intensional function constant . If the universe of an interpretation is a singleton, then satisfies because there is only one way to interpret , but does not satisfy the completion formula .
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 and an intensional predicate constant , formula is obtained from as follows:
-
•
in the signature of , replace with a new intensional function constant of arity , where is the arity of , and add two new non-intensional object constants and (rename if necessary);
-
•
replace each subformula in with .
By (“Functional Constraint on ”) we denote the conjunction of the following formulas, which enforces to be two-valued:
(14) |
(15) |
where is a list of distinct object variables. By (“Default False on ”) we denote the formula
(16) |
Example 3
Let be the conjunction of the universal closures of the following formulas:
(lower case symbols are variables). We eliminate the intensional predicate constant Move in favor of an intensional function constant to obtain , which is the conjunction of the universal closures of the following formulas:
The following theorem asserts the correctness of the elimination method.
Theorem 5
The set of formulas
entails
The following corollary to Theorem 5 tells us that there is a 1–1 correspondence between the stable models of and the stable models of its “functional image” . For any interpretation of the signature of , by we denote the interpretation of the signature of obtained from by replacing the set with the function such that, for all in the universe of ,
Furthermore, we assume that satisfies (14). Consequently, satisfies .
Corollary 6
Let be a first-order sentence.
-
(a)
An interpretation of the signature of is a model of iff is a model of .
-
(b)
An interpretation of the signature of is a model of iff for some model of .
In Corollary 6 (b), it is clear by the construction of that, for each , there is exactly one 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 in (15) cannot be dropped in general. The formula is not strongly equivalent to . The former is a weaker assertion than the latter under the stable model semantics. Indeed, if it is dropped, in Corollary 6, when is , the empty set is the only model of whereas has two models where is mapped to or .
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 “-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 -Plain Formulas in favor of Intensional Predicates
Let be a function constant. A first-order formula is called -plain [Lifschitz and Yang, 2011] if each atomic formula in it
-
•
does not contain , or
-
•
is of the form where is a tuple of terms not containing , and is a term not containing .
For example, is -plain, but each of , , and is not -plain.
For any list of predicate and function constants, we say that is -plain if is -plain for each function constant in .
Let be an -plain formula, where is an intensional function constant. Formula is obtained from as follows:
-
•
in the signature of , replace with a new intensional predicate constant of arity , where is the arity of ;
-
•
replace each subformula in with .
The following theorem asserts the correctness of the elimination.
Theorem 7
For any -plain formula , the set of formulas
entails
The theorem tells us how to eliminate an intensional function constant from an -plain formula in favor of an intensional predicate constant. By we denote the following formulas that enforce the “functional image” on the predicate ,
(17) |
where is an -tuple of variables, and all variables in , , and 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 in Example 3. We eliminate the function constant Loc in favor of the intensional predicate constant to obtain , which is the conjunction of the universal closures of the following formulas:
(18) |
The following corollary shows that there is a simple 1–1 correspondence between the stable models of and the stable models of . Recall that the signature of is obtained from the signature of by replacing with . For any interpretation of the signature of , by we denote the interpretation of the signature of obtained from by replacing the function with the predicate that consists of the tuples
for all from the universe of .
Corollary 8
Let be an -plain sentence.
-
(a)
An interpretation of the signature of that satisfies is a model of iff is a model of .
-
(b)
An interpretation of the signature of that satisfies is a model of iff for some model of .
In Corollary 8 (b), it is clear by the construction of that, for each , there is exactly one 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 is necessary in Theorem 7 and Corollary 8 because in order to dispute the stability of a model in the presence of intensional function constants, one needs another interpretation that is different from on intensional function constants. Such an interpretation simply does not exist if the condition is missing, so becomes trivially stable. For example, consider the formula with signature and the universe . There is only one interpretation, which maps to . This is a stable model of . On the other hand, the formula , which is , 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 -plain formula in favor of intensional predicate constants. In other words, it tells us that the stable model semantics for -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 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.
where Location, Block, and Time are domain predicates. The first rule says that if the location of at time is , then decide arbitrarily whether to assert at time . In the absence of additional information about the location of at time , asserting will be the only option, as the third rule requires one of the location to be associated with the block at time . But if we are given conflicting information about the location at time due to the Move action, then not asserting will be the only option, and the second rule will tell us the new location of at time .
6.2 Non--plain formulas vs. -plain formulas
One may wonder if the method of eliminating intensional function constants in the previous section can be extended to non--plain formulas, possibly by first rewriting the formulas into -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 to be , where and are object constants. The formula is equivalent to 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 such that .
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 does not force one to believe and .
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 to be where Dom is a predicate constant and is an object constant. The formula can be viewed as applying the sort predicate (i.e., domain predicate) Dom to specify the value range of , but it does not force one to believe that has a particular value. In classical logic, is equivalent to , but their stable models are different. The former has no stable models, and the latter has many stable models, including such that and .
Example 7
A “synonymity” rule [Lifschitz and Yang, 2011] has the form
(19) |
where , are intensional function constants in , and , are tuples of terms not containing members of . This rule expresses that we believe to be “synonymous” to under condition , but it does not force one to assign particular values to and . As a special case, consider vs. . The latter forces one to assign some values to and , 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 w.r.t. a list of constants, denoted by , is recursively defined as follows.
-
•
If is an atomic formula that is -plain, is ;
-
•
If is an atomic formula of the form () such that are all the terms in that contain some members of , then is
where is obtained from by replacing each with a new variable .
-
•
If is an atomic formula of the form () such that are all the terms in that contain some members of , then is
where is obtained from by replacing each with a new variable .
-
•
is , where .
-
•
is , where .
In Example 6, is , and in Example 5, is . In Example 7, is . 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--plain if every strictly positively occurrence of an atomic formula in it is -plain.
For instance, is head--plain, though it is not -plain.
Theorem 9
For any head--plain sentence that is tight on and any interpretation satisfying , we have iff .
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 -plain formulas while preserving stable models.
Theorem 10
For any set of constants, there is no strongly equivalent transformation that turns an arbitrary formula into a -plain formula.
The proof follows from the following lemma.
Lemma 3
There is no -plain formula that is strongly equivalent to .
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
where and are formulas as in first-order logic. We identify a rule with the universal closure of the implication . A causal model of a causal theory is defined as the models of the second-order sentence
where is a list of explainable function constants, and denotes the conjunction of the formulas 121212 represents the universal closure of .
(20) |
for all rules of . By a definite causal theory, we mean the causal theory whose rules have the form either
(21) |
or
(22) |
where is an explainable function constant, is a list of terms that does not contain explainable function constants, and is a term that does not contain explainable function constants. By we denote the theory consisting of the following formulas:
for each rule (21) in , and
for each rule (22) in . The causal models of such coincide with the stable models of .
Theorem 11
For any definite causal theory , iff .
For non-definite theories, they do not coincide as shown by the following example.
Example 8
Consider the following non-definite causal theory :
An interpretation where , and is a causal model of . However, the corresponding formula is equivalent to
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 , where is switch or , and is a time stamp or , be object constants whose values are Boolean, let , where is switch or , be function constants whose values are Boolean, and let be variables ranging over Boolean values. The domain can be formalized in a causal theory as
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) | |
---|---|---|---|---|---|---|
false | true | false | false | false | true | |
false | true | false | true | true | false | |
false | true | true | false | true | false | |
false | true | true | true | true | false | |
false | true | false | false | true | false |
and exhibit the indirect effect of the action Flip. Only 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
The program has four stable models ; The unintuitive causal model 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 -plain formulas. Also, and have the same stable models under the Cabalar semantics, so any complex formula under the Cabalar semantics can be reduced to a -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 -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--plain formulas are weaker than -plain formulas under FSM whereas the Cabalar semantics does not distinguish them. For instance, under the Cabalar semantics, the formula in Example 5 has many stable models as long as ; in Example 6, has many stable models rather than simply restricting the value of to the extent of Dom; in Example 7, 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--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
(23) |
where and are formulas that do not contain . As before, we identify a rule with the universal closure of the implication . 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 be a formula, let be a list of distinct function constants, and let be a list of distinct function variables similar to . By we denote the formula obtained from by replacing each non-negated occurrence of a member of with the corresponding function variable in . By we denote the second-order sentence
According to [Lifschitz, 2012], the -stable models of an IF-program are defined as the models of , where is the FOL-representation of .
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 be the following program
and let be an interpretation such that , and . is a model of , but not a model of . The former is not intuitive from the rationality principle because does not even appear in the head of a rule.
Example 11
Let be the following program
and let and be interpretations such that and , , , . The interpretations and are models of . On the other hand, has no models.
Example 12
Let be and let be . 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 be an interpretation such that and . satisfies but not .
While is a constraint in our formalism, in view of Theorem 1, the last example illustrates that 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 be an IF-program whose rules have the form
(24) |
where is an intensional function constant, and do not contain intensional function constants, and is an arbitrary formula. We identify with the corresponding first-order formula. Then we have iff .
8 Many-Sorted FSM
The following is the standard definition of many-sorted first-order logic. A signature is comprised of a set of function and predicate constants and a set of sorts. To every function and predicate constant of arity , we assign argument sorts and to every function constant of arity , we assign also its value sort . 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 (an atom , respectively), the sort of must be a subsort of the -th argument of (, respectively). In addition is an atomic formula if the sorts and and have a common supersort.
A many-sorted interpretation has a non-empty universe for each sort . When is a subsort of , an interpretation must satisfy . 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 of constants in , an interpretation is a stable model of relative to if satisfies , where 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 , we define the signature to contain every function and predicate constant from . In addition, for each sort , we add a unary predicate to .
Given a formula of many-sorted signature , we obtain the formula of the unsorted signature as follows.
We replace every formula , where is a variable of sort , with the formula
where is an unsorted variable and is a predicate constant in corresponding to in . Similarly, we replace every , where is a variable of sort , with the formula
By we denote the conjunction of
-
•
the formulas for every two sorts and in such that is a subsort of (),
-
•
the formulas for every sort in
-
•
the formulas
for each function constant in , where the arity of is , and the -th argument sort of is and the value sort of is .
-
•
the formulas
for each function constant in , where the arity of is and the -th argument sort of is .
-
•
the formulas
for each predicate constant in , where the arity of is , and the -th argument sort of is .
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 to dispute the stability of can only disagree with 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 -plain, which illustrates the usefulness of non--plain formulas.
We map an interpretation of a many-sorted signature to an interpretation of an unsorted signature as follows. First, the universe of is . We specify that the sort predicates and sorts correspond by defining the extent of sort predicate for every sort as
For every function constant in and every tuple comprised of elements from , we take
where is an arbitrarily chosen element in the universe (we use the same element for every situation this case holds).
For every predicate constant in and every , we take
Note that false was arbitrarily chosen.
The choice of mapping a function whose arguments are not of the intended sort to the value 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 and are related with relation , denoted , if for every predicate or function constant , we have whenever each where is the -th argument sort of .
Theorem 13
Let be a formula of a many-sorted signature , and let be a set of function and predicate constants.
-
(a)
If an interpretation of signature is a model of , then is a model of .
-
(b)
If an interpretation of signature is a model of then there is some interpretation of signature such that is a model of and .
Example 13
Consider where both the argument and the value sort of function constant are . Take to be . The many-sorted interpretation such that , , for is clearly a stable model of . However, if we drop the last two items of , formula is
and is an unsorted interpretation such that , , , for , for , which is not a stable model of since we can take that is different from only on , i.e., , to dispute the stability of .
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 + [Giunchiglia et al., 2004] and [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 of symbols called multi-valued propositional constants (mvp-constants), along with a nonempty finite set of symbols, disjoint from , assigned to each mvp-constant . We call the domain of . A multi-valued propositional atom (mvp-atom) of a signature is an expression of the form (“the value of is ”) where and . A multi-valued propositional formula (mvp-formula) of is a propositional combination of mvp-atoms.
A multi-valued propositional interpretation (mvp-interpretation) of is a function that maps every element of to an element of its domain. An mvp-interpretation satisfies an mvp-atom (symbolically, ) if . The satisfaction relation is extended from mvp-atoms to arbitrary mvp-formulas according to the usual truth tables for the propositional connectives.
The reduct of an mvp-formula relative to an mvp-interpretation is the mvp-formula obtained from by replacing each maximal subformula that is not satisfied by with . is called a stable model of if is the only mvp-interpretation satisfying .
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 is identified with an intensional object constant whose sort is . Each value in is identified with a non-intensional object constant of the same sort , except that if the same value belongs to multiple domains, the sort of 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 and , then the sort of is , while the sort of is and the sort of is . An mvp-atom is identified with an equality between an intensional object constant and a non-intensional object constant .
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 for some intensional object constant .
It is easy to check that an mvp-interpretation is a stable model of in the sense of multi-valued propositional formulas iff is a stable model of in the sense of the functional stable model semantics. Under this view, every mvp-formula is identified with a -plain formula, where 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 be the many-sorted signature of the background theory . An interpretation of is called the background interpretation if it satisfies the background theory. For instance, in the theory of reals, we assume that contains the set of symbols for all real numbers, the set of arithmetic functions over real numbers, and the set of binary predicates over real numbers. A background interpretation interprets these symbols in the standard way.
Let be a signature that contains . An interpretation of is called a -interpretation if it agrees with the fixed background interpretation of on the symbols in .
A -interpretation is a -model of if it satisfies .
For any list of constants in , a -interpretation is a -stable model of relative to if satisfies .
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 . If the accelerator is activated, the car will speed up with constant acceleration until the accelerator is released or the car reaches its maximum speed , whichever comes first. If the brake is activated, the car will slow down with acceleration 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 , it should be at rest at the other end.
This example can be represented in ASPMT as follows. Below ranges over time steps, is a Boolean variable, are variables over nonnegative reals, and and 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
Both Accel and Decel cannot be performed at the same time:
The effects of Accel and Decel on Speed are described as
The preconditions of Accel and Decel are described as
Speed is inertial:
Speed at any moment does not exceed the maximum speed MS:
Location is defined in terms of Speed and Duration as
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 , consider the rules that have in the head:
( is strongly equivalent to ). The completion turns them into the following equivalence:
(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 + [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 + 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 +, and cplus2aspmt can be used to compute the action language modulo ODE by translating + into ASPMT. For example, the effect of Accel in Example 14 can be represented using ODE as
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 -complete decision procedure [Gao et al., 2013a] for such an SMT formula returns false if is unsatisfiable, and returns true if its syntactic “numerical perturbation” of by bound is satisfiable, where 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 , where is a set of constraint variables with their respective domains in , and is a set of constraints that specify some legal assignments of values in the domains to the constraint variables.
A clingcon program [Gebser et al., 2009] with a constraint satisfaction problem is a set of rules of the form
(26) |
where is a propositional atom or , is a set of positive propositional literals, is a set of negative propositional literals, and Cn is a set of constraints from , 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 , where is a set of object constants, which is identified with the set of constraint variables in , whose value sorts are identified with the domains in ; we assume that is disjoint from and contains all values in as object constants, and other symbols to represent constraints, such as , , and . In other words, we represent a constraint as a formula over where is a formula of the signature and is obtained from by substituting the object constants in for . We say this background theory conforms to .
For any signature that consists of object constants and propositional constants, we identify an interpretation of as the tuple , where is the restriction of onto the object constants in , and is a set of propositional constants in that are true under .
Given a clingcon program with , and a -interpretation , we define the constraint reduct of relative to and (denoted by ) as the set of rules for each rule (26) in such that , and . We say that a set of propositional atoms is a constraint answer set of relative to if is a minimal model of .
Example 1 continued The rules
are identified with
under the semantics of clingcon programs with the theory of integers as the background theory; , are object constants and Flush is a propositional constant. Consider in Example 1, which can be represented as where maps to , and to , and . The set is the constraint answer set relative to because is the minimal model of the constraint reduct relative to and , 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 with the conjunction of implications for all rules (26) in . The following theorem tells us that clingcon programs are a special case of ASPMT in which the background theory conforms to , 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 be a clingcon program with CSP , let be the set of all propositional constants occurring in , let be the background theory conforming to , and let be a -interpretation. Set is a constraint answer set of relative to iff is a -stable model of relative to .
Note that a clingcon program does not allow an atom that consists of elements from both and . Thus the truth value of an atom is determined by either or , 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 -stable models of an ASPMT program relative to are precisely SMT models of with background theory . 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
(27) |
where is a propositional atom or , is a set of positive propositional literals, and is a set of negative propositional literals, and is a set of theory atoms—linear constraints of the form where , each is an object constant whose value sort is integers (or reals), and each , is an integer (or real).
An ASP(LC) program can be viewed as an ASPMT formula whose background theory is the theory of integers or the theory of reals. We identify an ASP(LC) program with the conjunction of ASPMT formulas for all rules (27) in .
An LJN-intepretation is a pair where is a set of propositional atoms and is a subset of theory atoms occurring in such that there is some -interpretation that satisfies , where is the set of negations of each theory atom occurring in but not in . An LJN-interpretation satisfies an atom if , the negation of an atom if , and a theory atom if . The notion of satisfaction is extended to other propositional connectives as usual.
The LJN-reduct of a program with respect to an LJN-interpretation , denoted by , consists of rules for each rule (27) such that satisfies . is an LJN-answer set of if satisfies , and is the smallest set of atoms satisfying .
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 be an ASP(LC) program of signature where is a set of propositional constants, and let be a set of object constants, and let be an interpretation of .
-
(a)
If is an LJN-answer set of , then for any -interpretation such that , we have .
-
(b)
For any -interpretation , if , then an LJN-interpretation where
is an LJN-answer set of .
Example 15
Let be
The LJN-interpretation is an answer set of since is satisfiable (e.g., take ) and the set is the minimal model satisfying the reduct , which is equivalent to . In accordance with Theorem 15, the interpretation such that satisfies .
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 consists of type definitions and a set of rules of the form
(28) |
where is or an atom, and () and () 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 is a -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 . The functional reduct of under is a normal logic program without functions obtained from by
-
1.
replacing each functional term with where ;
-
2.
removing any rule containing or where , are distinct constants;
-
3.
removing any remaining equalities from the remaining rules;
-
4.
removing any rule containing in the body of the rule where ;
-
5.
removing any remaining from the bodies of the remaining rules.
A -interpretation is an answer set of in the sense of [Lin and Wang, 2008] if is the minimal model of .
The following theorem tells us that programs are a special case of FSM formulas whose function constants are non-intensional.
Theorem 16
Let be an LW-program and let be the FOL-representation of the set of rules in . The following conditions are equivalent to each other:
-
(a)
is an answer set of in the sense of [Lin and Wang, 2008];
-
(b)
is a -interpretation that satisfies where is the list of all predicate constants occurring in .
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 + 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 : 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 in the universe of , we introduce a new symbol , called an object name. By we denote the signature obtained from by adding all object names as additional object constants. We will identify an interpretation of signature with its extension to defined by .
We assume the primary connectives of infinitary ground formulas to be , , , and . The usual propositional connectives are considered as shorthands: as , and as .
Let be the set of all ground atomic formulas of signature . The sets are defined recursively as follows:
-
•
;
-
•
consists of expressions and , for all subsets of , and of the expressions , where and belong to .
We define , and call elements of infinitary ground formulas of w.r.t. .
For any interpretation of and any infinitary ground formula w.r.t. , the definition of satisfaction, , is as follows:
-
•
For atomic formulas, the definition of satisfaction is the same as in the standard first-order logic;
-
•
if there is a formula such that ;
-
•
if, for every formula , ;
-
•
if or .
Given an interpretation, we identify any first-order sentence with an infinitary ground formula via the process of grounding relative to that interpretation. Let be any first-order sentence of a signature , and let be an interpretation of . By we denote the infinitary ground formula w.r.t. that is obtained from by the following process:
-
•
If is an atomic formula, is ;
-
•
;
-
•
;
-
•
.
A.2 Stable Models in terms of Grounding and Reduct
For any two interpretations , of the same signature and any list of distinct predicate and function constants, we write if
-
•
and have the same universe and agree on all constants not in ,
-
•
for all predicate constants in ,161616For any symbol in a signature, denotes the evaluation of on . and
-
•
and do not agree on .
The reduct of an infinitary ground formula relative to an interpretation is defined as follows:
-
•
For any atomic formula ,
-
•
-
•
-
•
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 be a sentence and let be a list of intensional constants. An interpretation satisfies iff
-
•
satisfies , and
-
•
no interpretation such that satisfies .
Appendix B Proofs
B.1 Proof of Theorem 1
Theorem 1 For any first-order formulas and , if is negative on , is equivalent to .
B.2 Proof of Theorem 2
Lemma 4
is equivalent to
Proof. is the conjunction for each predicate in of and for each function in of .
First,
is equivalent to
which is further equivalent to
or simply .
Next,
is equivalent to
which is further equivalent to
or simply .
Thus, is the conjunction for each predicate in of and for each function in of , or simply is
Theorem 2 For any first-order formula and any disjoint lists , of distinct constants, the following formulas are logically valid:
Proof. The proof is not long, but there is a notational difficulty that we need to overcome before we can present it. The notation does not take into account the fact that the construction of this formula depends on the choice of the list of intensional constants. Since the dependence on is essential in the proof of Theorem 2, we use here the more elaborate notation . For instance, if is then
It is easy to verify by induction on that for any disjoint lists , of distinct predicate constants,
(29) |
(i) In the notation introduced above, is
By (29), this formula can be written also as
which is equivalent to
(30) |
On the other hand, is
(31) |
B.3 Proof of Theorem 3
Recall that about first-order formulas and we say that is strongly equivalent to if, for any formula , any occurrence of in , and any list of distinct predicate and function constants, is equivalent to , where is obtained from by replacing the occurrence of by .
Lemma 5
Formula
is logically valid.
Proof. By induction on the structure of .
The following lemma is equivalent to the “only if” part of Theorem 3.
Lemma 6
If the formula (9) is logically valid, then is strongly equivalent to .
Proof. Assume that (9) is logically valid. We need to show that
(32) |
is equivalent to
(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 is strongly equivalent to , then (9) is logically valid.
Proof. Let be the formula . Let stand for , and be . Since is strongly equivalent to , the formula is equivalent to .
Recall that by Lemma 4, , which we abbreviate as , is equivalent to
On the other hand, can be equivalently rewritten as
It follows that
is logically valid.
It is easy to see that can be rewritten as
and that is equivalent to
Using these two facts and Lemma 1, we can simplify as follows:
Theorem 3 Let and be first-order formulas, let be the list of all constants occurring in or , and let be a list of distinct predicate and function variables corresponding to . The following conditions are equivalent to each other.
-
•
and are strongly equivalent to each other;
-
•
Formula
is logically valid.
B.4 Proof of Theorem 4
Lemma 8
For any first-order sentence , any list of constants, and any interpretations and such that , if and , then there is some constant occurring strictly positively in such that .
Proof. By induction on the structure of .
Lemma 9
If a ground formula is negative on a list of predicate and function constants, then for every ,
Proof. By induction on the structure of .
Theorem 4 For any formula in Clark normal form relative to that is tight on , an interpretation that satisfies is a model of iff is a model of .
Proof. In this proof, we use Theorem 17 and refer to the reduct-based characterization of a stable model.
Take an interpretation that is a model of . is clearly a model of . We wish to show that, for any interpretation such that , we have . Let be a subset of consisting of constants on which and disagree, that is, . Let be a constant from such that there is no edge in the dependency graph from to any constant in . Such an is guaranteed to exist since is tight on .
If is a predicate, then for some , we have and by definition of . If is a function, then for some , we have and .
Since is in Clark normal form, there must be a rule in of the form if is a predicate ( if is a function) where may be . Further it must be that since if not, would not be a model of . Thus, the corresponding rule in is ( if is a function).
Now there are two cases to consider:
-
•
Case 1: . In this case, (or if is a function) and so .
-
•
Case 2: . By Lemma 8, there is a constant occurring strictly positively in that and disagree on. However, this means there is an edge from to and since and disagree on , belongs to which contradicts the fact that was chosen so that it had no edge to any element in . Thus this case cannot arise.
() Assume . can be viewed as the conjunction of , where each is an atomic formula containing each intensional constant . It is sufficient to prove that for each such formula. Assume for the sake of contradiction that for some formula whose contains an intensional constant , and for some list of object names.
Consider an interpretation that differs from only in that . ( means there are at least two elements in the universe so this is possible when is a function constant.)
-
•
Clearly, because .
-
•
For other rules where is a list of object names different from , clearly, iff . Since is negative on and , by Lemma 9 we have iff . Since , it follows that .
-
•
For all other rules whose has an intensional constant different from , we have . Since is negative on and , by Lemma 9, we have .
The presence of contradicts that .
B.5 Proof of Theorem 5
Proof. For any interpretation of signature satisfying (34), it is clear that iff since is a tautology and is equivalent to under (34). Thus it only remains to be shown that
iff
Let be an extended signature such that are similar to respectively, and do not belong to .
() Assume . This is equivalent to saying that there is an interpretation of that agrees with on all constants other than and such that of signature satisfies .
It is sufficient to show that there is an interpretation of that agrees with on all constants other than such that of signature satisfies . We define the interpretation of on as follows:
We now show :
-
•
Case 1: . Since , by definition and and since in this case, , it must be that . From this, we conclude . Further, since , we conclude .
-
•
Case 2: . Since , by definition, and . Thus, since in this case , it must be that . From the definition of and from (34), this is equivalent to . Thus, we conclude and since , we further conclude that .
We now show :
Since , by definition, , or equivalently and by contraposition, . Finally, by (34),, and the definition of , or simply .
We now show by proving the following:
Claim: iff .
The proof of the claim is by induction on the structure of .
-
•
Case 1: is an atomic formula not containing . is exactly thus is exactly so certainly the claim holds.
-
•
Case 2: is where contains an intensional function constant from . is where is the result of replacing all intensional functions from occurring in with the corresponding function from . Since is , formula is . The claim follows from (34) and the definition of .
-
•
Case 3: is where does not contain any intensional function constant from . is . Since is , formula is . Since , if , then . The claim follows from (34) and the definition of .
-
•
The other cases are straightforward from I.H.
() Assume . This is equivalent to saying that there is an interpretation of that agrees with on all constants other than and such that of signature satisfies .
It is sufficient to show that there is an interpretation of that agrees with on all constants other than such that of signature satisfies . We define the interpretation of on as follows:
We now show :
-
•
Case 1: . By definition of and by (34), in this case, and in particular, . Since , by definition and and since in this case, , it must be that . From this, we conclude . Further, since , we conclude .
-
•
Case 2: . Since , it must be that . From this, we conclude by definition of , (note that is essential here) and (34) that . Equivalently, this is or simply .
Now, since , then . Thus, for the assumption in this case that to hold, it must be that . By defintion of and (34), it follows that . Thus, since , then . Also, since , by definition , and thus we conclude that .
The proof of is by induction similar to the proof of the claim above.
B.6 Proof of Corollary 6
For two interpretations of signature and of signature , by we denote the interpretation of signature and universe that interprets all symbols occurring only in in the same way does and similarly for and . For symbols appearing in both and , must interpret these the same as does, in which case also interprets the symbol in this way.
Corollary 6
-
(a)
An interpretation of the signature of is a model of iff is a model of .
-
(b)
An interpretation of the signature of is a model of iff for some model of .
Proof.
(a) Assume of the signature of is a model of . By definition of , . Since , it must be that and further by Theorem 5, . By Theorem 1, we have . Finally, since the signature of does not contain , we conclude .
(a) Assume is a model of . By Theorem 1, is a model of . By definition of , . Since , it must be that and further by Theorem 5, . Finally, since the signature of does not contain , we conclude .
(b) Assume an interpretation of the signature of is a model of . Let , where denotes the interpretation of the signature obtained from by replacing with the set that consists of the tuples for all from the universe of such that . By definition of , . Since , it must be that . Since is comprised of constraints, by Theorem 1, . In particular, and further by Theorem 5, . Finally, since the signature of does not contain , we conclude .
B.7 Proof of Theorem 7
Proof. For any interpretation of signature satisfying (35), it is clear that iff since is simply the result of replacing all with . Thus it only remains to be shown that
iff
Let be an extended signature such that are similar to respectively, and do not belong to .
() Assume . This is equivalent to saying that there is an interpretation of that agrees with on all constants other than and such that of signature satisfies .
It is sufficient to show that there is an interpretation of that agrees with on all constants other than such that of signature satisfies . We define the interpretation of on as follows:
We first show that if then :
Observe that from the definition of , it follows that and from (35), this is equivalent to or simply . Thus, since , we have .
-
•
Case 1: .
In this case it then must be the case that . Thus it follows that . Consequently, we conclude thator simply, .
-
•
Case 2: .
In this case it then must be the case that for some and that . By the definition of , this means that but by (35), . Therefore, and thus . Consequently, we concludeor simply, .
We now show that by proving the following:
Claim: iff
The proof of the claim is by induction on the structure of .
-
•
Case 1: is an atomic formula not containing . is exactly thus is exactly so certainly the claim holds.
-
•
Case 2: is . is . is and is . By the definition of , it is clear that iff , so certainly the claim holds.
-
•
The other cases are straightforward from I.H.
() Assume . This is equivalent to saying that there is an interpretation of that agrees with on all constants other than and such that of signature satisfies .
It is sufficient to show that there is an interpretation of that agrees with on all constants other than such that of signature satisfies . We define the interpretation of on as follows:
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 entailing .
We first show if then :
Observe that by definition entails
and further by definition,
and then since and are not predicates, .
-
•
Case 1: . In this case, so for it to be the case that , it must be that . It then follows that . Consequently, in this case, or simply .
-
•
Case 2: . In this case, since , then it follows that . It follows from the definition of that and then from (35), it follows that or simply . It then follows that . Consequently, in this case or simply .
Next, the proof of is by induction similar to the proof of the claim above.
B.8 Proof of Corollary 8
Corollary 8 Let be an -plain sentence.
-
(a)
An interpretation of the signature of that satisfies is a model of iff is a model of .
-
(b)
An interpretation of the signature of that satisfies is a model of iff for some model of .
Proof.
(a) Assume . Since , since by definition of , and share the same universe.
By definition of , . Since , we have and by Theorem 7, we have . It’s clear that , so by Theorem 1, we have . Since the signature of does not contain , we conclude .
(a) Assume and . By Theorem 1, . Since , we have since by definition of , and share the same universe.
By definition of , . Since , we have and by Theorem 7, we have . Since the signature of does contain , we conclude .
(b) Assume and . Let where denotes the interpretation of the signature of obtained from by replacing the set with the function such that for all tuples in . This is a valid definition of a function since we assume , from which we obtain by Theorem 1 that and specifically, . Clearly, so it only remains to be shown that .
Since and have the same universe and , it follows that . Also by the definition of , we have . Thus by Theorem 7, .
Since we assume , it is the case that and thus it must be the case that . Now since the signature of does not contain , we conclude .
(b)Take any such that and . Since and and share the same universe, . By definition of , . Thus by Theorem 7, .
B.9 Proof of Theorem 9
Theorem 9 For any head--plain sentence that is tight on and any interpretation satisfying , we have iff .
Proof. It is easy to check that the completion of relative to is equivalent to the completion of relative to . By Theorem 4, we conclude that is equivalent to .
B.10 Proof of Theorem 10
For any formula containing object constants and , we call it -indistinguishable if every occurrence of and in is in a subformula of the form that is -plain. For any interpretations and of , we say and satisfy the relation if
-
•
,
-
•
,
-
•
, and
-
•
for all symbols other than and , .
Lemma 10
If a formula is -indistinguishable, then for any interpretations and such that , .
Proof. Notice that any -indistinguishable formula is built on atomic formulas not containing and , and formula of the form , using propositional connectives and quantifiers. The proof is by induction on such formulas.
Theorem 10 For any set of constants, there is no strongly equivalent transformation that turns an arbitrary sentence into a -plain sentence.
Proof. The proof follows from the claim.
Claim: There is no -plain formula that is strongly equivalent to .
Let be . Then is . Let and (numbers are interpreted as themselves). It is easy to check that and .
B.11 Proof of Theorem 11
Theorem 11 For any definite causal theory , iff .
B.12 Proof of Theorem 12
Theorem 12 iff .
Proof. We wish to show that iff . The first conjunctive terms are identical and if then the claim holds.
Let us assume then, that . By definition, is equivalent to . What remains to be shown is the correspondence between and .
Consider any list of functions of the same length as . Let be an interpretation of an extended signature where is an interpretation of and and agree on functions not belonging to .
Consider any rule from . The corresponding rule in is equivalent to
The corresponding rule in is equivalent to
Now we consider cases
-
•
. Clearly, both versions of the rule are vacuously satisfied by .
-
•
. Then, since it must be that and so the corresponding rule in is further equivalent to
which is equivalent to the corresponding rule in and so certainly satisfies both corresponding rules or neither.
Thus, iff and so the claim holds.
B.13 Proof of Theorem 13
Lemma 11
Given a formula of many-sorted signature and an interpretation of , iff .
Proof. By induction on the structure of .
Lemma 12
Given a formula of many-sorted signature , interpretations and of and an interpretation of such that
-
•
for every sort in , ,
-
•
for every predicate and function constant and for every tuple composed of elements from such that for every , where is the -th argument sort of , we have ,
-
•
for every predicate and function constant and for every tuple composed of elements from such that for some , where is the -th argument sort of , we have ,
is a model of iff is a model of .
Proof. By induction on the structure of .
Lemma 13
Given a formula of many-sorted signature and two interpretations and of such that , if , then .
Proof. Assume that . We first show that . Since , and agree on all sort predicates corresponding to sorts . Thus, clearly satisfies the first two items of . We now consider the third item of . For tuples such that each where is the -th argument sort of , since , and agree on so satisfies the implication. For all other tuples, the implication is vacuously satisfied. Finally, the fourth and fifth items of are tautologies in classical logic so we conclude that .
Next, can be shown by induction on the structure of .
Lemma 14
Given a formula of many-sorted signature , a set of function and predicate constants from and two interpretations and of such that , if is a stable model of w.r.t. , then is a stable model of w.r.t. .
Proof. Omitted. The proof is long but not complicated.
Theorem 13 Let be a formula of a many-sorted signature , and let be a set of function and predicate constants.
-
(a)
If an interpretation of signature is a model of , then is a model of .
-
(b)
If an interpretation of signature is a model of then there is some interpretation of signature such that is a model of and .
Proof.
(a) Consider an interpretation (of many-sorted signature ) that is a stable model of w.r.t. . This means that and there is no interpretation such that and . We wish to show that and there is no (unsorted) interpretation such that and . From Lemma 11, iff . It follows from the definition of that so we conclude that iff . For the second item, we will prove the contrapositive: if there is an (unsorted) interpretation such that and , then there is a (many-sorted) interpretation such that and .
Assume there is an interpretation such that and . We obtain the interpretation as follows. For every sort in , . For every predicate and function constant in and every tuple such that each element where is the sort of the -th argument of , we let . 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, does not map a function to a value outside of where is the value sort of . This follows from the fact that and in particular, the third item of . Thus, since , it follows that too maps functions to elements of the appropriate sort.
We now show that . Since , the fourth and fifth rules in are choice formulas that force to agree with on every predicate and function constant for every tuple that has at least one element outside of the corresponding sort. For every predicate and function constant and all tuples that have all elements in the appropriate sort, and agree. Further, since and agree on these as well, it follows immediately since , that .
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 : since the sort predicates are not in , and agree on these predicates. The third condition follows from the fact that since it follows that ; the fourth and fifth rules in are choice formulas that force to agree with for every tuple that has at least one element outside of the corresponding sort. Thus, by Lemma 12, since and thus, , it follows that .
(b) Given an interpretation that is a stable model of w.r.t. , we first obtain the interpretation of as follows.
-
•
;
-
•
= for every corresponding to a sort from ;
-
•
for every tuple such that where is the -th argument sort of ;
-
•
for every tuple such that for some where is the -th argument sort of .
It is easy to see that . By Lemma 14, is a stable model of w.r.t. . We then obtain the interpretation of signature as follows.
For every sort in , . For every predicate and function constant in and every tuple such that where is the sort of the -th argument of , we have . 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, does not map a function to a value outside of where is the value sort of . This follows from the fact that (by Lemma 13) and in particular, the third item of . Thus, it follows that too maps functions to elements of the appropriate sort.
Now it is clear that and so we have . We now show that is a stable model of .
We have an interpretation (of many-sorted signature ) such that is a stable model of w.r.t. . This means that and there is no interpretation such that and . We wish to show that and there is no interpretation such that and . From Lemma 11, iff so we conclude that . For the second item, we will prove the contrapositive; if there is a (many-sorted) interpretation such that and , then there is an (unsorted) interpretation such that and .
Assume there is an interpretation such that and . We obtain the interpretation be .
We now show that . For every predicate and function constant for every tuple that has at least one element outside of the corresponding sort, by definition of , if is a function constant and if is a predicate constant. That is, for every predicate and function constant for every tuple that has at least one element outside of the corresponding sort, and agree. For every predicate and function constant and all tuples of elements in the appropriate sort, and agree. Further, since and agree on these as well, follows immediately from .
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 . The third condition follows from the observation above: by definition of , if is a function constant and if is a predicate constant. Thus, by Lemma 12, since , it follows that .
Then, it is easy to see that by definition of , . Then, by definition of , it is clear that . We will show that .
Since and agree on all sort predicates, it is clear that satisfies the formulas in the first two items of .
Since and agree on all function constants for tuples such that each is in where is the -th argument sort of , it is clear that satisfies the third item of .
The last two items of are only satisfied if agrees with on all predicate (function) constants and all tuples such that some is not in where is the -th argument sort of . However, by definition of and , both and map this to if is a function constant or false if is a predicate constant so satisfies these items. So we conclude that .
B.14 Proof of Theorem 14
Lemma 15
Let be a clingcon program with CSP , let be the background theory conforming to , let be the set of all propositional constants occurring in , let be a -interpretation and let be an interpretation such that . If , then iff .
Proof. Assume .
() Assume . This means that satisfies every rule in the reduct . For each rule of the form (26) in , there are two cases:
- •
-
•
Case 2: or . Clearly, is equivalent to , so .
() Assume . For each rule of the form (26) in , there are two cases:
-
•
Case 1: . In this case, the reduct is empty. Clearly, .
-
•
Case 2: . The reduct is .
-
–
Subcase 1: . is equivalent to . Since , it must be that and . Consequently, , so .
-
–
Subcase 2: (i.e., ). Since , we have so .
-
–
Theorem 14 Let be a clingcon program with CSP , let be the set of all propositional constants occurring in , let be the background theory conforming to , and let be a -interpretation. Set is a constraint answer set of relative to iff is a -stable model of relative to .
Proof.
is a constraint answer set of relative to |
iff
satisfies , and no proper subset of satisfies |
iff (by Lemma 15)
is a -model of , and no interpretation such that satisfies |
iff
B.15 Proof of Theorem 15
Lemma 16
For any ASP(LC) program , any LJN interpretation , and any -interpretation , the following conditions are equivalent:
-
•
;
-
•
For every theory atom occurring in , it holds that iff .
Proof.
-
(i)
Assume . Take any theory atom occurring in .
() Assume . It is immediate that and so by the assumption on , we have .
() Assume . Since , it follows that and so . -
(ii)
Assume that, for every theory atom occurring in , it holds that iff . By definition of , for every occurring in , it follows that iff . Thus and so .
Lemma 17
Given an ASP(LC) program , two LJN-interpretations and such that and , and two -interpretations and such that , and , It holds that iff .
Proof. () Assume . This means that satisfies every rule in the reduct . For each rule of the form (27) in , there are two cases:
-
•
Case 1: .
In this case, the corresponding rule in the reduct isOn the other hand, has two cases:
-
–
Subcase 1: .
Since we assume , it must be that . By Lemma 16, since for all in , so too does and so . In this case, isSince and interpret object constants in the same way and , we have . Thus by definition of , it follows that iff and iff , so the claim holds.
-
–
Subcase 2: . The reduct is either or and in either case, .
-
–
-
•
Case 2: .
By the condition of and by Lemma 16, so is or depending on whether . Thus, trivially satisfies .
() Assume . This means that satisfies every rule in . For any rule of the form (27) in , there are two cases.
-
•
Case 1: .
By the condition of and by Lemma 16, . Thus the reduct does not contain a corresponding rule so there is nothing for to satisfy. -
•
Case 2: .
By the condition of and by Lemma 16, so the reduct is .-
–
Subcase 1: .
By the condition of , and since , . Thus, . -
–
Subcase 2: .
Since , it must be that so the reduct is . Now since and agree on every object constant and since , we have . Thus, iff . Since we assume , we conclude . Now by definition of , it follows that .
-
–
Theorem 15 Let be an ASP(LC) program of signature where is a set of propositional constants, and let be a set of object constants, and let be an interpretation of .
-
(a)
If is an LJN-answer set of , then for any -interpretation such that , we have .
-
(b)
For any -interpretation , if , then an LJN-interpretation where
is an LJN-answer set of .
Proof. In this proof, we refer to the reduct-based characterization of a stable model from [Bartholomew and Lee, 2013c].
Assume is an LJN-answer set of . Take any -interpretation such that .
Now for any atom , by the condition of , we have iff . Similarly, for any theory atom occurring in , by the condition of and by Lemma 16, iff . Thus, since , .
We must now show that there is no interpretation such that and . Take any . That is, such that . By Lemma 17, iff but since is an LJN-answer set of , and thus so is a stable model of .
() Assume is a stable model of .
Now for any atom , by definition of , iff . Similarly, for any theory atom occurring in , by the condition of and Lemma 16, iff . Thus, since , .
We must now show that there is no set of atoms such that and . Take any . By Lemma 17, iff where . Since and is a stable model of , . Thus and so is an LJN-answer set of .
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.