acorda for prospective logic programming luís moniz pereira gonçalo lopes centria – unl,...

27
ACORDA for ACORDA for Prospective Prospective Logic Programming Logic Programming Luís Moniz Pereira Luís Moniz Pereira Gonçalo Lopes Gonçalo Lopes CENTRIA – UNL, Portugal CENTRIA – UNL, Portugal h.c. workshop h.c. workshop T.U. Dresden, 5 T.U. Dresden, 5 Dec 2006 Dec 2006

Post on 21-Dec-2015

217 views

Category:

Documents


3 download

TRANSCRIPT

ACORDA for ProspectiveACORDA for ProspectiveLogic ProgrammingLogic Programming

Luís Moniz PereiraLuís Moniz Pereira

Gonçalo LopesGonçalo Lopes

CENTRIA – UNL, PortugalCENTRIA – UNL, Portugal

h.c. workshoph.c. workshop T.U. Dresden, 5 Dec 2006T.U. Dresden, 5 Dec 2006

The Evolution of Logic The Evolution of Logic Programming Programming (LP)(LP) - 1 - 1

Computational logic has evolved to Computational logic has evolved to meet the challenges of non-monotonic meet the challenges of non-monotonic reasoning in order to represent reasoning in order to represent knowledge which is all of:knowledge which is all of:

• IncompleteIncomplete

• ContradictoryContradictory

• RevisableRevisable

• Dynamic vs. StaticDynamic vs. Static

The Evolution of Logic The Evolution of Logic Programming - 2Programming - 2

Programs reason with incomplete Programs reason with incomplete knowledgeknowledge

Programs revise their knowledge in Programs revise their knowledge in face of contradictionface of contradiction

Programs self-update and evolve to Programs self-update and evolve to become differentbecome different

Programs can have several distinct Programs can have several distinct futuresfutures

Challenges for reasoning in LPChallenges for reasoning in LP

New challenges are emerging from New challenges are emerging from these LP capabilities:these LP capabilities:

• What is the best evolution for such a What is the best evolution for such a program?program?

• How can a program simulate and reason How can a program simulate and reason about future states?about future states?

• How can a program decide and prefer How can a program decide and prefer one future state over another?one future state over another?

What practical problems can What practical problems can such systems solve?such systems solve?

Differential Diagnosis (DD) - 1Differential Diagnosis (DD) - 1

In medicine, DD is the systematic In medicine, DD is the systematic method used to identify diseases:method used to identify diseases:• The physician observes the patient’s The physician observes the patient’s

symptoms, medical history and symptoms, medical history and available examinationsavailable examinations

• The most likely causes are then listedThe most likely causes are then listed

• The physician performs additional The physician performs additional examinations and tests in order to examinations and tests in order to defeat the relevant possibilities and defeat the relevant possibilities and obtain the single most likely diagnosisobtain the single most likely diagnosis

Differential Diagnosis - 2Differential Diagnosis - 2 The knowledge of the physician evolves as The knowledge of the physician evolves as

more information is gathered about the more information is gathered about the patientpatient

The physician is able to abduce (hypothesize) The physician is able to abduce (hypothesize) the most likely causes from his medical the most likely causes from his medical knowledgeknowledge

Analysis of hypotheses and diagnostic Analysis of hypotheses and diagnostic preferences lead to further examinations and, preferences lead to further examinations and, hopefully, to the most logical choice for a hopefully, to the most logical choice for a diagnosisdiagnosis

Is it possible to automate such Is it possible to automate such reasoning processes through LP?reasoning processes through LP?

Differential Diagnosis: An ExampleDifferential Diagnosis: An Example A patient shows up at the dentist with signs of pain upon A patient shows up at the dentist with signs of pain upon

teeth percussion. Expected causes are:teeth percussion. Expected causes are:

• Periapical lesion (endodontic or periodontal source)Periapical lesion (endodontic or periodontal source)

• Horizontal fracture of the root and/or crownHorizontal fracture of the root and/or crown

• Vertical fracture of the root and/or crownVertical fracture of the root and/or crown

Several additional examinations can be conducted to Several additional examinations can be conducted to determine the exact cause, namely:determine the exact cause, namely:

• X-Ray for determination of radiolucency or fracture X-Ray for determination of radiolucency or fracture tracestraces

• X-Ray for determination of periapical lesion sourceX-Ray for determination of periapical lesion source

• Check for tooth mobilityCheck for tooth mobility

• Measurement of gingival pocketsMeasurement of gingival pockets

How to put it all together?How to put it all together?

Cutting-edge LP techniques have lead Cutting-edge LP techniques have lead to working implementations for each to working implementations for each separate topicseparate topic

How to integrate all these different How to integrate all these different technologies into a unified and technologies into a unified and powerful reasoning system?powerful reasoning system?

• New abstractions are neededNew abstractions are needed• Empirical testing is vital to understand Empirical testing is vital to understand

the new propertiesthe new properties

The ACORDA systemThe ACORDA system ACORDA is a ACORDA is a prospectiveprospective LP system: LP system:

• Capable of self-updatingCapable of self-updating

• For the ongoing observations, it can abduce their For the ongoing observations, it can abduce their

most likely explanations, each a possible scenariomost likely explanations, each a possible scenario

• Capable of preferring among explanationsCapable of preferring among explanations

• Can simulate the consequences of committing to Can simulate the consequences of committing to

each most relevant explanatory scenarioeach most relevant explanatory scenario

• Performs experiments in order to choose and Performs experiments in order to choose and

commit, if possible, to a single explanationcommit, if possible, to a single explanation

ACORDA concepts: observables - 1ACORDA concepts: observables - 1

Observations are modelled in ACORDA by the Observations are modelled in ACORDA by the

relation relation observable/4observable/4 : :

observable(Observer, Observed, Observation, TruthValue)observable(Observer, Observed, Observation, TruthValue)

These represent internally triggered observations These represent internally triggered observations

the system wants to explain or satisfythe system wants to explain or satisfy

They can also stand for observations of the system They can also stand for observations of the system

on the outside environment, or from an oracleon the outside environment, or from an oracle

ACORDA concepts: observables - 2ACORDA concepts: observables - 2 These are all valid examples of observations:These are all valid examples of observations:

observable(prog, prog, tooth_ache, true)observable(prog, prog, tooth_ache, true)

observable(prog, battery, low_battery, false)observable(prog, battery, low_battery, false)

observable(player, prog, checkmate, unknown)observable(player, prog, checkmate, unknown)

Internal observations can be automatically Internal observations can be automatically triggered via the triggered via the on_observable/4on_observable/4 relation relation

At each reasoning step, ACORDA attempts to At each reasoning step, ACORDA attempts to satisfy the set of observations triggered by active satisfy the set of observations triggered by active on_observable/4on_observable/4 literals literals

ACORDA concepts: abducibles - 1ACORDA concepts: abducibles - 1

Abductive extensions to a theory, i.e. the Abductive extensions to a theory, i.e. the possible explanations to given observations, possible explanations to given observations, are modelled by abducible literalsare modelled by abducible literals

They are represented via They are represented via expect/1expect/1 clauses: clauses:

expect(rain) expect(rain) ←← cloudy cloudy

expect(beach) expect(beach) ←← sunny, sunny, notnot work work

expect(travel) expect(travel) ←← holidays, expect(money) holidays, expect(money)

rainrain,, beach beach,, travel travel andand money money are the are the abducible literalsabducible literals

ACORDA concepts: abducibles - 2ACORDA concepts: abducibles - 2

Expectations can be countered by Expectations can be countered by expect_not/1expect_not/1 clauses: clauses:

expect_not(sleep) expect_not(sleep) ←← deadline(tomorrow) deadline(tomorrow)expect_not(coffee) expect_not(coffee) ←← blood_pressure_high blood_pressure_high

An abducible is confirmed only if it is An abducible is confirmed only if it is expected, but not ‘expected, but not ‘expect_notexpect_not’:’:

confirm(A) confirm(A) ←← expect(A), expect(A), notnot expect_not(A) expect_not(A)

Abducibles are taken to be mutually Abducibles are taken to be mutually exclusive, so each possible choice contains exclusive, so each possible choice contains a single explanationa single explanation

ACORDA concepts: preferencesACORDA concepts: preferences Sets of abducibles may be coded as a Sets of abducibles may be coded as a

single abducible representing the setsingle abducible representing the set

One may embed a theory of a priori One may embed a theory of a priori preferences among the abducibles in preferences among the abducibles in ACORDAACORDA

The preferences are modelled via the The preferences are modelled via the operator operator <|<|, as shown below:, as shown below:

coffee <| tea coffee <| tea ←← sleepy sleepy

rain <| snow rain <| snow ←← notnot temp_less_than(0) temp_less_than(0)

ACORDA concepts: integrity ACORDA concepts: integrity constraints (ICs)constraints (ICs)

The reasoning mechanisms of ACORDA are The reasoning mechanisms of ACORDA are also guided by integrity constraints, that also guided by integrity constraints, that may not be violated in any future statemay not be violated in any future state

These constraints are a strong form of These constraints are a strong form of delimiting the space of possible delimiting the space of possible hypotheses that ACORDA can explorehypotheses that ACORDA can explore

The following are examples of ICs:The following are examples of ICs:

false false ←← relaxed, work relaxed, work

false false ←← expect(move_forward), battery(0) expect(move_forward), battery(0)

ACORDA concepts: simulation - 1ACORDA concepts: simulation - 1 Simulation towards satisfaction of a given Simulation towards satisfaction of a given

observation first proceeds by launching a top-observation first proceeds by launching a top-down derivation proof procedure, e.g. XSB-Prologdown derivation proof procedure, e.g. XSB-Prolog

Each abducible supporting the derivation tree for Each abducible supporting the derivation tree for the observation represents one possible choice the observation represents one possible choice scenario for the systemscenario for the system

Disconfirmation and preference rules may defeat Disconfirmation and preference rules may defeat several of these abduciblesseveral of these abducibles

If only a single abducible remains, it is the choice If only a single abducible remains, it is the choice to which the system will committo which the system will commit

However, often simulations will result in more However, often simulations will result in more than a single possible explanationthan a single possible explanation

ACORDA concepts: simulation - 2ACORDA concepts: simulation - 2 A simple example of a multiple scenario simulation:A simple example of a multiple scenario simulation:

drink drink ←← tea. tea.

drink drink ←← coffee. coffee.

tea tea ←← confirm(tea). confirm(tea).

coffee coffee ←← confirm(coffee). confirm(coffee).

expect(tea).expect(tea).

expect(coffee).expect(coffee).

expect_not(coffee) expect_not(coffee) ←← blood_pressure_high. blood_pressure_high.

coffee <| tea coffee <| tea ←← sleepy. sleepy.

confirm(A) confirm(A) ←← expect(A), expect(A), notnot expect_not(A). expect_not(A).

ACORDA concepts: oracles - 1ACORDA concepts: oracles - 1 When more than one explanation remains after a When more than one explanation remains after a

simulation, ACORDA activates other mechanisms simulation, ACORDA activates other mechanisms to enact a choiceto enact a choice

The simulation is relaunched, this time allowing The simulation is relaunched, this time allowing the posing of external questions to Oraclesthe posing of external questions to Oracles

The Oracles stand for systems which ACORDA can The Oracles stand for systems which ACORDA can query to support the confirmation or query to support the confirmation or disconfirmation of some of the hypothesesdisconfirmation of some of the hypotheses

Newly acquired information can eventually be Newly acquired information can eventually be used to defeat some or all of the hypotheses – or used to defeat some or all of the hypotheses – or activate new ones – and possibly enact a choiceactivate new ones – and possibly enact a choice

ACORDA concepts: oracles - 2ACORDA concepts: oracles - 2 Oracles can represent any kind of external Oracles can represent any kind of external

system: questions to the user, or to a set system: questions to the user, or to a set of sensors, remote databases, other of sensors, remote databases, other reasoning systems, etc.reasoning systems, etc.

Oracles can be integrated into ACORDA via Oracles can be integrated into ACORDA via observable/4observable/4 clauses, just like regular clauses, just like regular observations, but with special observations, but with special preconditions that are activated only when preconditions that are activated only when the system is unable to choose by itselfthe system is unable to choose by itself

Oracles open up new unexplored paths in Oracles open up new unexplored paths in the simulation’s derivation treethe simulation’s derivation tree

Diagnosis computational modelDiagnosis computational model

Differential Diagnosis in ACORDA - 1Differential Diagnosis in ACORDA - 1 Declarative modelling of the dentistry use case:Declarative modelling of the dentistry use case:

on_observable(prog, prog, percussion_pain_cause) on_observable(prog, prog, percussion_pain_cause) ←← percussion_pain. percussion_pain.

percussion_pain_cause percussion_pain_cause ←← periapical_lesion. periapical_lesion.

percussion_pain_cause percussion_pain_cause ←← horizontal_fracture. horizontal_fracture.

percussion_pain_cause percussion_pain_cause ←← vertical_fracture. vertical_fracture.

The knowledge theory describes several possible The knowledge theory describes several possible reasons for the symptom of percussion painreasons for the symptom of percussion pain

The internal program-to-program generated The internal program-to-program generated observation, to explain the cause of percussion observation, to explain the cause of percussion pain, will be triggered by updating the symptom pain, will be triggered by updating the symptom into the systeminto the system

Differential Diagnosis in ACORDA - 2Differential Diagnosis in ACORDA - 2

Each diagnostic hypothesis can be expressed as an Each diagnostic hypothesis can be expressed as an abducible in the system:abducible in the system:

expect(periapical_lesion) expect(periapical_lesion) ←← profound_caries. profound_caries.

expect(periapical_lesion) expect(periapical_lesion) ←← on_observable(percussion_pain_cause).on_observable(percussion_pain_cause).

Expectations can be based on further rules, and may Expectations can be based on further rules, and may also depend on the very observations which are also depend on the very observations which are active (e.g. periapical lesion is expected because it active (e.g. periapical lesion is expected because it is a likely reason for causing percussion pain)is a likely reason for causing percussion pain)

Differential Diagnosis in ACORDA - 3Differential Diagnosis in ACORDA - 3

Each abducible has also some rules accounting Each abducible has also some rules accounting for its disconfirmation:for its disconfirmation:

expect_not(periapical_lesion) expect_not(periapical_lesion) ←←

fracture_traces, fracture_traces, notnot radiolucency. radiolucency.

expect_not(horizontal_fracture) expect_not(horizontal_fracture) ←←

radiolucency, radiolucency, notnot fracture_traces. fracture_traces.

expect_not(vertical_fracture) expect_not(vertical_fracture) ←←

radiolucency, radiolucency, notnot fracture_traces. fracture_traces.

The initial symptoms do not include any of these The initial symptoms do not include any of these literals, so all relevant explanations remain open.literals, so all relevant explanations remain open.

Differential Diagnosis in ACORDA - 4Differential Diagnosis in ACORDA - 4

There are also preference rules involving some of There are also preference rules involving some of the hypotheses:the hypotheses:

horizontal_fracture <| vertical_fracture horizontal_fracture <| vertical_fracture ←← low_mobility.low_mobility.

vertical_fracture <| horizontal_fracture vertical_fracture <| horizontal_fracture ←← high_mobility.high_mobility.

Once again, the initial symptoms do not contain Once again, the initial symptoms do not contain the necessary conditions for activating these the necessary conditions for activating these preferences.preferences.

Differential Diagnosis in ACORDA - 5Differential Diagnosis in ACORDA - 5 The available examinations are also included in the The available examinations are also included in the

knowledge theory of the system:knowledge theory of the system:

radiolucency radiolucency ←← observable(prog, xray, radiolucency).observable(prog, xray, radiolucency).

fracture_traces fracture_traces ←← observable(prog, xray, fracture_traces). observable(prog, xray, fracture_traces).

high_mobility high_mobility ←← observable(prog, mobility_check, observable(prog, mobility_check,

high_mobility).high_mobility).

low_mobility low_mobility ←←

observable(prog, mobility_check, low_mobility).observable(prog, mobility_check, low_mobility).

Each examination is a query to an adequate oracle.Each examination is a query to an adequate oracle.

Interactive Results with ACORDAInteractive Results with ACORDA

Having modelled the situation, the prospective Having modelled the situation, the prospective

reasoning can be triggered by updating the literal reasoning can be triggered by updating the literal

percussion_painpercussion_pain into the system. into the system.

ReferenceReference

Gonçalo Lopes, L. M. PereiraGonçalo Lopes, L. M. Pereira

Prospective Programming with ACORDAProspective Programming with ACORDA

in in Empirically Successful Computerized ReasoningEmpirically Successful Computerized Reasoning (ESCoR'06) (ESCoR'06)

workshop at workshop at The 3rd Intl. J. Conf.on Automated ReasoningThe 3rd Intl. J. Conf.on Automated Reasoning

(IJCAR'06), Seattle, USA, August 21, 2006. (IJCAR'06), Seattle, USA, August 21, 2006.

[[interactive robot demointeractive robot demo]]