karmaresearch / vlog

Apache License 2.0
55 stars 9 forks source link

Bug incomplete materialization join with constants and repeated constant fact #70

Closed irina-dragoste closed 3 years ago

irina-dragoste commented 3 years ago

For a KB

Le(i0,i13). 
Le(i13,i260).  
Leq(?x0,?x1) :- Le(?x0,?x1).
KPa(?x0,?x0) :- Leq(i0,?x0),Leq(?x0,i260).

the materialisation result is correct:

        Leq(i0, i13) .
        Leq(i13, i260) .
        Le(i0, i13) .
        Le(i13, i260) .
        KPa(i13, i13) .

However, if a rule (Leq(?x0,?x1) :- Eq(?x0,?x1).) and some facts (Eq(i0,i0). Le(i0,i260).) are added to this KB

Le(i0,i13).  
Le(i13,i260).  
Leq(?x0,?x1) :- Le(?x0,?x1).
KPa(?x0,?x0) :- Leq(i0,?x0),Leq(?x0,i260).

Eq(i0,i0). 
Le(i0,i260).
Leq(?x0,?x1) :- Eq(?x0,?x1).

the materialisation result is incomplete, as fact KPa(i13, i13) is missing :

    Leq(i0, i260) .
    Leq(i0, i13) . 
    Leq(i13, i260) .
    Leq(i0, i0) .
    Le(i0, i260) .
    Le(i0, i13) .
    Le(i13, i260) .
    Eq(i0, i0) .
    KPa(i0, i0) .

*Note that we used Rulewerk syntax for the knowledge base, where

Therefore, terms i0, i13, i260ocurring in rules are constants.