
Logic Programming Foundations and Applications Tran Cao Son1, Enrico Pontelli1, Marcello Balduccini2 1 Department of Computer Science New Mexico State University Las Cruces, New Mexico 2 Department of Computer Science Drexel University Philadelphia, PA Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 1 / 241 Roadmap Background Answer Set Programming Constraint Logic Programming Constraint Answer Set Programming Reasoning about Action and Change Action Description Languages ASP and CLP Planning Answer Set Planning and CLP Planning Applications Scheduling Goal Recognition Design Generalized Target Assignment and Path Finding Distributed Constraint Optimization Problems Conclusions Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 2 / 241 Answer Set Programming Outline 1 Answer Set Programming 2 Constraint Logic Programming 3 Constraint Answer Set Programming 4 Action Description Languages 5 Answer Set Planning and CLP Planning 6 Scheduling 7 Goal Recognition Design 8 Generalized Target Assignment and Path Finding 9 Distributed Constraint Optimization Problems 10 Conclusions Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 3 / 241 Answer Set Programming Introduction Answer set programming is a new programming paradigm. It was introduced in the late 90's and manages to attract the intention of different groups of researchers thanks to its: declarativeness: programs do not specify how answers are computed; modularity: programs can be developed incrementally; expressiveness: answer set programming can be used to solve 2 2 problems in high complexity classes (e.g. ΣP ,ΠP , etc.) Answer set programming has been applied in several areas: reasoning about actions and changes, planning, configuration, wire routing, phylogenetic inference, semantic web, information integration, etc. Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 4 / 241 Reading 1 If a1;:::; an are true and none of an+1;:::; an+k can be proven to be true then at least one of b1;:::; bm must be true. Reading 2 If a1;:::; an are believed to be true and there is no reason to believe that any of an+1;:::; an+k is true then at least one of b1;:::; bm must be true. Answer Set Programming Syntax Rules and Constraints r : b1 _ ::: _ bm a1;:::; an; not an+1;:::; not an+k ai , bj : atom of a language L (L can either be propositional or first order) not a: a negation-as-failure atom (naf-atom). Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 5 / 241 Reading 2 If a1;:::; an are believed to be true and there is no reason to believe that any of an+1;:::; an+k is true then at least one of b1;:::; bm must be true. Answer Set Programming Syntax Rules and Constraints r : b1 _ ::: _ bm a1;:::; an; not an+1;:::; not an+k ai , bj : atom of a language L (L can either be propositional or first order) not a: a negation-as-failure atom (naf-atom). Reading 1 If a1;:::; an are true and none of an+1;:::; an+k can be proven to be true then at least one of b1;:::; bm must be true. Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 5 / 241 Answer Set Programming Syntax Rules and Constraints r : b1 _ ::: _ bm a1;:::; an; not an+1;:::; not an+k ai , bj : atom of a language L (L can either be propositional or first order) not a: a negation-as-failure atom (naf-atom). Reading 1 If a1;:::; an are true and none of an+1;:::; an+k can be proven to be true then at least one of b1;:::; bm must be true. Reading 2 If a1;:::; an are believed to be true and there is no reason to believe that any of an+1;:::; an+k is true then at least one of b1;:::; bm must be true. Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 5 / 241 Answer Set Programming Syntax Notations r : b1 _ ::: _ bm a1;:::; an; not an+1;:::; not an+k | {z } | {z } head(r) body(r) head(r) = fb1;:::; bmg + pos(r) = fa1;:::; ang (also: body (r) = fa1;:::; ang) − neg(r) = fan+1;:::; an+k g (also: body (r) = fan+1;:::; an+k g) Special cases n = k = 0: r encodes a fact; k = 0: r is a positive rule; and m = 0: r encodes a constraint. Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 6 / 241 Answer Set Programming Syntax Program Program: a set of rules. Herbrand universe: the set of ground terms constructed constructed from function symbols and constants occurring in the program. (Uπ) Herbrand base: the set of ground atoms constructed from predicate symbols and ground terms from the Herbrand universe. (Bπ) Rule with variables: shorthand for the collection of its ground instances. (ground(r)) Program with variables: collection of ground instances of its rules. (ground(π)) Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 7 / 241 Answer Set Programming Examples of Propositonal Programs L is a propositional language L: set of propositions such as p, q, r, a, b ... 8 a 8 a not b a > > P = <> b a; c <> b not a; c 3 b c P = P = 1 c a; p 2 p a; not p > > : c : c Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 8 / 241 Answer Set Programming Examples of Propositonal Programs L is a first order language L has one function symbol f (arity: 1) and one predicate symbol p (arity 1) Q1 = p(f (X )) p(X ) Q2 = p(f (f (X )) p(f (X )); not p(X ) p(f (X )) Q = 3 p(f (f (f (X )))) p(X ) Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 9 / 241 Answer Set Programming Examples of Propositonal Programs Semantics: Positive Propositional Programs For a program without not and every rule m = 1. So, every rule in P is of the form: a a1;:::; an Definition For a positive program P, TP (X ) = fa j 9(a a1;:::; an) 2 P:[8i:(ai 2 X )]g Observations every fact in P belongs to TP (X ) for every X If X ⊆ Y then TP (X ) ⊆ TP (Y ) n n ; ⊆ TP (;) ⊆ TP (TP (;)) ⊆ ::: ⊆ TP (;) ⊆ and T (;) for n ! 1 converges to lfp(TP ) Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 10 / 241 Answer Set Programming Examples of Propositonal Programs Computing TP : Example 1 L: set of propositions such as p, q, r, a, b ... 8 a > <> b a; c P = 1 c a; p > : c TP1 (;) = fa; cg T 2 (;) = T (T (;)) = T ((fa; cg) = fa; c; bg P1 P1 P1 P1 T 3 (;) = T (T 2 (;)) = T (fa; c; bg) = fa; c; bg = lfp(T ) P1 P1 P1 P1 P1 Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 11 / 241 Answer Set Programming Examples of Propositonal Programs Computing TP : Example 2 L: set of propositions such as p, q, r, a, b ... 8 a b > <> b a; c P = 2 p a; p > : c TP2 (;) = fcg T 2 (;) = T (T (;)) = T (fcg) = fcg = lfp(T ) P2 P2 P2 P2 P2 Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 12 / 241 Answer Set Programming Examples of Propositonal Programs Computing TP : Example 3 a P = 3 b c TP3 (;) = fag T 2 (;) = T (T (;)) = T (fag) = fag = lfp(T ) P3 P3 P3 P3 P3 Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 13 / 241 Answer Set Programming Examples of Propositonal Programs Computing TP : Example 4 and 5 a b P = 4 b a TP4 (;) = ; = lfp(TP4 ) a P = 5 b a; b TP5 (;) = fag T 2 (;) = T (T (;)) = T (fag) = fag = lfp(T ) P5 P5 P5 P5 P5 Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 14 / 241 Answer Set Programming Programs with FOL Atoms Terminologies { many borrowed from classical logic variables: X ; Y ; Z; etc. object constants (or simply constants): a; b; c, etc. function symbols: f ; g; h, etc. predicate symbols: p; q, etc. terms: variables, constants, and f (t1;:::; tn) such that ti 's are terms. atoms: p(t1;:::; tn) such that ti s are terms. literals: atoms or an atom preceded by :. naf-literals: atoms or an atom preceded by not. gen-literals: literals or a literal preceded by not. ground terms (atoms, literals) : terms (atoms, literals resp.) without variables. Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 15 / 241 Answer Set Programming Programs with FOL Atoms FOL, Herbrand Universe, and Herbrand Base L { a first order language with its usual components (e.g., variables, constants, function symbols, predicate symbols, arity of functions and predicates, etc.) UL { Herbrand Universe of a language L: the set of all ground terms which can be formed with the functions and constants in L. BL { Herbrand Base of a language L: the set of all ground atoms which can be formed with the functions, constants and predicates in L. Example: Consider a language L1 with variables X ; Y ; constants a; b; function symbol f of arity 1; and predicate symbol p of arity 1. UL1 = fa; b; f (a); f (b); f (f (a)); f (f (b)); f (f (f (a))); f (f (f (b)));:::g. BL1 = fp(a); p(b); p(f (a)); p(f (b)); p(f (f (a))); p(f (f (b))); p(f (f (f (a)))); p(f (f (f (b))));:::g. Son, Pontelli, Balduccini (NMSU & Drexel) LP: Foundations & Applications ICAPS 2017 16 / 241 Answer Set Programming Programs with FOL Atoms Programs with FOL Atoms r : b1 _ ::: _ bm a1;:::; an; not an+1;:::; not an+k The language L of a program Π is often given implicitly.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages304 Page
-
File Size-