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

Negative time signal when using Next #219

Closed
Gaudeval opened this issue Aug 12, 2020 · 3 comments
Closed

Negative time signal when using Next #219

Gaudeval opened this issue Aug 12, 2020 · 3 comments

Comments

@Gaudeval
Copy link
Contributor

Hi,

I have a question regarding the use of the Next operator (X) in mtl. It seems that when the (discrete) time starts at 0, the operator might result in negative times and use undefined signal values.

The following example highlights the issue. The property tries to capture whether a is True at time t and False in the next t+1:

import mtl
d = {"a": [(0, False), (1, True)]}
f = mtl.parse("(a & (X (~a)))")
f(d, time=None, quantitative=False, dt=1) # [(-1, True), (0, False), (1, False)]
assert not f(d, quantitative=False, dt=1)

This should not occur with the current inputs. However, the evaluation of the Next operator results in a signal which starts at -1, combined with a signal which does not have a value at that timestamp. Am I mistaken in my interpretation of the result I should expect from the operator?

@mvcisback
Copy link
Owner

Merged #220

@mvcisback mvcisback reopened this Aug 12, 2020
mvcisback added a commit that referenced this issue Aug 12, 2020
@mvcisback
Copy link
Owner

So, looking at this again. I believe that internally this is the correct semantics. We assume constant interpolation (even towards positive and negative infinity).

The problem with #220 is that it assumes the signal has a positive start time, which I don't want to enforce.

I just pushed a change that will use the start of the input signal which addresses this without assuming a positive start time.

@Gaudeval
Copy link
Contributor Author

I do prefer your solution as it uses the existing input signal information, which enforces the positive time constraint

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

No branches or pull requests

2 participants