Logic Programming with Graded Introspection Zhizheng Zhang, Bin Wang, Shutao Zhang School of Computer Science and Engineering, Southeast University, Nanjing, China [email protected]

Abstract. This paper develops a logic programming language, GI-log, that extends answer set programming language with a new graded modality Kω where ω ⊆ [0, 1]. The modality is used to precede a literal in rules bodies, and thus allows for the representation of graded introspections in the presence of multiple belief sets: Kω F intuitively means: it is known that the proportion of the belief sets where F is true is in the interval ω. We define the semantics of GI-log, study the relation to the languages of strong introspections, give an algorithm for computing solutions of GI-log programs, and investigate the use of GI-log for formalizing contextual reasoning and conformant planning with threshold. Keywords: Logic Programming, Epistemic Specification, Graded Introspection

1

Introduction

Several epistemic nonmonotonic formalisms have been developed for designing agents capable of introspective reasoning and default reasoning. Examples include the logic of grounded knowledge [5], the logic of MKNF [6], and the language of epistemic specifications (ASPKM ) [7] etc. Those formalisms have proved to be potential in dealing with some important issues in the field of knowledge representation and reasoning, for instance the correct representation of incomplete information in the presence of multiple belief sets [8], epistemic queries[9], commonsense reasoning [8], formalization for conformant planning [10], meta-reasoning [11] etc. Recently, there is increasing research in this direction, e.g. [12][13][14][15]. In those formalisms, four kinds of introspections are usually considered: “a proposition is known”(the proposition is true in all belief sets of the agent), “a proposition may be true”(the proposition is true in some belief sets of the agent), and their negations: “a proposition is not known”(the proposition is not true in some belief sets of the agent), and “a proposition is never true”(the proposition is not true in every belief sets of the agent). For convenient description, we refer to these four kinds of internal senses as strong introspections. In this paper, our purpose is to represent a finer gradation of an agent’s introspections by presenting a new graded modality Kω . Intuitively, for a proposition F , we use Kω F to express that it is known that the proportion of the belief sets where F is true is in the interval ω. We first demonstrate this motivation using the following example. Example 1. Consider a quantitative criteria in hiring Java or Python programmers: (1) Experienced programmers are those who have at least five full years experience in Java or Python programming.

2

Zhizheng Zhang, Bin Wang, Shutao Zhang

(2) An applicant is qualified to enter the interview process if the probability that the applicant is an experienced programmer is high enough e.g., ≥ 0.7. used by a certain company for shortening a list of interview applicants via a Jobseeking website. However, because the website provides only four items, “0 full years”, “1 or 2 full years”, “3 or 4 full years”, and “5 full years and above”, in the RadioBoxes about programming experiences for the applicants, the company cannot get exact time information of the applicants’ programming experiences. Consider for instance, the website has the following experience information of an applicant tom: (3) Tom has 1 or 2 full years experiences in Java programming. (4) Tom has 3 or 4 full years experiences in Python programming. Naturally, (1)-(4) allow us to have three conclusions as below (i) For tom, there are four possible combinations of his experiences in Java and Python developing: 1 full year in Java and 3 full years in Python, 2 full years in Java and 3 full years in Python, 1 full year in Java and 4 full years in Python, and 2 full years in Java and 4 full years in Python. Thus, three of the combinations tell that tom is an experienced programmer (by (1), (3), (4)). (ii) The chance that tom can be viewed as an experienced programmer is 3/4 (by (i)). (iii) tom is allowed to take an interview (by (2) and (ii)). It is also easy to get the conclusion (i) by encoding (1) and (3) and (4) in a logic program ∗Π containing five rules: applicant(tom). prog(tom, java, 1) or prog(tom, java, 2) ← . prog(tom, python, 3) or prog(tom, python, 4) ← . experienced(X) ← applicant(X), prog(X, python, Y1 ), prog(X, java, Y2 ), Y1 + Y2 ≥ 5. ¬experienced(X) ← not experienced(X), applicant(X). that has exactly four answer sets {applicant(tom), prog(tom, java, 1), prog(tom, python, 3), ¬experienced(tom)} {applicant(tom), prog(tom, java, 2), prog(tom, python, 3), experienced(tom)} {applicant(tom), prog(tom, java, 1), prog(tom, python, 4), experienced(tom)} {applicant(tom), prog(tom, java, 2), prog(tom, python, 4), experienced(tom)} which correspond to the four possible combinations of tom’s programming experience. We now expect ∗Π to be able to answer 3/4 to a query proportion of experienced(tom) as we did in conclusion (ii). And furthermore, we now expect to expand ∗Π by a rule that is able to intuitively represent the criterion (2) such that the result program is able to answer Yes to a query interview(tom). It is easy to see, for achieving the above two goals, our representation and reasoning system should have an introspective ability that is able to look at all possible sets and the proportion of each belief in the belief sets. It is easy to see however that, in the strong introspection languages including ASPK and MKNF, the criterion (2) cannot be represented due to the probability in it. Specifically, this paper will address the issue of introspection illustrated in the above example. We develop a logic programming language, GI-log, that extends the answer set

Logic Programming with Graded Introspection

3

programming language with a new graded modality Kω where ω ⊆ [0, 1]. In GI-log, the modalities are used to precede literals in rules bodies, and thus allows us to naturally represent graded introspections. Consider a rule ∗r: interview(X) ← K[0.7,1] experienced(X), applicant(X). it is able to intuitively represent the criterion (2) in the motivation example. The rest of the paper is organized as follows. In the next section, we review the basic principles underlying the answer set semantics of logic programs. In section 3, we introduce syntax and semantics of GI-log. In section 4, we give an algorithm for computing solutions of GI-log programs. In section 5, we consider the relationship between GI-log and the strong introspective languages. In section 6, we investigate the use of GI-log for conformant planning and contextual reasoning. We conclude in section 7 with some further discussion.

2

Answer Set Programming

Throughout this paper, we assume a finite first-order signature σ that contains no function constants of positive arity. There are finitely many Herbrand interpretations of σ, each of which is finite as well. A logic program over σ is a collection of rules of the form l1 or ... or lk ← lk+1 , ..., lm , not lm+1 , ..., not ln . where the ls are literals of σ, not is called negation as failure and not l is often read as ”it is not believed that l is true.”, or is epistemic disjunction. l1 or l1 can be read as ”l1 is believed to be true or l2 is believed to be true.” The left-hand side of a rule is called the head and the right-hand side is called the body. A rule is called a fact if its body is empty and its head contains only one literal, and a rule is called a denial if its head is empty. A logic program is called ground if it contains no variables. [2] intuitively interprets that an answer set associated with a ground logic program is a set of beliefs (collection of ground literals) and is formed by a rational reasoner guided by three principles: – Believe in the head of a rule if you believe in its body (Rule’s Satisfiability principle). – Do not believe in contradictions (Consistency principle). – Believe nothing you are not forced to believe (Rationality Principle). For example for the program p ← not a. q ← not b. a or b. The first rule means “If a does not belong to your set of beliefs, then p must.”, the second rule means “If b does not belong to your set of beliefs, then q must.”, the last rule means “Believe a or believe b.” Clearly, by the three principles, the last says that a is possible to be believed i.e., it may belong to an answer set of the program. This means that the body of the first rule is not satisfied in the answer set, thus the first rule will not contribute to form such answer set. Since it is not forced to believe b, the body of the second rule is satisfied, and hence q must belong to the answer set. Thus, the belief set {a, q} is an

4

Zhizheng Zhang, Bin Wang, Shutao Zhang

answer set of the program. In a similar way, we can construct another answer set {b, p} of the program. The definition of the answer set is extended to any non-ground program by identifying it with the ground program obtained by replacing every variable with every ground term of σ.

3

The GI-log Language

3.1

Syntax

A GI-log program Π is a set of rules of the form l1 or ... or lk ← e1 , ..., em , s1 , ..., sn . where k ≥ 0, m ≥ 0, n ≥ 0, a is an atom in first order logic language, the ls are literals in first order logic language and are called objective literals here, es are extended literals which are objective literals possibly preceded by a negation as failure operator not, ss are subjective literals of the form Kω l where l is an objective literal and Kω is a graded modality consisting of K and an interval ω between 0 and 1. The left-hand side of a rule is called the head and the right-hand side is called the body. As in usual logic programming, a rule is called a fact if its body is empty and its head contains only one literal, and a rule is called a denial if its head is empty. We use head(r) to denote the set of objective literals in the head of a rule r and body(r) to denote the set of extended literals and subjective literals in the body of r. Sometimes, we use head(r) ← body(r) to denote a rule r. The positive body of a rule r is composed of the extended literals containing no not and the subjective literals of the form K[1,1] l in its body. We use body + (r) to denote the positive body of r. r is said to be safe if each variable in it appears in the positive body of the rule. It is clear that a GI-log program containing no subjective literals is a disjunctive logic program that can be dealt with by ASP solvers like DLV[3], CLASP[4]. 3.2

Semantics

We will restrict our definition of the semantics to ground programs. However, we admit rule schemata containing variables bearing in mind that these schemata are just convenient representations for the set of their ground instances. In the following definitions, l is used to denote a ground objective literal. Models of GI-log Programs Let W be a non-empty collection of consistent sets of ground objective literals, < W, w > is a pointed GI-log structure of W where w ∈ W . W is a model of a program Π if for each rule r in Π, r is satisfied by every pointed GI-log structure of W . The notion of satisfiability is defined below. – < W, w >|= l if l ∈ w – < W, w >|= not l if l 6∈ w |l∈v}| – < W, w >|= Kω l if |{v∈W ∈ω |W |

Logic Programming with Graded Introspection

5

Then, for a rule r in Π, < W, w >|= r if – ∃l ∈ head(r): < W, w >|= l – ∃t ∈ body(r): < W, w >6|= t. The satisfiability of a subjective literal does not depend on a specific belief set w in W , hence we can simply write W |= Kω l if < W, w >|= Kω l and say the subjective literal Kω l is satisfied by W . For convenient description, if a literal l can be satisfied by < W, w >, we also say that l is believed with regard to w. World Views of GI-log Programs The definition of the world view consists of two parts. The first part is for disjunctive logic programs. The second part is for arbitrary GI-log programs. Definition 1. Let Π be a disjunctive logic program, the world view of Π is the nonempty set of all its answer sets, written as AS(Π). We immediately have a conclusion below. Theorem 1. Π has an unique world view if it is a consistent disjunctive logic program. Proof. For any consistent disjunctive logic program Π, we have AS(Π) 6= ∅. By the definition 1, Π has an unique world view AS(Π). Now, we give the second part of the definition of the world view to address modalities in an arbitrary GI-log program. Definition 2. Let Π be an arbitrary GI-log program, and W is a non-empty collection of consistent sets of ground objective literals in the language of Π, we use Π W to denote the disjunctive logic program obtained by removing modalities using the following four reduct laws 1. 2. 3. 4.

removing from Π all rules containing subjective literals not satisfied by W . replacing all other occurrences of subjective literals of the form K[1,1] l by l. replacing all other occurrences of subjective literals of the form K[0,0] l by not l. replacing other occurrences of subjective literals of the form Kω l by not l and l respectively, that is, two rules should be created, one in which Kω l is replaced by l and one in which it is replaced by not l.

W is a world view of Π if W is a world view of Π W . Π W is said to be the reduct of Π with respect to W . Such a reduct process eliminates modalities so that the belief sets in the model are identified with the answer sets of the program obtained by the reduct process. The intuitive meanings of the reduct laws can be described as follows: - The first reduct law directly comes from the notion of Rule Satisfiability and Rationality Principle in answer set programming which means if a rules body cannot be satisfied (believed in), the rule will contribute nothing;

6

Zhizheng Zhang, Bin Wang, Shutao Zhang

– The second reduct law states that, if it is known that the proportion of belief sets where l is true is 1, then l must be believed with regard to each belief set in W . Then, by the Rationality Principle in answer set semantics, you are forced to believe l with regard to each belief set. Hence, K[1,1] l should be replaced by l (instead of being removed) to avoid self-support; – The third law states that, if it is known that the proportion of belief sets where l is true is 0, then l is not believed with regard to each belief set in W . Hence, l will not be believed by the Rationality Principle, and K[0,0] l should be replaced by not l; – The last law states that, if it is known that the proportion of belief sets where l is true is greater than 0 but less than 1, then l may be believed or may not be believed with regard to a belief set in W . Hence, replace Kω l by not l and l respectively. Example 2. Consider a GI-log program Π containing rules: a or b ← .

c ← K[0.5,1] a.

Let W = {{a, c}, {b, c}}. Because of W |= K[0.5,1] a, Π W contains rules: a or b ← .

c ← a.

c ← not a.

It is easy to see that W is a world view of Π W , hence, W is a world view of Π. Combine the two parts of the definition of the world view, it is easy to get the following conclusion. Definition 3. For an arbitrary GI-log program Π, a non-empty set W is its world view if and only if W = AS(Π W ). Definition 4. A GI-log program is said to be consistent if it has at least one world view. Otherwise, it is said to be inconsistent. Example 3. An inconsistent program: ¬p ← K[0.5,0.5] p.

p ← not ¬p.

← p.

Some GI-log programs have two or more world views. We use W V (Π) to denote the set of all world views of a program Π. Example 4. (A Program with Multiple world views) Π: f ← p.

f ← q.

p or q ← .

← K[0,1) q, q.

← K[0,1) p, p.

← K[0,1) f.

Π has two world views: {{p, f }} and {{q, f }}. Now, we give a program that has a world view containing multiple belief sets. Example 5. Consider Π: p or ¬p ← K[0,1) r. {{p}, {¬p}} is a world view of Π.

Logic Programming with Graded Introspection

7

Some Properties We first consider the introspective ability of a GI-log based agent. Definition 5. Let Π be a GI-log program, a pair (l, ω) where l is a ground objective literal and ω ⊆ [0, 1] is true in Π (written by Π |=ω l) if ∀W ∈ W V (Π) W |= Kω l. Theorem 2. Π ∪ {← Kω l.} is inconsistent if Π |=ω l. Proof. Let Π 0 = Π ∪{← K ω l.}. Suppose Π 0 is consistent, then for any W ∈ W V (Π 0 ), W 6|= Kω l and W is a world view of Π, then Π 6|=ω l (by the definition 5). That is a contradiction. Example 6. Consider Π = ∗Π ∪ ∗r where ∗Π and ∗r are given in section 1. It is easy to see that Π has an unique world view containing belief sets: {applicant(tom), prog(tom, java, 1), prog(tom, python, 3), ¬experienced(tom), interview(tom)} {applicant(tom), prog(tom, java, 2), prog(tom, python, 3), experienced(tom), interview(tom)} {applicant(tom), prog(tom, java, 1), prog(tom, python, 4), experienced(tom), interview(tom)} {applicant(tom), prog(tom, java, 2), prog(tom, python, 4), experienced(tom), interview(tom)} Then Π |=[0.75,0.75] experienced(tom) and Π |=[1,1] interview(tom), and it is easy to verify that both the GI-log program Π ∪ {← K[0.75,0.75] experienced(tom).} and the GI-log program Π ∪ {← K[1,1] interview(tom).} are inconsistent. Second, we find that the division of the intervals in the subjective literals will not change the world views of a GI-log program. This is in line with our intuition. Definition 6. A pair (r1 , r2 ) of rules is called a substitute of a rule r if there exists exactly one subjective literal Kω l in r such that: (1) r1 is obtained from r by replacing Kω l with a subjective literal Kω1 l, and r2 is obtained from r by replacing Kω l with a subjective literal Kω2 l, and (2) ω1 ∪ ω2 = ω. Theorem 3. If a GI-log program Π 0 is obtained from a GI-log program Π by replacing a rule r of Π with rules in a substitute of r, then W V (Π 0 ) = W V (Π). Proof. Let W be a non-empty collection of consistent sets of ground objective literals, we can prove Π W = (Π 0 )W , that means W V (Π 0 ) = W V (Π)(by Definition 3)1 . Consider a GI-log program Π containing one rule:p ← K[0,1) ¬p.. Let Π 0 consist of two rules in a substitute of the rule of Π: p ← K[0,0.3] ¬p. p ← K(0.3,1) ¬p. It is easy to see that W V (Π 0 ) = W V (Π) = {{{p}}}. 1

The complete proofs of the remaining theorems in this paper will be included in an expanded version of the paper.

8

Zhizheng Zhang, Bin Wang, Shutao Zhang

4

Relation to Strong Introspection Languages

In this section we will explore the representation of strong introspection in GI-log by investigating the relationship between GI-log and other two strong introspection languages: MNKF and ASPKM . We show that ASPKM logic programs in [10] where the most recent version of ASPKM is defined, and a special kind of MKNF theories can be viewed as GI-log programs. 4.1

Relation to ASPKM

An ASPKM program is a set of rules of the form h1 or ... or hk ← b1 , ..., bm . where k ≥ 0,m ≥ 0, hs are objective literals, and each b is an objective literal possible preceded by a negation as failure operator not, a modal operator K or M, or a combination operator not K or not M. The semantics of an ASPKM program is defined by a notion of world view2 . Let W be a non-empty collection of consistent sets of ground objective literals, W is a world view of an ASPKM program Π if W = AS(ΠW ) where ΠW is a disjunctive logic program obtained using Modal Reduct laws3 . Theorem 4. From an ASPKM program Π, a GI-log program Π 0 is obtained by - Replacing all occurrences of literals of the form Kl in Π by K[1,1] l. - Replacing all occurrences of literals of the form Ml in Π by K(0,1] l and not not l4 respectively. - Replacing all occurrences of literals of the form not Kl in Π by K[0,1) l and not l respectively. - Replacing all occurrences of literals of the form not Ml in Π by K[0,0] l. then W is a world view of Π 0 iff W is a world view of Π. Proof. Let W be a non-empty collection of consistent sets of ground objective literals, we can prove ΠW = (Π 0 )W , that means W is a world view of Π if and only if W is a world view of Π. Consider an ASPKM program Π: p ← Mp., Π has an unique world view {{p}}. By the above theorem, Π0 is: p ← K(0,1] p. and then Π 0 contains two rules: p ← K(0,1] p. and p ← not not p.. It is easy to see that Π 0 has an unique world view {{p}}. A GI-log program is built on a finite Herbrand universe, thus the complexity of deciding whether subjective literals of the form Kω l is satisfied by a candidate world view W is same for any ω. Hence, just like the complexity of ASP KM showed in [13], deciding whether a GI-log program has a world view is in PSPACE. 2

3

4

To distinguish the world view semantics defined in [10] from the world view semantics in this paper, we use bold face world view to denote the former. Interested readers can find the detailed definition of world view of an ASPKM programs in [10]. Here, we view not not l as a representation of not l0 where we have l0 ← not l and l0 is a fresh literal. It is worthwhile to note that CLINGO[22] is able to deal with not not.

Logic Programming with Graded Introspection

4.2

9

Relation to MKNF

A MKNF formula is built from propositional symbols using the standard propositional connectives and two modal operators: K and not. A MKNF theory is a set of formulas. Theorem 5. For a MKNF theory T that is a set of formulas of the form Kl1 ∧ ... ∧ Klm ∧ not lm+1 ∧ ... ∧ not ln ⊃ Kl

(1)

where n ≥ m ≥ 0, the ls are objective literals, a GI-log program Π 0 is obtained from T by identifying a formula of the form (1) with the rule l ← K[1,1] l1 , ..., K[1,1] lm , K[0,1) lm+1 , ..., K[0,1) ln

(2)

Then, W is a model of Π 0 iff W is a model of T . Proof. By the definition of the model of a MKNF formula5 , we can get that, for a non-empty collection W of consistent sets of ground objective literals and 1 ≤ i ≤ n, W |= Kli under the semantics of MKNF iff W |= K[1,1] li under the semantics of GI-log, and W |= not li under the semantics of MKNF iff W |= K[0,1) li under the semantics of GI-log, and then W satisfies the formula (1) under the semantics of MKNF iff W satisfies the rule (2) under the semantics of GI-log. Example 7. Consider a MKNF theory T containing two formulas: not p ⊃ Kq, not q ⊃ Kp. Then we can get Π 0 : q ← K[0,1) p. p ← K[0,1) q. It is easy to see that both Π and Π 0 have models: {{p}, {p, q}} and {{q}, {p, q}}.

5

An Algorithm for Computing World Views

We propose an algorithm for finding world views of GI-log programs composed of safe rules. For ease of presentation, d V p will be used to denote the fresh atom obtained from a literal l, k C α β V p will be used to denote the fresh atom obtained from a subjective literal Kω l, where p is the atom in l, and in the prefixes, V is t if l is p, V is f if l is ¬p, C is cc if ω is a closed interval [α, β], C is oo if ω is an open interval (α, β), C is oc if ω is a closed interval at the right (α, β], and C is co if ω is a closed interval at the left [α, β). Thus, k C α β V p is called a denoter of Kω l and also recorded as k ω l for convenience, and d V p is called a denoter of l. We assume prefixes used here do not occur in Π. Other fresh atoms may be used to avoid conflicts. The algorithm includes the following steps. 1. Obtain a GI-log program Π 0 from Π. For each subjective literal K[1,1] l contained in Π, (a) Replace each occurrence of K[1,1] l with its denoter k cc 1 1 V p. 5

Interested readers can find the detailed definition in [6].

10

Zhizheng Zhang, Bin Wang, Shutao Zhang

(b) Add rules d V p ← l. and k cc 1 1 V p ← d V p, not ¬k cc 1 1 V p. and ¬k cc 1 1 V p ← d V p, not k cc 1 1 V p. where d V p is the denoter of l, k cc 1 1 V p is the denoter of K[1,1] l. 2. Create a disjunctive logic program Π 00 from Π 0 . Rules without subjective literals are left unchanged. For each rule r containing a subjective literal Kω l (a) Eliminate Kω l by the following laws: i. if ω = [0, 0], replace Kω l with k ω l, not l . ii. if ω 6= [0, 0], A. Add a rule obtained from r by replacing Kω l with k ω l, not l, and B. Add a rule obtained from r by replacing Kω l with k ω l, l (b) Add rules k ω l ← body + (r), not ¬k ω l. and ¬k ω l ← body + (r), not k ω l. 3. Compute the set AS(Π 00 ) of answer sets of Π 00 using ASP grounder-solver like DLV, CLINGO etc. 4. Generate a set CW V (Π) of candidate world views from AS(Π 00 ). Group the answer sets in AS(Π 00 ) by common k− and ¬k −literals. Each group is said to be a candidate world view. 5. Generate world views of Π by checking each candidate world view in CW V (Π). For each candidate world view W , check that the following condition are met – if k ω l is a common literal in W , then W |= Kω l is true. – if ¬k ω l is a common literal in W , then W |= Kω l is false. Let WS denote the set of literals with a prefixes k or ¬k or d in W. {A|∃B ∈ W, A = B − WS } is a world view of Π if the above two conditions are met. Theorem 6. The algorithm of computing world views is sound and complete. Proof. The proof includes three parts. The first part considers when Π contains no subjective literals, that is, Π is a disjunctive logic program. We can easily prove that AS(Π) = AS(Π 00 ), that is, W V (Π) = W V (Π 00 ). The second part considers when Π contains no variables. We can first prove that, for any W ∈ W V (Π), ∀w ∈ W (w ∈ AS(Π 00 )) is true. Then, we can prove that, for any candidate world view k(W ) W , AS(Π W ) = AS((Π 00 )GL ) where k(W ) is the set of common k and ¬k literals k(W ) in W and (Π 00 )GL is the Gelfond-Lifschitz reduct of Π 00 with regard to k(W ). The third part proves that the conclusion of the second part can be extended to an GI-log program Π containing variables.

Logic Programming with Graded Introspection

11

Now, we consider the complexity of the algorithm informally. Let L be the set of all ground literals in Π. It is easy to see that: step 1 and step 2 take linear time and needs a polynomial space; step 3 calls an ASP solver PPwhere deciding whether a given disjunctive logic program has some answer sets is 2 -complete and needs a polynomial space [23]; step 4 and step 5 generate and check each collection of the subsets of L that costs O(23|L| ), but uses a polynomial space. In summary, the algorithm is in PSPACE and O(23|L| ). A GI-log solver GISolver was implemented using the above algorithm6 .

6

Application

The GI-log encoding of the motivation example has showed the potential application of GI-log. Actually, there are many potential applications of GI-log in domains with incomplete information or default knowledge. In this section we briefly discuss the applications of GI-log in the contextual reasoning and the conformant planning with threshold.

6.1

Contextual Reasoning

We view contextual reasoning as a special case of introspective reasoning. Let C = {1, ..., n} be a set of agents or contexts, for ease of presentation, believe(i, a) will be used to denote the fresh atom obtained from atom a and agent or context i to express that the agent i or the context i believes that a is true, and ¬believe(i, a) will be used to denote the fresh literal to express that the agent i or the context i believes that a is false7 . We define a contextual GI-log program Π C is a set of rules of the form: B(i1 , a1 ) or, ..., or B(ik , ak ) ← KB(ik+1 , ak+1 ), ..., KB(im , am ) where m ≥ k ≥ 0, is are elements of C, as are atoms, B is believe or ¬believe, KB is of the form Kω believe or Kω ¬believe where ω is an interval in [0, 1], p is a decimal in [0,1]. Then, a context model of Π C is a tuple Z = (Z1 , ..., Zn ) obtained from a world view W of Π C by Zi = {(A, θ)|W |= K[θ,θ] B(i, a), θ > 0} where a is an atom, and A is a if B is believe and A is ¬a if B is ¬believe. The following theorem shows that logic programming context systems (LPCS) [16] of some kinds can be viewed as special contextual GI-log programs. An LPCS is a tuple C = (P1 , ..., Pn ) where each Pt is a set of rules of the form l0 ← (i1 : l1 ), ..., (ik : lk ), not(ik+1 : lk+1 ), ..., not(im : lm ) 6 7

(3)

GISolver and some GI-log programs can be found in http://cse.seu.edu.cn/people/seu zzz/. We assume the predicate believe used here does not occur in the domain. Other predicates may be used to avoid conflicts.

12

Zhizheng Zhang, Bin Wang, Shutao Zhang

where m ≥ k ≥ 0, the ls are objective literals, is are elements in {1, ..., n}. The semantics of a LPCS is defined by a notion stable context model8 . We say a LPCS is legible if it has no stable context model that contains inconsistent sets. Theorem 7. For a legible LPCS C = (P1 , ..., Pn ), a contextual GI-log program Π C is obtained from C by identifying the rule of the form (3) in each Pt with the GI-log rule a a B(t, l0a ) ← K[1,1] B(i1 , l1a ), ..., K[1,1] B(ik , lka ), K[0,0] B(ik+1 : lk+1 ), ..., K[0,0] B(im , lm ) (4) where la is the atom in l, B is ‘believe’ if l is an atom and B is ‘¬believe’ if l is a negative literal. Then, (S1 , ..., Sn ) is a stable context model of C iff (S10 , ..., Sn0 ) is a context model of Π C , where Si0 = {(l, 1)|l ∈ Si }.

Proof. First of all, we can construct a nonempty set W of consistent grounded literals from (S10 , ..., Sn0 ) by the definition of the context model. Then, it can be proved that (S1 , ..., Sn ) satisfies the rule (3) under the definition of stable context model semantics if and only if W satisfies the rule (4). For a prisoner’s dilemma example given in [16] where the gains obtained by the agent 1 and 2 are described in the following table:

by the above theorem, from a LPCS in [16]9 , we can obtain a GI-log program Π as below believe(1, choose(d)) ← K[0,0] believe(1, choose(c)). believe(1, choose(c)) ← K[0,0] believe(1, choose(d)). believe(1, best(d)) ← K[1,1] believe(2, choose(c)). believe(1, best(d)) ← K[1,1] believe(2, choose(d)). ← K[1,1] believe(1, choose(X)), K[0,0] believe(1, best(X)). believe(2, choose(d)) ← K[0,0] believe(2, choose(c)). believe(2, choose(c)) ← K[0,0] believe(2, choose(d)). believe(2, best(d)) ← K[1,1] believe(1, choose(c)). believe(2, best(d)) ← K[1,1] believe(1, choose(d)). ← K[1,1] believe(2, choose(X)), K[0,0] believe(2, best(X)). Π has an unique world view: {{believe(1, best(d)), believe(1, choose(d)), believe(2, best(d)), believe(2, choose(d))}}, thus the corresponding context model (Z1 , Z2 ) is ({(choose(d), 1), (best(d), 1)}, {(choose(d), 1), (best(d), 1)}) and corresponds to the Nash equilibrium. 8

9

Interested readers can find the detailed definition of semantics of LPCS in [16], where an agent’s belief set is allowed to be a set of all ground objective literals whenever it contains a pair of complementary literals. Due to lack of space, we refer the reader to [16] for the LPCS

Logic Programming with Graded Introspection

6.2

13

Conformant Planning with Threshold

In this subsection, we consider the use of GI-log in conformant planning [17] with threshold and finite horizon (CPHT ) that is a task of finding any plan with a given length n that achieves the goal with probability higher than a given threshold θ, where the initial state is nondeterministic. We illustrate the use of GI-log with a modification of the slippery gripper problem to mention that it is not difficult to formulate a CPHT problem as a GI-log program, and leave the thorough study of this approach as a future work. In the slippery gripper problem, there are four fluents: holding-block (hb), gripperdry (gd), gripper-clean (gc), and block-painted (bp), three actions:pickup (pickup), dry (dry), and paint (paint), with effects (→): (e1) pickup : gd → hb (e2) pickup :¬gd → hb ∨ ¬hb (e3) dry : → gd (e4) paint : → bp (e5) paint :hb → ¬gc (e6) paint :¬hb → gc ∨ ¬gc. Initially, gc is false, both gd and hb are true or false, and bp is false. The goal is gd ∧ hb ∧ bp ∧ ¬gc. Let I range over natural numbers from 0 to the horizon n, and the threshold be θ. slippery gripper can be modeled as a GI-log program ΠSG where – Effects is specified as a set of rules: (e1) is specified as hold(hb, I + 1) ← occur(pickup, I), hold(gd, I). (e2) is specified as hold(hb, I + 1) or nhold(hb, I + 1) ← occur(pickup, I), nhold(gd, I). (e3) is specified as hold(gd, I + 1) ← occur(dry, I). (e4) is specified as hold(bp, I + 1) ← occur(paint, I). (e5) is specified as nhold(gc, I + 1) ← occur(paint, I), hold(hb, I). (e6) is specified as nhold(gc, I + 1) or hold(gc, I + 1) ← occur(paint, I), nhold(hb, I). Inertial Axiom and Consistency Preservation: hold(X, I + 1) ← hold(X, I), not nhold(X, I + 1), step(I). nhold(X, I + 1) ← nhold(X, I), not hold(X, I + 1), step(I). Consistency Preservation: ← hold(X, I), nhold(X, I). – Initial State is specified as four rules: hold(gc, 0) ← . hold(gd, 0) or nhold(gd, 0) ← . nhold(bp, 0) ← . nhold(hb, 0) or hold(hb, 0) ← . – Goal is specified as a rule: goal(I) ← hold(gd, I), hold(hb, I), hold(bp, I), nhold(gc, I). – Planning Module expresses the security conditions of planning. step(0...n). occur(pickup, I) or occur(dry, I) or occur(paint, I) ← step(I), I < n. success ← goal(n).

14

Zhizheng Zhang, Bin Wang, Shutao Zhang

← K[0,θ) success. ← K[0,1) occur(A, I), occur(A, I). In ΠSG , rules with heads are used to represent the effects of actions or the nondeterministic initial states, the last denial rule formalizes the requirement of conformance of the planning, the last but one denial rule is used to represent the requirement of threshold of the planning. step(0...n) is a convenient representation of step(0).....step(n).. Then, we have Theorem 8. Given a horizon n ≥ 0 and a threshold θ ≥ 0, the slippery gripper problem has a solution a1 , .., an if and only if ΠSG has a world view W such that for any w ∈ W occur(am , m − 1) ∈ w for m = 1, ..., n and w contains no other literals of the form occur(a, j). Proof. We consider the proof by viewing the disjunction logic program based description of the dynamic domain as a transition diagram[2]. First of all, it can be proved that an answer set w of ΠSG − {← K[0,θ) success., ← K[0,1) occur(A, I), occur(A, I).} corresponds to a trajectory of size n that starts from a possible initial state (for easy description, we call a trajectory that starts from a possible initial state a possible trajectory), that is, w is a container of a possible trajectory (for easy description, we directly call w a trajectory). Then, we can show that a world view of ΠSG − {← K[0,1) occur(A, I), occur(A, I).} is a collection of all possible trajectories containing a same sequence of actions. Finally, it can be proved that a world view of ΠSG is a collection of all possible trajectories with the same sequence of actions, and more than θ proportion of the trajectories including success that means the corresponding sequence of actions of the trajectories can take the agent to the planning goal with more than θ probability degree.

7

Conclusion and Future Work

We present a logic programming formalism capable of reasoning that combines nonmonotonic reasoning, epistemic reasoning via a special type of graded introspections. The restriction to logic programming gives us a computationally attractive framework built on the existing efficient answer set solvers. This makes it an elegant way to formalize some non-trivial problems with default knowledge and graded introspections. A limitation of the work in this paper is that we do not consider uncertain beliefs, e.g, probabilistic outcomes of an action. There has been a lot of progress in developing formalisms that formalize uncertainties by combining logical and probabilistic knowledge via logic programming such as Bayesian Logic Program [18], Probabilistic Logic Programming [19], P-Log [20], and LPMLN [21]. As a next goal, we will consider probabilistic introspections in those formalisms using the modalities: Kω F means: it is known that the probability degree of believing F is in the interval ω. Our future work also includes the investigation of the methodologies for modeling with GI-log, and the mathematical properties of GI-log.

Logic Programming with Graded Introspection

15

Acknowledgments This work was supported by the National Science Foundation of China(Grant No.60803061), the National Science Foundation of China(Grant No.61272378), Natural Science Foundation of Jiangsu(Grant No.BK2008293), and the National High Technology Research and Development Program of China(Grant No.2015AA015406).

References 1. Baral, C., Gelfond, M., and Rushton, J. N.: Probabilistic Reasoning with Answer Sets. TPLP 9, 1, 57-144 (2009) 2. Gelfond, M., Kahl, Y.: Knowledge Representation, Reasoning, and the Design of Intelligent Agents: The Answer-Set Programming Approach. Cambridge Unversity Press (2014) 3. Faber, W., Pfeifer, G., Leone, N., Dellarmi, T., AND Ielpa, G.: Design and implementation of aggregate functions in the dlv system. Theory Pract. Log. Program. 8, 5-6 (Nov.), 545-580. (2008) 4. Gebser, M., Kaufmann, B., Schaub, T.: Conflict-driven answer set solving: From theory to practice. Artif. Intell. 187-188, 52-89. (2012) 5. Lin, F. Shoham, Y.: Epistemic semantics for fixed-points non-monotonic logics. In TARK-1990. 111-120.(1990) 6. Lifschitz, V.: Nonmonotonic databases and epistemic queries. In IJCAI-1991. 381-386.(1991) 7. Gelfond, M.: Strong introspection. In AAAI-1991. 386-391.(1991) 8. Gelfond, M.: logic programming and reasoning with incomplete information. Ann. Math. Artif. Intell. 12, 1-2, 89-116.(1994) 9. Gomes, A. S., Alferes, J. J., Swift, T.: Implementing Query Answering for Hybrid MKNF Knowledge Bases. In PADL-2010. 25-39. (2010) 10. Kahl, P., Watson, R., Gelfond, M., Zhang, Y.: A refinement of the language of epistemic specifications. In In Workshop ASPOCP-2014. (2014) 11. Truszczy’nski, M. Revisiting epistemic specifications. In logic programming, knowledge representation, and nonmonotonic reasoning. Springer, 315-333. (2011) 12. Motik, B., Rosati, R. Reconciling description logics and rules. J. ACM 57, 5.(2010) 13. Zhang, Y. Epistemic reasoning in logic programs. In IJCAI. 647-653.(2007) 14. Gelfond, M. New semantics for epistemic specifications. In LPNMR-2011. Springer, 260-265. (2011) 15. Zhang, Z. Zhao, K. Esmodels: an epistemic specification inference. In ICTAI-2013. 769774.(2013) 16. Brewka, G., Roelofsen, F. and Serafini, L.,Contextual Default Reasoning, IJCAI-2007, 268273. (2007) 17. Smith, D. E. and Weld, D. S. Conformant graphplan. In AAAI-1998. 889-896. (1998). 18. Kersting, K., De Raedt, L., and Kramer, S. 2000. Interpreting bayesian logic programs. In Proceedings of the AAAI-2000 workshop on learning statistical models from relational data. 29-35. (2000). 19. Dekhtyar, A. and Dekhtyar, M. I. Possible worlds semantics for probabilistic logic programs. In ICLP-2004. 137-148. (2004). 20. Baral, C., Gelfond, M., and Rushton, J. N. Probabilistic reasoning with answer sets. TPLP 9, 1, 57-144. (2009). 21. Lee, J., Wang, Y. A Probabilistic Extension of the Stable Model Semantics. In AAAI Spring Symposium on Logical Formalizations of Commonsense Reasoning, 96-102. (2015). 22. http://sourceforge.net/projects/potassco/files/guide/2.0/guide-2.0.pdf. 23. Eiter, T. and Gottlob, G. On the computational cost of disjunctive logic programming: Propositional case. Annals of Mathematics and Artificial Intelligence 15, 3/4 , 289-323.(1995)

Logic Programming with Graded Introspection

School of Computer Science and Engineering,. Southeast University ... (3) Tom has 1 or 2 full years experiences in Java programming. (4) Tom has 3 or 4 full ...

261KB Sizes 10 Downloads 241 Views

Recommend Documents

Logic Programming
shop on Logic and Databases was ..... database system, databases store positive data only ...... directly by telephone, fax, email or simply mail your request to:.

PDF Download Starting Out with Programming Logic ...
... Industry Security Hardware Apple and WindowsEukaryotic Transcription Factors book download David S Latchman Download ... understanding the founding.