Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification of differences between ExistsAL and ExistsL and similar logical constraints #380

Open
hfaghihi15 opened this issue May 23, 2023 · 3 comments
Assignees
Labels
document missing Something need more clear documentation

Comments

@hfaghihi15
Copy link
Collaborator

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?

@hfaghihi15 hfaghihi15 added the document missing Something need more clear documentation label May 23, 2023
@auszok
Copy link
Collaborator

auszok commented May 23, 2023

@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
Copy link
Collaborator Author

@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?

@auszok
Copy link
Collaborator

auszok commented May 24, 2023

@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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document missing Something need more clear documentation
Projects
None yet
Development

No branches or pull requests

2 participants