Symbolic Unfolding of Multi-adjoint Logic Programs es Moreno 1 Jaime - - PowerPoint PPT Presentation

symbolic unfolding of multi adjoint logic programs
SMART_READER_LITE
LIVE PREVIEW

Symbolic Unfolding of Multi-adjoint Logic Programs es Moreno 1 Jaime - - PowerPoint PPT Presentation

Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research Symbolic Unfolding of Multi-adjoint Logic Programs es Moreno 1 Jaime Penabad 2 e Antonio Riaza 1 Gin Jos {


slide-1
SLIDE 1

1/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Symbolic Unfolding of Multi-adjoint Logic Programs

Gin´ es Moreno1 Jaime Penabad2 Jos´ e Antonio Riaza1

{Gines.Moreno, Jaime.Penabad, JoseAntonio.Riaza}@uclm.es

  • 1Dept. of Computing Systems, UCLM, 02071 Albacete (Spain)
  • 2Dept. of Mathematics, UCLM, 02071 Albacete (Spain)

9th European Symposium on Computational Intelligence and Mathematics

October 4th - 7th, 2017, Faro (Portugal)

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-2
SLIDE 2

2/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Index

1

Multi-Adjoint Lattices and Programs

2

Operational Semantics for sMALP

3

Unfolding of sMALP Programs

4

Conclusions and Further Research

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-3
SLIDE 3

3/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Index

1

Multi-Adjoint Lattices and Programs

2

Operational Semantics for sMALP

3

Unfolding of sMALP Programs

4

Conclusions and Further Research

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-4
SLIDE 4

4/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Fuzzy Logic Programming

Fuzzy Logic + Logic Programming ⇓ Fuzzy Logic Programming

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-5
SLIDE 5

5/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Multi-Adjoint Lattices

Multi-adjoint Lattice A tuple (L, ≤, ←1, &1, . . . , ←n, &n) is a multi-adjoint lattice if it verifies the following claims: i) (L, ≤) is a complete lattice, with ⊥ and ⊤ elements. ii) (&i, ←i) is an adjoint pair in (L, ≤), i.e.:

1) &i is increasing in both arguments. 2) ←i is increasing in the first argument and decreasing in the second one. 3) Adjoint property: x ≤ (y ←i z) ⇐ ⇒ (x &i z) ≤ y

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-6
SLIDE 6

6/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Examples of Multi-Adjoint Lattices

Boolean values {true, false} with the classical adjoint pair. Real numbers in the unit interval [0, 1] with adjoint pairs from the fuzzy logics of Product, G¨

  • del and

Lukasiewicz:

&prod(x, y) x · y ←prod (x, y)

  • 1

if y ≤ x x/y if 0 < x < y &godel(x, y) min(x, y) ←godel (x, y) 1 if y ≤ x x

  • therwise

&luka(x, y) max(0, x + y − 1) ←luka (x, y) min(x − y + 1, 1)

We can define other connectives like:

| disjunctions: |luka(x, y) min(1, x + y) @ aggregators: @aver(x, y) (x + y)/2

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-7
SLIDE 7

7/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Multi-Adjoint Logic Programming

We work with a Prolog-like first order language, with variables, function and predicate symbols, but more connectives: &1, &2, . . . , &n (conjunctions) |1, |2, . . . , |n (disjunctions) ←1, ←2, . . . , ←n (implications) @1, @2, . . . , @n (aggregations) Instead of naive {true, false}, we use a multi–adjoint lattice to model truth degrees (L, ≤, ←1, &1, . . . , ←n, &n). ([0, 1], ≤, ←luka, &luka, ←prod, &prod, ←godel, &godel)

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-8
SLIDE 8

8/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Symbolic Multi-Adjoint Logic Programming

MALP programs contain weighted rules H ←i B with v:

P =        R1 : p(X) ←prod q(X) &godel @aver(r(X), s(X)) with 0.9. R2 : q(a) ← with 0.8. R3 : r(X) ← with 0.7. R4 : s(X) ← with 0.5.

sMALP programs also allow symbolic constants:

Ps =        R1 : p(X) #←s1 q(X) #&s2 @aver(r(X), s(X)) with 0.9. R2 : q(a) ← with #s3. R3 : r(X) ← with 0.7. R4 : s(X) ← with 0.5.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-9
SLIDE 9

9/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Index

1

Multi-Adjoint Lattices and Programs

2

Operational Semantics for sMALP

3

Unfolding of sMALP Programs

4

Conclusions and Further Research

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-10
SLIDE 10

10/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Operational Semantics for sMALP

A state is a pair Q; σ, where Q is a goal and σ a substitution. Procedural semantics:

1

Operational phase based on admissible steps (→AS).

2

Interpretive phase based on interpretive steps (→IS).

Given a program P, a goal Q and a substitution σ, we define a state transition system whose transition relations are →AS and →IS.

Q; id Qi; σ Qj; σ symbolic fuzzy computed answer Q →∗

AS

→∗

IS

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-11
SLIDE 11

11/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Operational phase (I)

Admissible step using facts Q[A]; σ→ASQ[A/v]θ; σθ if

1 A is the selected atom in Q, 2 θ = mgu(H, A) = fail, 3 H ← with v ≪ P.

Example Let p(a) ← with 0.7 be a rule: (p(b) &godel p(X)) &godel q(X); id →AS (p(b) &godel 0.7) &godel q(a); {X/a}

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-12
SLIDE 12

12/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Operational phase (II)

Admissible step using non-empty rules Q[A]; σ→ASQ[A/v &i B]θ; σθ if

1 A is the selected atom in Q, 2 θ = mgu(H, A) = fail, 3 H ←i B with v ≪ P and B is not empty.

Example Let p(a) ←prod p(f (a)) with 0.7 be a rule: (p(b) &godel p(X)) &godel q(X); id →AS (p(b) &godel 0.7 &prod p(f (a))) &godel q(a); {X/a}

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-13
SLIDE 13

13/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Operational phase (III)

Admissible step not using program rules Q[A]; σ→ASQ[A/⊥]; σ if

1 A is the selected atom in Q, 2 there is no rule in P whose head unifies with A.

Example This case is introduced to cope with (possible) unsuccessful admissible derivations. So, with program p(a) ← with 0.7 we have: p(b); id →AS 0; id

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-14
SLIDE 14

14/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Interpretive phase

Interpretive step Q[ζ(r1, . . . , rn)]; σ→ISQ[ζ(r1, . . . , rn)/rn+1]; σ where ζ denotes a connective defined on the lattice L associated to P and ζ(r1, . . . , rn) rn+1. Example Since the truth function associated to &prod is the product

  • perator, then:

(0.8 &luka ((0.7 &prod 0.9) &godel 0.7)); {X/a}→IS (0.8 &luka (0.63 &godel 0.7)); {X/a}

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-15
SLIDE 15

15/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of derivation

P =        R1 : p(X) #←s1 q(X) #&s2 @aver(r(X), s(X)) with 0.9. R2 : q(a) ← with #s3. R3 : r(X) ← with 0.7. R4 : s(X) ← with 0.5. p(X); id →R1

AS

0.9 #&s1 (q(X1) #&s2 @aver(r(X1), s(X1))); {X/X1} →R2

AS

0.9 #&s1 (#s3 #&s2 @aver(r(a), s(a))); {X/a} →R3

AS

0.9 #&s1 (#s3 #&s2 @aver(0.7, s(a))); {X/a} →R4

AS

0.9 #&s1 (#s3 #&s2 @aver(0.7, 0.5)); {X/a} →IS 0.9 #&s1 (#s3 #&s2 0.6); {X/a}

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-16
SLIDE 16

16/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Index

1

Multi-Adjoint Lattices and Programs

2

Operational Semantics for sMALP

3

Unfolding of sMALP Programs

4

Conclusions and Further Research

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-17
SLIDE 17

17/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Symbolic Unfolding

It is usually based on the application of computational steps on the body of program rules. It is able to improve programs, generating more efficient code while preserving the semantics of the initial program. Symbolic Unfolding Let P be an sMALP program and let R : A ← B ∈ P be a program rule with no empty body. Then, the symbolic unfolding of rule R in program P is the new sMALP program P′ = (P − {R}) ∪ {Aσ ← B′ | B; id → B′; σ}.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-18
SLIDE 18

18/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (I)

P0 =                                              R1 : popularity(X) #←s1 facilities(X) #|s2 @aver(location(X), rates(X)) with 0.9. R2 : facilities(sun) ← with #s3. R3 : location(sun) ← with 0.4. R4 : rates(sun) ← with 0.7. R5 : facilities(sweet) ← with 0.5. R6 : location(sweet) ← with 0.3. R7 : rates(sweet) ← with 1.0. R8 : facilities(lux) ← with 0.9. R9 : location(lux) ← with 0.8. R10 : rates(lux) ← with 0.2.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-19
SLIDE 19

19/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (II)

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-20
SLIDE 20

20/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (III)

Unfolding rule R1 with selected atom facilities(X) applying an →AS step with the facts R2, R5 and R8.

1

popularity(X) #←s1 facilities(X) #|s2 @aver(location(X), rates(X)) with 0.9.

1-2

popularity(sun) #←s1 #s3 #|s2 @aver(location(sun), rates(sun)) with 0.9.

1-5 popularity(sweet) #←s1 0.5 #|s2 @aver(location(sweet), rates(sweet)) with 0.9. 1-8

popularity(lux) #←s1 0.9 #|s2 @aver(location(lux), rates(lux)) with 0.9.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-21
SLIDE 21

21/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (IV)

P1 =                                                              R1−2 : popularity(sun) #←s1 #s3 #|s2 @aver(location(sun), rates(sun)) with 0.9. R1−5 : popularity(sweet) #←s1 0.5 #|s2 @aver(location(sweet), rates(sweet)) with 0.9. R1−8 : popularity(lux) #←s1 0.9 #|s2 @aver(location(lux), rates(lux)) with 0.9. R2 : facilities(sun) ← with #s3. R3 : location(sun) ← with 0.4. R4 : rates(sun) ← with 0.7. R5 : facilities(sweet) ← with 0.5. R6 : location(sweet) ← with 0.3. R7 : rates(sweet) ← with 1.0. R8 : facilities(lux) ← with 0.9. R9 : location(lux) ← with 0.8. R10 : rates(lux) ← with 0.2.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-22
SLIDE 22

22/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (V)

After aplying 6 unfolds based on →AS steps, we have the following program.

P7 =                                                  R1−2−3−4 : popularity(sun) #←s1 #s3 #|s2 @aver(0.4, 0.7) with 0.9. R1−5−6−7 : popularity(sweet) #←s1 0.5 #|s2 @aver(0.3, 1.0) with 0.9. R1−8−9−10 : popularity(lux) #←s1 0.9 #|s2 @aver(0.8, 0.2) with 0.9. R2 : facilities(sun) ← with #s3. R3 : location(sun) ← with 0.4. R4 : rates(sun) ← with 0.7. R5 : facilities(sweet) ← with 0.5. R6 : location(sweet) ← with 0.3. R7 : rates(sweet) ← with 1.0. R8 : facilities(lux) ← with 0.9. R9 : location(lux) ← with 0.8. R10 : rates(lux) ← with 0.2.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-23
SLIDE 23

23/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (VI)

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-24
SLIDE 24

24/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (VII)

After aplying 3 unfolds based on →IS steps, we have the following program.

P10 =                                                  R1−2−3−4−I : popularity(sun) #←s1 #s3 #|s2 0.55 with 0.9. R1−5−6−7−I : popularity(sweet) #←s1 0.5 #|s2 0.65 with 0.9. R1−8−9−10−I : popularity(lux) #←s1 0.9 #|s2 0.5 with 0.9. R2 : facilities(sun) ← with #s3. R3 : location(sun) ← with 0.4. R4 : rates(sun) ← with 0.7. R5 : facilities(sweet) ← with 0.5. R6 : location(sweet) ← with 0.3. R7 : rates(sweet) ← with 1.0. R8 : facilities(lux) ← with 0.9. R9 : location(lux) ← with 0.8. R10 : rates(lux) ← with 0.2.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-25
SLIDE 25

25/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Example of Symbolic Unfolding (VIII)

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-26
SLIDE 26

26/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Index

1

Multi-Adjoint Lattices and Programs

2

Operational Semantics for sMALP

3

Unfolding of sMALP Programs

4

Conclusions and Further Research

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs

slide-27
SLIDE 27

27/27 Multi-Adjoint Lattices and Programs Operational Semantics for sMALP Unfolding of sMALP Programs Conclusions and Further Research

Conclusions and Further Research

Conclusions Fuzzy Logic Programming language: sMALP. Unfolding sMALP programs improve the efficiency. Ongoing work Proving correctness of the transformation. Unfolding symbolic fuzzy programs managing similarity relations. Implementing symbolic unfolding in the FLOPER environment. Exploring the synergies between symbolic unfolding and tuning transformations.

  • G. Moreno, J. Penabad, J. A. Riaza - ESCIM’17

Symbolic Unfolding of Multi-adjoint Logic Programs