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

Constraining a decision in pairs based on the value of one sides of the relationship #372

Open
hfaghihi15 opened this issue Apr 13, 2023 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@hfaghihi15
Copy link
Collaborator

Hi @auszok !

I was wondering how I can express the following constraint:

Location = Concept(...
Entity = Concept(...
Pair = Concept(..
Pair.has_a(Entity, Location)
The pair that has a location of value `text` equal to `none` should be correct! 
for instance if there are two locations  with property `text` being ('a', and  'none'). 
I want the one that is `none` to be true! This needs to be expressed as a constraint. 
@hfaghihi15 hfaghihi15 added the help wanted Extra attention is needed label Apr 13, 2023
@auszok
Copy link
Collaborator

auszok commented Apr 14, 2023

@hfaghihi15
What does it mean "location of value text equal to `none"? Do you mean that location has attribute "text" which could have value"none"?

@hfaghihi15
Copy link
Collaborator Author

@hfaghihi15 What does it mean "location of value text equal to `none"? Do you mean that location has attribute "text" which could have value"none"?

Yes, exactly.

@auszok
Copy link
Collaborator

auszok commented Apr 15, 2023

Okay. What does it mean "there are two locations with property text"? as Pair has only single location.
"I want the one that is none to be true!" So the one with text equal "a" is False?

@hfaghihi15
Copy link
Collaborator Author

Okay. What does it mean "there are two locations with property text"? as Pair has only single location. "I want the one that is none to be true!" So the one with text equal "a" is False?

To simplify with an example consider the following scenario:
@auszok
I have one entity named e1, I have one step called s1, one action connecting (e1, s1).
Then, I have two location candidates stored in concept location named (l1, l2).

Now, I want to say the following,
for each step and entity, if their action_label is Destroy (assume action_label is the multi-class derived concept from action), then its location should be l2. (I have another constraint saying that either l1 or l2 should be correct, so here it is only enough to say that l2 should be correct, automatically l1 will be false)

@hfaghihi15
Copy link
Collaborator Author

Okay. What does it mean "there are two locations with property text"? as Pair has only single location. "I want the one that is none to be true!" So the one with text equal "a" is False?

To simplify with an example consider the following scenario: @auszok I have one entity named e1, I have one step called s1, one action connecting (e1, s1). Then, I have two location candidates stored in concept location named (l1, l2).

Now, I want to say the following, for each step and entity, if their action_label is Destroy (assume action_label is the multi-class derived concept from action), then its location should be l2. (I have another constraint saying that either l1 or l2 should be correct, so here it is only enough to say that l2 should be correct, automatically l1 will be false)

To specify l2, we have filled the concept location with a property called text, so the text of l1 is l1 and the text of l2 is l2. now when we want to say that l2 should be correct, we want to use this property to refer to and select l2

@auszok
Copy link
Collaborator

auszok commented Apr 18, 2023

Something like that make work but it will be good to test it in real example:

ifL(
   # entity named e1, I have one step called s1, one action connecting (e1, s1), action_label is Destroy
   andL(
       entity('e1'),
       step('s1'),
       action_label.destroy('a1', path=(('s1', action_step.reversed), ('e1', action_entity.reversed)))
       ), 
   # then
      # l2 should be correct,
       location('path=('e1', llocation,  eqL(location, 'text', {'l2'} ) ) ),
       ), active = True
   ) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants