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

how to group the intervals #26

Closed
bhaskar219 opened this issue Apr 18, 2020 · 5 comments
Closed

how to group the intervals #26

bhaskar219 opened this issue Apr 18, 2020 · 5 comments
Labels
question Issue is a question

Comments

@bhaskar219
Copy link

Hi , your application is working good and no issue .

But i have another problem like ,

  • Actually its working for single type interval for ex:
    (c1>10 and c1 <20) or (c1 >30 and c1 <50)
    So this one i am changing to Interval format and evaluating. and getting information as
    c1 lower value is 10
    C1 upper value is 50

now i need in next level as instead of 1 if multiple are there how to do:
for ex:
(c1>10 and c1 <20) or (c1 >30 and c2 <50)
so i am expecting
c1 .lower and upper is (10 to +inf)
c2 lower and upper is (-inf to +inf)

This is not an issue , i need is there any way i can handle this.

@AlexandreDecan AlexandreDecan added the question Issue is a question label Apr 18, 2020
@AlexandreDecan
Copy link
Owner

Hello,

Thanks for your interest in portion! I will be happy to help you. Unfortunately, I do not understand what the question exactly is :-) Could you clarify what you would like to do with portion?

@bhaskar219
Copy link
Author

Thanks for your help :
lets take 1st case what is the satisfied interval for the following
(c1>10 and c1 <20) or (c1 >30 and c1 <50)
so i am converting it into
c1 >10 : I.open(10,+inf)
and : &
c1 <20 : I.open(-inf,20)
or : |
c1 >30 : I.open(30,+inf)
and : &
c1 < 50 : I.open(-inf,50)
so finally eval ( ( I.open(10,+inf) & I.open(-inf,20)) | (I.open(30,+inf) & I.open(-inf,50)) )
so finally i will get I.open(10,50)

but the above one is only for single variable.

If it is a multi variable like
(c1>10 and c1 <20) or (c1 >30 and c2 <50)

for c1 interval will be ( I.open(10,+inf) & I.open(-inf,20)) | (I.open(30,+inf) )) so I.open(10,+inf)
for c2 interval will be (I.open(-inf,+inf) | (I.open(-inf,50) so I.open(-inf,+inf)
because (c1>10 and c1 <20) in this expression no c2 and c1 have valid values so it can be any value thats why I.open(-inf,+inf)

If the above information understood then fine , other wise no problem.
need to do it for similarly multiple variables.

@AlexandreDecan
Copy link
Owner

I'm not sure I understood your example. If (c1>10 and c1 <20) or (c1 >30 and c1 <50), then the resulting interval is (P.open(10, P.inf) & P.open(-P.inf, 20)) | (P.open(30, P.inf) & P.open(-P.inf, 50)) that results in (10,20) | (30,50), not in (10,50).

For the second part about including a second variable, I have the impression that you're looking for a library that deals with constraint satisfaction problem. portion is a library to encode and manipulate intervals, not to find "values" that could satisfy a set of constraints. Even if these constraints can be encoded as intervals, you'll need "something more" to automatically find all possible values.

Considering your example, I would say that the interval for c1 can be encoded as P.open(10, 20) & P.open(30, P.inf) that results in () (i.e., empty interval) and the interval for c2 can be encoded as P.open(-P.inf, 50). As a consequence, there is no valid assignment for c1 and c2 (esp. for c1) that is valid, since the interval for c1 is empty.

@AlexandreDecan
Copy link
Owner

Did this help you? I'm closing this issue, but feel free to reopen it if needed!

@bhaskar219
Copy link
Author

bhaskar219 commented Apr 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants