cProbLog: Restricting the Possible Worlds of Probabilistic Logic - - PowerPoint PPT Presentation

cproblog restricting the possible worlds of probabilistic
SMART_READER_LITE
LIVE PREVIEW

cProbLog: Restricting the Possible Worlds of Probabilistic Logic - - PowerPoint PPT Presentation

cProbLog: Restricting the Possible Worlds of Probabilistic Logic Programs Dimitar Shterionov Prof. Gerda Janssens 1 Weight: 3 Weight: 4 Weight: 8 Weight: 6 2 Weight: 3 Weight: 4 0.33 Weight: 8 Weight: 6 0.25 0.125 0.16 3 Weight:


slide-1
SLIDE 1

1

cProbLog: Restricting the Possible Worlds of Probabilistic Logic Programs

Dimitar Shterionov

  • Prof. Gerda Janssens
slide-2
SLIDE 2

2

Weight: 6 Weight: 4 Weight: 8 Weight: 3

slide-3
SLIDE 3

3

Weight: 6 Weight: 4 Weight: 8 Weight: 3 0.16 0.25 0.33 0.125

slide-4
SLIDE 4

4

Luggage weight 10 kg. Weight: 6 Weight: 4 Weight: 8 Weight: 3 0.16 0.25 0.33 0.125

slide-5
SLIDE 5

5

Luggage weight 10 kg. Weight: 6 Weight: 4 Weight: 8 Weight: 3 0.16 0.25 0.33 0.125 Query: what is the probability of carrying items without exceeding the limit?

slide-6
SLIDE 6

6

Luggage weight 10 kg. Weight: 6 Weight: 4 Weight: 8 Weight: 3 0.16 0.25 0.33 0.125 Query: what is the probability of carrying items without exceeding the limit?

ProbLog

slide-7
SLIDE 7

7

Luggage weight 10 kg. Weight: 6 Weight: 4 Weight: 8 Weight: 3 0.16 0.25 0.33 0.125 Query: what is the probability of carrying items without exceeding the limit? Additional knowledge: if skis are packed then boots also need to be packed.

slide-8
SLIDE 8

8

Luggage weight 10 kg. Weight: 6 Weight: 4 Weight: 8 Weight: 3 0.16 0.25 0.33 0.125 Query: what is the probability of carrying items without exceeding the limit? Additional knowledge: if skis are packed then boots also need to be packed.

cProbLog

slide-9
SLIDE 9

9

Outline

  • ProbLog and Possible Worlds
  • cProbLog – FOL sentences expressing constraints
  • Implementation – constraint-evidence approach
  • Examples
  • Comparison to other systems
slide-10
SLIDE 10

10

Outline

  • ProbLog and Possible Worlds
  • cProbLog – FOL sentences expressing constraints
  • Implementation – constraint-evidence approach
  • Examples
  • Comparison to other systems
slide-11
SLIDE 11

11

Logic

Uncertainties

ML

ProbLog

  • Compute the marginal

probability given evidence

  • Learn from Interpretations
slide-12
SLIDE 12

12

weight(skis,6). weight(board, 8). weight(boots,4). weight(helmet,3). 0.160::pack(skis). 0.125::pack(board). 0.250::pack(boots). 0.330::pack(helmet). inlimit(Limit):- inlimit([skis,boots,board,helmet],Limit). inlimit([],Limit):- Limit>=0. inlimit([I|R],Limit):- pack(I), weight(I,W), L is Limit-W, inlimit(R,L). inlimit([I|R],Limit):- \+pack(I), inlimit(R,Limit).

slide-13
SLIDE 13

13

weight(skis,6). weight(board, 8). weight(boots,4). weight(helmet,3). 0.160::pack(skis). 0.125::pack(board). 0.250::pack(boots). 0.330::pack(helmet). inlimit(Limit):- inlimit([skis,boots,board,helmet],Limit). inlimit([],Limit):- Limit>=0. inlimit([I|R],Limit):- pack(I), weight(I,W), L is Limit-W, inlimit(R,L). inlimit([I|R],Limit):- \+pack(I), inlimit(R,Limit).

Probabilistic Facts

slide-14
SLIDE 14

14

weight(skis,6). weight(board, 8). weight(boots,4). weight(helmet,3). 0.160::pack(skis). 0.125::pack(board). 0.250::pack(boots). 0.330::pack(helmet). inlimit(Limit):- inlimit([skis,boots,board,helmet],Limit). inlimit([],Limit):- Limit>=0. inlimit([I|R],Limit):- pack(I), weight(I,W), L is Limit-W, inlimit(R,L). inlimit([I|R],Limit):- \+pack(I), inlimit(R,Limit).

Probabilistic Facts pack(ski) pack(board) pack(boots) pack(helmet) 0.16 0.84 0.125 0.875 0.25 0.75 0.33 0.67

slide-15
SLIDE 15

15

pack(ski) pack(board) pack(boots) pack(helmet) 0.84 0.875 0.25 0.33

A possible world

slide-16
SLIDE 16

16

pack(ski) pack(board) pack(boots) pack(helmet) 0.84 0.875 0.25 0.33

* * * = 0.061 A possible world

slide-17
SLIDE 17

17

pack(ski) pack(board) pack(boots) pack(helmet) 0.84 0.875 0.25 0.33

* * * = 0.061 A possible world

slide-18
SLIDE 18

18

A possible world corresponds to a model of the ProbLog program A query atom is true in some possible worlds. (the models of the ProbLog program and the query)

pack(ski) pack(board) pack(boots) pack(helmet) 0.84 0.875 0.25 0.33

* * * = 0.061 A possible world

slide-19
SLIDE 19

19

A possible world corresponds to a model of the ProbLog program A query atom is true in some possible worlds. (the models of the ProbLog program and the query)

(the success probability of q) pack(ski) pack(board) pack(boots) pack(helmet) 0.84 0.875 0.25 0.33

* * * = 0.061 A possible world

slide-20
SLIDE 20

20

query(inlimit(10)).

slide-21
SLIDE 21

21

P(inlimit(10)) = 0.9162 query(inlimit(10)).

slide-22
SLIDE 22

22

Outline

  • ProbLog and Possible Worlds
  • cProbLog – FOL sentences expressing constraints
  • Implementation – constraint-evidence approach
  • Examples
  • Comparison to other systems
slide-23
SLIDE 23

23

The MARG task

Evidence – a set of atoms (E) with observed truth values (e)

slide-24
SLIDE 24

24

The MARG task

boots are already packed

Evidence – a set of atoms (E) with observed truth values (e)

slide-25
SLIDE 25

25

The MARG task

boots are already packed

Evidence – a set of atoms (E) with observed truth values (e)

slide-26
SLIDE 26

26

P(inlimit(10)|pack(boots)=true)

slide-27
SLIDE 27

27

P(inlimit(10)|pack(boots)=true)

What about more complex additional knowledge? Eg.,“if the skis are packed then also the boots need to be packed” FOL:

slide-28
SLIDE 28

28

cProbLog: Generalization of Evidence to FOL Constraints

What about more complex additional knowledge? Eg.,“if the skis are packed then also the boots need to be packed” FOL:

slide-29
SLIDE 29

29

cProbLog Syntax

slide-30
SLIDE 30

30

cProbLog Syntax

pack(skis) implies pack(boots) for_all X in {1, 2, 3}: exists Y in {a, b}: match(X, Y)

for_all X of init_node(X): exists Y of end_node(Y): edge(X, Y) implies not edge(X, 1)

slide-31
SLIDE 31

31

cProbLog Syntax

pack(skis) implies pack(boots) for_all X in {1, 2, 3}: exists Y in {a, b}: match(X, Y)

for_all X of init_node(X): exists Y of end_node(Y): edge(X, Y) implies not edge(Y, 1)

determine the relevant grounding ensure finite grounding

  • f the constraints

domains

slide-32
SLIDE 32

32

cProbLog Semantics

Constraints are true in a set of possible worlds (subset of the possible worlds of the initial ProbLog program)

slide-33
SLIDE 33

33

cProbLog Semantics

Constraints are true in a set of possible worlds (subset of the possible worlds of the initial ProbLog program)

Probability of a Query

slide-34
SLIDE 34

34

cProbLog Semantics

Constraints are true in a set of possible worlds (subset of the possible worlds of the initial ProbLog program)

Probability of a Query

slide-35
SLIDE 35

35

query(inlimit(10)). constraint(pack(skis) implies pack(boots)).

slide-36
SLIDE 36

36

P(inlimit(10)|pack(skis) implies pack(boots)) = 0.9218.

query(inlimit(10)). constraint(pack(skis) implies pack(boots)).

slide-37
SLIDE 37

37

Outline

  • ProbLog and Possible Worlds
  • cProbLog – FOL sentences expressing constraints
  • Implementation – constraint-evidence approach
  • Examples
  • Comparison to other systems
slide-38
SLIDE 38

38

Additional rules + Evidence

slide-39
SLIDE 39

39

Constraints Additional rules + Evidence

slide-40
SLIDE 40

40

Constraints Additional rules + Evidence

slide-41
SLIDE 41

41

Constraints

Constraint – Evidence Approach

Additional rules + Evidence

slide-42
SLIDE 42

42

Constraint – Evidence Approach

A transformation of a single constraint into prolog rules and setting evidence.

1.Convert to Prenex Normal Form 2.Generate Prolog rules + Instantiate every variable ▪ Conjunction ▪ Disjunction 3.Add evidence 4.Do ProbLog MARG

slide-43
SLIDE 43

43

Constraint – Evidence Approach

A transformation of a single constraint into prolog rules and setting evidence.

Rewriting rules 1.Convert to Prenex Normal Form 2.Generate Prolog rules + Instantiate every variable ▪ Conjunction ▪ Disjunction 3.Add evidence 4.Do ProbLog MARG

slide-44
SLIDE 44

44

Constraint – Evidence Approach

A transformation of a single constraint into prolog rules and setting evidence.

for_all X in {1, 2, 3}: exists Y in {a, b} : match(X, Y) Rewriting rules 1.Convert to Prenex Normal Form 2.Generate Prolog rules + Instantiate every variable ▪ Conjunction ▪ Disjunction 3.Add evidence 4.Do ProbLog MARG

slide-45
SLIDE 45

45

Constraint – Evidence Approach

A transformation of a single constraint into prolog rules and setting evidence.

for_all X in {1, 2, 3}: exists Y in {a, b} : match(X, Y) Rewriting rules 1.Convert to Prenex Normal Form 2.Generate Prolog rules + Instantiate every variable ▪ Conjunction ▪ Disjunction 3.Add evidence 4.Do ProbLog MARG

constraint_aux(1):-match(1, a); match(1, b). constraint_aux(2):-match(2, a); match(2, b). constraint_aux(3):-match(3, a); match(3, b). constraint_aux(0):-constraint_aux(1), constraint_aux(2), constraint_aux(3).

slide-46
SLIDE 46

46

Constraint – Evidence Approach

A transformation of a single constraint into prolog rules and setting evidence.

for_all X in {1, 2, 3}: exists Y in {a, b} : match(X, Y) Rewriting rules 1.Convert to Prenex Normal Form 2.Generate Prolog rules + Instantiate every variable ▪ Conjunction ▪ Disjunction 3.Add evidence 4.Do ProbLog MARG evidence(constraint_aux(0), true).

constraint_aux(1):-match(1, a); match(1, b). constraint_aux(2):-match(2, a); match(2, b). constraint_aux(3):-match(3, a); match(3, b). constraint_aux(0):-constraint_aux(1), constraint_aux(2), constraint_aux(3).

slide-47
SLIDE 47

47

Constraints Additional rules + Evidence ProbLog MARG inference

Constraint – Evidence Approach

slide-48
SLIDE 48

48

Outline

  • ProbLog and Possible Worlds
  • cProbLog – FOL sentences expressing constraints
  • Implementation – constraint-evidence approach
  • Examples
  • Comparison to other systems
slide-49
SLIDE 49

49

Burglary – Earthquake – Alarm

burglary earthquake alarm John calls Merry calls

slide-50
SLIDE 50

50

Burglary – Earthquake – Alarm

burglary earthquake alarm John calls Merry calls

slide-51
SLIDE 51

51

Burglary – Earthquake – Alarm

person(john). person(mary). 0.1::burglary. 0.2::earthquake. 0.7::hears_alarm(X):- person(X). alarm:- burglary. alarm:- earthquake. calls(X):- alarm, hears_alarm(X). query(burglary). query(earthquake). constraint((for_all X of person(X): for_all Y of person(Y)): (calls(X) and calls(Y)) implies X == Y).

slide-52
SLIDE 52

52

Burglary – Earthquake – Alarm

person(john). person(mary). 0.1::burglary. 0.2::earthquake. 0.7::hears_alarm(X):- person(X). alarm:- burglary. alarm:- earthquake. calls(X):- alarm, hears_alarm(X). query(burglary). query(earthquake). constraint((for_all X of person(X): for_all Y of person(Y)): (calls(X) and calls(Y)) implies X == Y). constraint_aux(0):- ((\+ calls(mary); \+ calls(mary)); mary==mary), (\+ calls(mary); \+ calls(john)); mary==john)), ((\+ calls(john); \+ calls(mary)); john==mary), (\+ calls(john); \+ calls(john)); john==john)). evidence(constraint_aux(0), true).

slide-53
SLIDE 53

53

Burglary – Earthquake – Alarm

person(john). person(mary). 0.1::burglary. 0.2::earthquake. 0.7::hears_alarm(X):- person(X). alarm:- burglary. alarm:- earthquake. calls(X):- alarm, hears_alarm(X). query(burglary). query(earthquake). constraint((for_all X of person(X): for_all Y of person(Y)): (calls(X) and calls(Y)) implies X == Y). constraint_aux(0):- ((\+ calls(mary); \+ calls(mary)); mary==mary), (\+ calls(mary); \+ calls(john)); mary==john)), ((\+ calls(john); \+ calls(mary)); john==mary), (\+ calls(john); \+ calls(john)); john==john)). evidence(constraint_aux(0), true). ev1:- \+ calls(mary). ev1:- \+ calls(john). evidence(ev1, true).

slide-54
SLIDE 54

54

Burglary – Earthquake – Alarm

person(john). person(mary). 0.1::burglary. 0.2::earthquake. 0.7::hears_alarm(X):- person(X). alarm:- burglary. alarm:- earthquake. calls(X):- alarm, hears_alarm(X). query(burglary). query(earthquake). constraint((for_all X of person(X): for_all Y of person(Y)): (calls(X) and calls(Y)) implies X == Y). constraint_aux(0):- ((\+ calls(mary); \+ calls(mary)); mary==mary), (\+ calls(mary); \+ calls(john)); mary==john)), ((\+ calls(john); \+ calls(mary)); john==mary), (\+ calls(john); \+ calls(john)); john==john)). evidence(constraint_aux(0), true). ev1:- \+ calls(mary). ev1:- \+ calls(john). evidence(ev1, true).

slide-55
SLIDE 55

55

Student's Exams

0.8::pass_exam(Exam, studied_enough). 0.4::pass_exam(Exam, luck). 0.7::pass_exam(Exam, cheating). P::pass_exam(Exam, experience, Years):- P is Years/7.

slide-56
SLIDE 56

56

Student's Exams

0.8::pass_exam(Exam, studied_enough). 0.4::pass_exam(Exam, luck). 0.7::pass_exam(Exam, cheating). P::pass_exam(Exam, experience, Years):- P is Years/7. student(john, [prolog, cog_sci, anns, comp_vis, m_learn], 3). succeed(Student):- student(Student, Exams, Experience), pass_all(Exams, Experience). pass_all([], _). pass_all([F|Rest], Exp):- pass_one(F, Exp), pass_all(Rest, Exp). pass_one(Ex, _):-pass_exam(Ex, _). pass_one(Ex, Years):-pass_exam(Ex, experience, Years).

slide-57
SLIDE 57

57

Student's Exams

0.8::pass_exam(Exam, studied_enough). 0.4::pass_exam(Exam, luck). 0.7::pass_exam(Exam, cheating). P::pass_exam(Exam, experience, Years):- P is Years/7. student(john, [prolog, cog_sci, anns, comp_vis, m_learn], 3). succeed(Student):- student(Student, Exams, Experience), pass_all(Exams, Experience). pass_all([], _). pass_all([F|Rest], Exp):- pass_one(F, Exp), pass_all(Rest, Exp). pass_one(Ex, _):-pass_exam(Ex, _). pass_one(Ex, Years):-pass_exam(Ex, experience, Years). exam(E):- member(E, [prolog, cog_sci, anns, comp_vis, m_learn]). constraint(pass_exam(m_learn, luck) implies not pass_exam(anns, luck)). constraint((for_all X of exam(X), for_all Y in {0,1,2,3}) : not pass_exam(X, experience, Y)). query(succeed(john)).

slide-58
SLIDE 58

58

Outline

  • ProbLog and Possible Worlds
  • cProbLog – FOL sentences expressing constraints
  • Implementation – constraint-evidence approach
  • Examples
  • Comparison to other systems
slide-59
SLIDE 59

59

cProbLog and ...

  • CLP(BN)
  • PCLP
  • CHRiSM
slide-60
SLIDE 60

60

cProbLog and ...

  • CLP(BN)
  • PCLP
  • CHRiSM

Constraints define values of Random Variables: generative

cProbLog can be employed by other systems.

cProbLog constraints limit the set of possible worlds: restrictive

slide-61
SLIDE 61

61

Summary

  • ProbLog defines a distribution over possible worlds
  • Constraints, similar to evidence, restrict the set of

possible worlds

  • Constraint-Evidence approach:

– Transforming – Setting evidence – ProbLog MARG inference

slide-62
SLIDE 62

62

Take-away message

  • cProbLog: a system which combines ProbLog and

FOL constraints, to increase the expressivity of the language

  • cProbLog implementation is not dependent on the

host and can easily be employed by other PLP systems.

slide-63
SLIDE 63

63

Thank you for your attention!