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

Bug in [cop-1] and [nui-1] #66

Open
alanruttenberg opened this issue May 29, 2023 · 2 comments
Open

Bug in [cop-1] and [nui-1] #66

alanruttenberg opened this issue May 29, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@alanruttenberg
Copy link
Contributor

Would allow a model

p1    i1      p2
|-------------|
        |
        p3

if p1 and p2 (first and last instant) were not part of i1.

Fixed by allowing possibility that t1 is start and t2 is end.

(forall (i start end)
 (if
  (and (instance-of i temporal-interval i)
   (has-first-instant i start) (has-last-instant i end))
  (forall (t1 t2)
   (if
    (and (or (temporal-part-of t1 i) (= t1 start))  <-----
     (or (temporal-part-of t2 i) (= t2 end))   <-----
     (instance-of t1 temporal-instant t1)
     (instance-of t2 temporal-instant t2) (precedes t1 t2)
     (not
      (exists (t3)
       (and (instance-of t3 temporal-instant t3) (precedes t1 t3)
        (precedes t3 t2)))))
    (exists (fill)
     (and (instance-of fill temporal-interval fill)
      (has-first-instant fill t1) (has-last-instant fill t2)
      (temporal-part-of fill i)))))))
@alanruttenberg
Copy link
Contributor Author

Actually another edge case in [nui-1]

p1    i1      p2
|-------------|
|--------|
    i2        p3

i2 wasn't being inferred to be part of i1 unless p1 was part of i1.
I was confused about the case where p1 was part of i2 and p1 wasn't part of i1 but that shouldn't be a model.
If I cared about the endpoints being parts it was wrong anyways, if p1 wasn't part of i2.

Revised:

(forall (i start end)
 (if
  (and (instance-of i temporal-interval i)
   (has-first-instant i start) (has-last-instant i end))
  (not
   (exists (gap gap-start gap-end)
    (and (not (instance-of gap temporal-instant gap))
     (has-first-instant gap gap-start) (has-last-instant gap gap-end)
     (or (precedes gap-end end) (= gap-end end))
     (or (precedes start gap-start) (= gap-start start))
     (not (temporal-part-of gap i)))))))

@alanruttenberg alanruttenberg changed the title Bug in [cop-1] Bug in [cop-1] and [nui-1] May 29, 2023
@alanruttenberg
Copy link
Contributor Author

Not sure about nui-1 now. Have to account for the fact that there can be several intervals with the same first and last instant, depending on which of the first and last instant are part of the interval.

@alanruttenberg alanruttenberg self-assigned this Sep 26, 2024
@alanruttenberg alanruttenberg added the bug Something isn't working label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant