1 / 17

ASP vs. Prolog like programming

ASP vs. Prolog like programming. ASP is adequate for: NP-complete problems situation where the whole program is relevant for the problem at hands If the problem is polynomial, why using such a complex system?

thuy
Download Presentation

ASP vs. Prolog like programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ASP vs. Prolog like programming • ASP is adequate for: • NP-complete problems • situation where the whole program is relevant for the problem at hands • If the problem is polynomial, why using such a complex system? • If only part of the program is relevant for the desired query, why computing the whole model?

  2. ASP vs. Prolog • For such problems top-down, goal-driven mechanisms seem more adequate • This type of mechanisms is used by Prolog • Solutions come in variable substitutions rather than in complete models • The system is activated by queries • No global analysis is made: only the relevant part of the program is visited

  3. Problems with Prolog • Prolog declarative semantics is the completion • All the problems of completion are inherited by Prolog • According to SLDNF, termination is not guaranteed, even for Datalog programs (i.e. programs with finite ground version) • A proper semantics is still needed

  4. Well Founded Semantics • Defined in [GRS90], generalizes SMs to 3-valued models. • Note that: • there are programs with no fixpoints of G • but all have fixpoints of G2 P = {a ¬ not a} • G({a}) = {} andG({}) = {a} • There are no stable models • But: G2({}) = {} and G2({a}) = {a}

  5. Partial Stable Models • A 3-valued intr. (T U not F) is a PSM of P iff: • T = GP2(T) • T ÍG(T) • F = HP - G(T) The 2nd condition guarantees that no atom is both true and false: T Ç F = {} P = {a ¬ not a}, has a single PSM: {} This program has 3 PSMs: {}, {a, not b} and {c, b, not a} The 3rd corresponds to the single SM a ¬ not b c ¬ not a b ¬ not a c ¬ not c

  6. WFS definition • [WF Model] Every P has a knowledge ordering (i.e. wrt Í) least PSM, obtainable by the transfinite sequence: • T0 = {} • Ti+1 = G2(Ti) • Td = Ua<d Ta, for limit ordinals d Let T be the least fixpoint obtained. MP = T U not (HP - G(T)) is the well founded model of P.

  7. Well Founded Semantics • Let M be the well founded model of P: • A is true in P iff AÎ M • A is false in P iff not AÎ M • Otherwise (i.e. AÏ M and not AÏ M) A is undefined in P

  8. WFS Properties • Every program is assigned a meaning • Every SM extends one PSM • If WFM is total it coincides with the single SM • It is sound wrt to the SMs semantics • If P has stable models and A is true (resp. false) in the WFM, it is also true (resp. false) in the intersection of SMs • WFM coincides with the perfect model in locally stratified programs (and with the least model in definite programs)

  9. More WFS Properties • The WFM is supported • WFS is cumulative and relevant • Its computation is polynomial (on the number of instantiated rule of P) • There are top-down proof-procedures, and sound implementations • these are mentioned in the sequel

  10. LP and Default Theories • Let DP be the default theory obtained by transforming: H ¬ B1,…,Bn, not C1,…, not Cm into: B1,…,Bn : ¬C1,…, ¬Cm H • There is a one-to-one correspondence between the SMs of P and the default extensions of DP • If LÎ WFM(P) then L belongs to every extension of DP

  11. LPs as defaults • LPs can be viewed as sets of default rules • Default literals are the justification: • can be assumed if it is consistent to do so • are withdrawn if inconsistent • In this reading of LPs, ¬ is not viewed as implication. Instead, LP rules are viewed as inference rules.

  12. LP and Auto-Epistemic Logic • Let TP be the AEL theory obtained by transforming: H ¬ B1,…,Bn, not C1,…, not Cm into: B1 Ù … Ù BnÙ ¬ L C1Ù … Ù ¬ L Cm Þ H • There is a one-to-one correspondence between the SMs of P and the (Moore) expansions of TP • If LÎ WFM(P) then L belongs to every expansion of TP

  13. LPs as AEL theories • LPs can be viewed as theories that refer to their own knowledge • Default negation not A is interpreted as “A is not known” • The LP rule symbol is here viewed as material implication

  14. LP and AEB • Let TP be the AEB theory obtained by transforming: H ¬ B1,…,Bn, not C1,…, not Cm into: B1 Ù … Ù BnÙB ¬C1Ù … ÙB ¬CmÞ H • There is a one-to-one correspondence between the PSMs of P and the AEB expansions of TP • AÎ WFM(P) iff A is in every expansion of TP not AÎ WFM(P) iff B¬A is in all expansions of TP

  15. LPs as AEB theories • LPs can be viewed as theories that refer to their own beliefs • Default negation not A is interpreted as “It is believed that A is false” • The LP rule symbol is also viewed as material implication

  16. SM problems revisited • The mentioned problems of SM are not necessarily problems: • Relevance is not desired when analyzing global problems • If the SMs are equated with the solutions of a problem, then some problems simple have no solution • Some problems are NP-complete. So using an NP-complete language is not a problem. • In case of NP-complete problems, the efficient gains from cumulativity are not really an issue.

  17. SM versus WFM • Yield different forms of programming and of representing knowledge, for usage with different purposes • Usage of WFM: • Closer to that of Prolog • Local reasoning (and relevance) are important • When efficiency is an issue even at the cost of expressivity • Usage of SMs • For representing NP-complete problems • Global reasoning • Different form of programming, not close to that of Prolog • Solutions are models, rather than answer/substitutions

More Related