Conflict resolution - PowerPoint PPT Presentation

About This Presentation
Title:

Conflict resolution

Description:

Cycle1: Fireable = {(R1 {(D1/?x)}), (R1 {(D2/?x) ... Cycle1: Facts: S1[value- 200] Fireable = {(R1 {(S1/?s), (200/?v) ... Cycle1: Facts: John[salary- 50] ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 17
Provided by: Christiand160
Learn more at: https://lists.w3.org
Category:

less

Transcript and Presenter's Notes

Title: Conflict resolution


1
Conflict resolution
2
Background
  • Input set of  fireable instances 
  • Instance (ltRuleIfgt, substitution)
  • Substitution (ci/?xi) for all ?xi in
    Var(rule)
  • Firable instantiated condition is satisfied
  • Output set of instances to be fired
  • E.g.
  • Remove according to  no-repeat 
  • Order according to XYZ
  • Keep only first

3
No-repeat
  • Proposal 1
  • Remove instance such that rule has already been
    fired with same instantiated action part and a
    instance of the rule with that same instantiated
    action part has always been firable since

4
Example 1
  • Rules
  • R1 IF Alarm(?x) THEN printRed( Alarm )
  • Facts
  • Alarm(D1)
  • Alarm(D2)
  • Execution
  • Cycle1
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)
  • FireOne (R1 (D1/?x)) Alarm
  • Cycle2
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)
  • No-repeat Fireable
  • Stop!

5
Example 1
  • Rules
  • R1 IF Alarm(?x) THEN printRed( Alarm )
  • Facts
  • Alarm(D1)
  • Alarm(D2)
  • Execution
  • Cycle1
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)
  • FireAll (R1 (D1/?x)), (R1 (D2/?x) Alarm
    Alarm
  • Cycle2
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)
  • No-repeat Fireable
  • Stop!

6
Example 1
  • Rules
  • R1 IF Alarm(?x) THEN printRed( Alarm )
  • R2 IF Alarm(?Y) THEN printRed( Alarm )
  • Facts
  • Alarm(D1)
  • Alarm(D2)
  • Execution
  • Cycle1
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)), (R2
    (D1/?y)), (R2 (D2/?Y))
  • FireOne (R1 (D1/?x)) Alarm
  • Cycle2
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)), (R2
    (D1/?y)), (R2 (D2/?Y))
  • No-repeat Fireable (R2 (D1/?y)), (R2
    (D2/?Y))
  • FireOne (R2 (D1/?x)) Alarm
  • Cycle3
  • Fireable (R1 (D1/?x)), (R1 (D2/?x)), (R2
    (D1/?y)), (R2 (D2/?Y))
  • No-repeat Fireable
  • Stop

7
Example 2
  • Rules
  • R1 ?sSensor IF ?sreading-gt?v ?vgt100 THEN
    printRed ( Alarm  ?s)
  • Facts
  • S1value-gt200
  • Execution
  • Cycle1
  • Fireable (R1 (S1/?s))
  • FireOne (R1 (S1/?s)) Alarm S1
  • Cycle2
  • Fireable (R1 (S1/?s))
  • No-repeat Fireable
  • Stop!

8
Example 3
  • Rules
  • R1
  • ?sSensor IF ?sreading-gt?v ?vgt100 THEN
    printRed ( Alarm  ?s)
  • Facts
  • S1value-gt200
  • Execution
  • Cycle1
  • Facts S1value-gt200
  • Fireable (R1 (S1/?s))
  • FireOne (R1 (S1/?s)) Alarm S1
  • Cycle2
  • Facts S1value-gt300
  • Fireable (R1 (S1/?s))
  • No-repeat Fireable
  • Stop!

9
Example 4
  • Rules
  • R1
  • ?sSensor IF ?sreading-gt?v ?vgt100 THEN
    printRed ( Alarm  ?s ?v)
  • Facts
  • S1value-gt200
  • Execution
  • Cycle1
  • Facts S1value-gt200
  • Fireable (R1 (S1/?s), (200/?v))
  • FireOne (R1 (S1/?s), (200/?v)) Alarm S1 200
  • Cycle2
  • Facts S1value-gt300
  • No-repeat Fireable (R1 (S1/?s), (300/?v))
  • FireOne (R1 (S1/?s), (300/?v)) Alarm S1 300

10
No-repeat
  • Proposal 2
  • Remove instance such that rule has already been
    fired with same instantiation for listed
    variables and a instance of the rule with that
    same instantiation for listed variables has
    always been firable since.

11
Example 4 (specify variables)
  • Rules
  • R1 (no-loop ?s)
  • ?sSensor IF ?sreading-gt?v ?vgt100 THEN
    printRed ( Alarm  ?s ?v)
  • Facts
  • S1value-gt200
  • Execution
  • Cycle1
  • Facts S1value-gt200
  • Fireable (R1 (S1/?s), (200/?v))
  • FireOne (R1 (S1/?s), (200/?v)) Alarm S1 200
  • Cycle2
  • Facts S1value-gt300
  • No-repeat Fireable
  • Stop!

12
No-repeat
  • Proposal 2
  • Remove instance such that rule has already been
    fired with same instantiation for listed
    variables and a instance of the rule with that
    same instantiation for listed variables has
    always been firable since.
  • Keys only?

13
Example 5
  • Rules
  • R1
  • ?eemployee
  • IF ?esalary-gt?s ?sgt100
  • THEN Retract(?esalary-gt?s), Assert(?esalary-gt?s
    1.1)
  • Execution
  • Cycle1
  • Facts Johnsalary-gt50
  • Fireable (R1 (S1John/?e), (50/?s))
  • FireOne (R1 (S1John/?e), (50/?s))
    Facts Johnsalary-gt55
  • Cycle2
  • Facts Johnsalary-gt55
  • Fireable (R1 (S1John/?e), (55/?s))
  • FireOne (R1 (S1John/?e), (55/?s))
    Facts Johnsalary-gt60.5

14
No-repeat
  • Proposal 3
  • Remove instance such that rule has already been
    fired with same instantiated action part
    instantiation for listed variables and a
    instance of the rule with that same instantiated
    action part instantiation for listed variables
    has always been firable since, where the new
    values of MODIFYed variables are carried on.

15
Example 5 (modified)
  • Rules
  • R1
  • ?eemployee
  • IF ?esalary-gt?s ?sgt100
  • THEN Retract(?esalary-gt?s), Assert(?esalary-gt?s
    1.1)
  • Execution
  • Cycle1
  • Facts Johnsalary-gt50
  • Fireable (R1 (S1John/?e), (50/?s))
  • FireOne (R1 (S1John/?e), (50/?s))
    Facts Johnsalary-gt55
  • Fired (R1 (S1John/?e), (55/?s))
  • Cycle2
  • Facts Johnsalary-gt55
  • No-repeat Fireable
  • Stop!

16
Problems with import
  • No-repeat on single rules
  • No-repeat on variables
Write a Comment
User Comments (0)
About PowerShow.com