## Message Posted: Wed, 31 Oct 2012 @ 14:43:27 GMT

 < Last>>

 Subj: Re: OVERLAPS question From: Geoffrey Rommel

And why is that expression so complex?

```     [a]   (S1 > S2 AND NOT (S1 >= E2 AND E1 >= E2))
OR
[b]   (S2 > S1 AND NOT (S2 >= E1 AND E2 >= E1))
OR
[c]   (S1 = S2 AND (E1 = E2 OR E1 <> E2))
```

The NOT in [a] is confusing, so let's simplify it:

```     (S1 > S2 AND (S1 < E2 OR E1 < E2))
```

Now, if S1 > S2, the only way the periods can overlap is if E2 > S1. I'm pretty sure that the test for E1 < E2 is redundant. Thus, this can be simplified to:

```     (S1 > S2 AND S1 < E2)
```

Likewise, [b] can be simplified to:

```     (S2 > S1 AND S2 < E1)
```

[c] is particularly odd -- E1 is equal to E2 or not equal to E2? Simplify to:

```     (S1 = S2)
```

Thus the whole expression reduces to:

```     (S2 < S1 AND S1 < E2)
OR
(S1 < S2 AND S2 < E1)
OR
(S1 = S2)
```

I am currently working on test cases in order to prove this hypothesis. I've already found three cases in which the expression in the manual does not return the same result as the OVERLAPS predicate.

 < Last>>

Attachments

Library

Quick Reference

Archives

Sample Index

 2016 2007 2015 2006 2014 2005 2013 2004 2012 2003 2011 2002 2010 2001 2009 2000 2008 1999

2012 Indexes

 Jan Jul Feb Aug Mar Sep Apr Oct May Nov Jun Dec

 Top Home Privacy Feedback