HLR / DomiKnowS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification of differences between `ExistsAL` and `ExistsL` and similar logical constraints

hfaghihi15 opened this issue · comments

Hi @auszok,

I want a clarification between logical interface that can be both AL or L such as Atmost, Exists and Atleast.

My assumption is that whenever we have only one concept inside these constraint, we should use AL because we mean to count the variables that match that setting, whenever we have multiple concepts inside, then we have to use L which means to count the concepts for the same variable. Is that right?

So the following constraint is actually wrong and should be changed, right?

ifL(
        entity('e'),
        atMostL(
            when_create('x', path=('e', action_entity.reversed)),
        ), active = All_LC
    )

because I wanted to say that there should be almost one x that is found from that path and is correct. but this is saying that all when_creates should be correct because this is only one concept.

Could you please clarify this?

commented

@hfaghihi15 *AL counting constraints are over candidates population, *L counting constraints are over current candidate.
There is no rule that single variable constraints is always *AL and multiply variable is always *L.
In *AL if there are multiply variables then their populations are consolidated and the appropriate *AL constraint is enforced over it.

@hfaghihi15 *AL counting constraints are over candidates population, *L counting constraints are over current candidate. There is no rule that single variable constraints is always *AL and multiply variable is always *L. In *AL if there are multiply variables then their populations are consolidated and the appropriate *AL constraint is enforced over it.

I am still confused about their difference in cases such as above.
Here, for each e, I have multiple x values, and I want to enforce that at most one of them should be True, Which one of these logical statements should be used in this setting?

commented

@hfaghihi15

The lc has this description:

for each entity, only one when_create and when_destroy can be correct

and this definition:

ifL(
       entity('e'),
       atMostL(
           when_create('x', path=('e', action_entity.reversed)),
       ), active = Tested_Lc
   )

There are 5 candidates for 'e' and each 'e' has number of candidates for 'x'. When atMostL is used then the counting is done for each set of candidates for 'x' corresponding to the current 'e'. It enforces that there is only single when_create 'x' for each of the 5 candidate of 'e'.

Should the atMostAL be used instead then the counting will be across all the candidates for 'x' accumulated in a single set.
Thus, it will ensure that there is only single when_create 'x' in the whole population of 'x' candidates across all 'e'.