dwolter_SparQ/Calculi/indu.lisp
;;;
;;;
;;;

(def-calculus "INDU - Interval duration calculus"
  :arity              :binary
  :parametric?        nil
  :consistency        :unknown
  :basis-entity       :interval
  :identity-relation  EQ=
  :converse-operation ((SI>   (s<))
		       (S<    (si>))
		       (OI>   (o<))
		       (OI=   (o=))
		       (OI<   (o>))
		       (O>    (oi<))
		       (O=    (oi=))
		       (O<    (oi>))
		       (MI>   (m<))
		       (MI=   (m=))
		       (MI<   (m>))
		       (M>    (mi<))
		       (M=    (mi=))
		       (M<    (mi>))
		       (FI>   (f<))
		       (F<    (fi>))
		       (EQ=   (eq=))
		       (DI>   (d<))
		       (D<    (di>))
		       (BI>   (b<))
		       (BI=   (b=))
		       (BI<   (b>))
		       (B>    (bi<))
		       (B=    (bi=))
		       (B<    (bi>)))
  :base-relations (SI> S< OI> OI= OI< O> O= O< MI> MI= MI< M> M= M< FI> F< EQ= DI> D< BI> BI= BI< B> B= B<)
  :composition-operation 
(
 (SI>  SI>  (si>))
 (SI>  S<   (eq= s< si>))
 (SI>  OI>  (oi>))
 (SI>  OI=  (oi>))
 (SI>  OI<  (oi< oi= oi>))
 (SI>  O>   (di> fi> o>))
 (SI>  O=   (di> fi> o>))
 (SI>  O<   (di> fi> o< o= o>))
 (SI>  MI>  (mi>))
 (SI>  MI=  (mi>))
 (SI>  MI<  (mi< mi= mi>))
 (SI>  M>   (di> fi> o>))
 (SI>  M=   (di> fi> o>))
 (SI>  M<   (di> fi> o< o= o>))
 (SI>  FI>  (di>))
 (SI>  F<   (oi< oi= oi>))
 (SI>  EQ=  (si>))
 (SI>  DI>  (di>))
 (SI>  D<   (d< f< oi< oi= oi>))
 (SI>  BI>  (bi>))
 (SI>  BI=  (bi>))
 (SI>  BI<  (bi< bi= bi>))
 (SI>  B>   (b> di> fi> m> o>))
 (SI>  B=   (b> di> fi> m> o>))
 (SI>  B<   (b< b= b> di> fi> m< m= m> o< o= o>))
 (S<  SI>   (eq= s< si>))
 (S<  S<    (s<))
 (S<  OI>   (d< f< oi< oi= oi>))
 (S<  OI=   (d< f< oi<))
 (S<  OI<   (d< f< oi<))
 (S<  O>    (b< b= b> m< m= m> o< o= o>))
 (S<  O=    (b< m< o<))
 (S<  O<    (b< m< o<))
 (S<  MI>   (mi< mi= mi>))
 (S<  MI=   (mi<))
 (S<  MI<   (mi<))
 (S<  M>    (b< b= b>))
 (S<  M=    (b<))
 (S<  M<    (b<))
 (S<  FI>   (b< b= b> m< m= m> o< o= o>))
 (S<  F<    (d<))
 (S<  EQ=   (s<))
 (S<  DI>   (b< b= b> di> fi> m< m= m> o< o= o>))
 (S<  D<    (d<))
 (S<  BI>   (bi< bi= bi>))
 (S<  BI=   (bi<))
 (S<  BI<   (bi<))
 (S<  B>    (b< b= b>))
 (S<  B=    (b<))
 (S<  B<    (b<))
 (OI>  SI>  (bi> mi> oi>))
 (OI>  S<   (d< f< oi< oi= oi>))
 (OI>  OI>  (bi> mi> oi>))
 (OI>  OI=  (bi> mi> oi>))
 (OI>  OI<  (bi< bi= bi> mi< mi= mi> oi< oi= oi>))
 (OI>  O>   (di> fi> o> oi> si>))
 (OI>  O=   (di> fi> o> oi> si>))
 (OI>  O<   (d< di> eq= f< fi> o< o= o> oi< oi= oi> s< si>))
 (OI>  MI>  (bi>))
 (OI>  MI=  (bi>))
 (OI>  MI<  (bi< bi= bi>))
 (OI>  M>   (di> fi> o>))
 (OI>  M=   (di> fi> o>))
 (OI>  M<   (di> fi> o< o= o>))
 (OI>  FI>  (di> oi> si>))
 (OI>  F<   (oi< oi= oi>))
 (OI>  EQ=  (oi>))
 (OI>  DI>  (bi> di> mi> oi> si>))
 (OI>  D<   (d< f< oi< oi= oi>))
 (OI>  BI>  (bi>))
 (OI>  BI=  (bi>))
 (OI>  BI<  (bi< bi= bi>))
 (OI>  B>   (b> di> fi> m> o>))
 (OI>  B=   (b> di> fi> m> o>))
 (OI>  B<   (b< b= b> di> fi> m< m= m> o< o= o>))
 (OI=  SI>  (bi> mi> oi>))
 (OI=  S<   (d< f< oi<))
 (OI=  OI>  (bi> mi> oi>))
 (OI=  OI=  (bi= mi= oi=))
 (OI=  OI<  (bi< mi< oi<))
 (OI=  O>   (di> fi> o> oi> si>))
 (OI=  O=   (eq= o= oi=))
 (OI=  O<   (d< f< o< oi< s<))
 (OI=  MI>  (bi>))
 (OI=  MI=  (bi=))
 (OI=  MI<  (bi<))
 (OI=  M>   (di> fi> o>))
 (OI=  M=   (o=))
 (OI=  M<   (o<))
 (OI=  FI>  (di> oi> si>))
 (OI=  F<   (oi<))
 (OI=  EQ=  (oi=))
 (OI=  DI>  (bi> di> mi> oi> si>))
 (OI=  D<   (d< f< oi<))
 (OI=  BI>  (bi>))
 (OI=  BI=  (bi=))
 (OI=  BI<  (bi<))
 (OI=  B>   (b> di> fi> m> o>))
 (OI=  B=   (b= m= o=))
 (OI=  B<   (b< m< o<))
 (OI<  SI>  (bi< bi= bi> mi< mi= mi> oi< oi= oi>))
 (OI<  S<   (d< f< oi<))
 (OI<  OI>  (bi< bi= bi> mi< mi= mi> oi< oi= oi>))
 (OI<  OI=  (bi< mi< oi<))
 (OI<  OI<  (bi< mi< oi<))
 (OI<  O>   (d< di> eq= f< fi> o< o= o> oi< oi= oi> s< si>))
 (OI<  O=   (d< f< o< oi< s<))
 (OI<  O<   (d< f< o< oi< s<))
 (OI<  MI>  (bi< bi= bi>))
 (OI<  MI=  (bi<))
 (OI<  MI<  (bi<))
 (OI<  M>   (di> fi> o< o= o>))
 (OI<  M=   (o<))
 (OI<  M<   (o<))
 (OI<  FI>  (di> oi< oi= oi> si>))
 (OI<  F<   (oi<))
 (OI<  EQ=  (oi<))
 (OI<  DI>  (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (OI<  D<   (d< f< oi<))
 (OI<  BI>  (bi< bi= bi>))
 (OI<  BI=  (bi<))
 (OI<  BI<  (bi<))
 (OI<  B>   (b< b= b> di> fi> m< m= m> o< o= o>))
 (OI<  B=   (b< m< o<))
 (OI<  B<   (b< m< o<))
 (O>  SI>   (di> fi> o>))
 (O>  S<    (o< o= o>))
 (O>  OI>   (di> fi> o> oi> si>))
 (O>  OI=   (di> fi> o> oi> si>))
 (O>  OI<   (d< di> eq= f< fi> o< o= o> oi< oi= oi> s< si>))
 (O>  O>    (b> m> o>))
 (O>  O=    (b> m> o>))
 (O>  O<    (b< b= b> m< m= m> o< o= o>))
 (O>  MI>   (di> oi> si>))
 (O>  MI=   (di> oi> si>))
 (O>  MI<   (di> oi< oi= oi> si>))
 (O>  M>    (b>))
 (O>  M=    (b>))
 (O>  M<    (b< b= b>))
 (O>  FI>   (b> m> o>))
 (O>  F<    (d< o< o= o> s<))
 (O>  EQ=   (o>))
 (O>  DI>   (b> di> fi> m> o>))
 (O>  D<    (d< o< o= o> s<))
 (O>  BI>   (bi> di> mi> oi> si>))
 (O>  BI=   (bi> di> mi> oi> si>))
 (O>  BI<   (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (O>  B>    (b>))
 (O>  B=    (b>))
 (O>  B<    (b< b= b>))
 (O=  SI>   (di> fi> o>))
 (O=  S<    (o<))
 (O=  OI>   (di> fi> o> oi> si>))
 (O=  OI=   (eq= o= oi=))
 (O=  OI<   (d< f< o< oi< s<))
 (O=  O>    (b> m> o>))
 (O=  O=    (b= m= o=))
 (O=  O<    (b< m< o<))
 (O=  MI>   (di> oi> si>))
 (O=  MI=   (oi=))
 (O=  MI<   (oi<))
 (O=  M>    (b>))
 (O=  M=    (b=))
 (O=  M<    (b<))
 (O=  FI>   (b> m> o>))
 (O=  F<    (d< o< s<))
 (O=  EQ=   (o=))
 (O=  DI>   (b> di> fi> m> o>))
 (O=  D<    (d< o< s<))
 (O=  BI>   (bi> di> mi> oi> si>))
 (O=  BI=   (bi= mi= oi=))
 (O=  BI<   (bi< mi< oi<))
 (O=  B>    (b>))
 (O=  B=    (b=))
 (O=  B<    (b<))
 (O<  SI>   (di> fi> o< o= o>))
 (O<  S<    (o<))
 (O<  OI>   (d< di> eq= f< fi> o< o= o> oi< oi= oi> s< si>))
 (O<  OI=   (d< f< o< oi< s<))
 (O<  OI<   (d< f< o< oi< s<))
 (O<  O>    (b< b= b> m< m= m> o< o= o>))
 (O<  O=    (b< m< o<))
 (O<  O<    (b< m< o<))
 (O<  MI>   (di> oi< oi= oi> si>))
 (O<  MI=   (oi<))
 (O<  MI<   (oi<))
 (O<  M>    (b< b= b>))
 (O<  M=    (b<))
 (O<  M<    (b<))
 (O<  FI>   (b< b= b> m< m= m> o< o= o>))
 (O<  F<    (d< o< s<))
 (O<  EQ=   (o<))
 (O<  DI>   (b< b= b> di> fi> m< m= m> o< o= o>))
 (O<  D<    (d< o< s<))
 (O<  BI>   (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (O<  BI=   (bi< mi< oi<))
 (O<  BI<   (bi< mi< oi<))
 (O<  B>    (b< b= b>))
 (O<  B=    (b<))
 (O<  B<    (b<))
 (MI>  SI>  (bi>))
 (MI>  S<   (d< f< oi< oi= oi>))
 (MI>  OI>  (bi>))
 (MI>  OI=  (bi>))
 (MI>  OI<  (bi< bi= bi>))
 (MI>  O>   (oi>))
 (MI>  O=   (oi>))
 (MI>  O<   (d< f< oi< oi= oi>))
 (MI>  MI>  (bi>))
 (MI>  MI=  (bi>))
 (MI>  MI<  (bi< bi= bi>))
 (MI>  M>   (si>))
 (MI>  M=   (si>))
 (MI>  M<   (eq= s< si>))
 (MI>  FI>  (mi>))
 (MI>  F<   (mi< mi= mi>))
 (MI>  EQ=  (mi>))
 (MI>  DI>  (bi>))
 (MI>  D<   (d< f< oi< oi= oi>))
 (MI>  BI>  (bi>))
 (MI>  BI=  (bi>))
 (MI>  BI<  (bi< bi= bi>))
 (MI>  B>   (b> di> fi> m> o>))
 (MI>  B=   (b> di> fi> m> o>))
 (MI>  B<   (b< b= b> di> fi> m< m= m> o< o= o>))
 (MI=  SI>  (bi>))
 (MI=  S<   (d< f< oi<))
 (MI=  OI>  (bi>))
 (MI=  OI=  (bi=))
 (MI=  OI<  (bi<))
 (MI=  O>   (oi>))
 (MI=  O=   (oi=))
 (MI=  O<   (d< f< oi<))
 (MI=  MI>  (bi>))
 (MI=  MI=  (bi=))
 (MI=  MI<  (bi<))
 (MI=  M>   (si>))
 (MI=  M=   (eq=))
 (MI=  M<   (s<))
 (MI=  FI>  (mi>))
 (MI=  F<   (mi<))
 (MI=  EQ=  (mi=))
 (MI=  DI>  (bi>))
 (MI=  D<   (d< f< oi<))
 (MI=  BI>  (bi>))
 (MI=  BI=  (bi=))
 (MI=  BI<  (bi<))
 (MI=  B>   (b> di> fi> m> o>))
 (MI=  B=   (b= m= o=))
 (MI=  B<   (b< m< o<))
 (MI<  SI>  (bi< bi= bi>))
 (MI<  S<   (d< f< oi<))
 (MI<  OI>  (bi< bi= bi>))
 (MI<  OI=  (bi<))
 (MI<  OI<  (bi<))
 (MI<  O>   (d< f< oi< oi= oi>))
 (MI<  O=   (d< f< oi<))
 (MI<  O<   (d< f< oi<))
 (MI<  MI>  (bi< bi= bi>))
 (MI<  MI=  (bi<))
 (MI<  MI<  (bi<))
 (MI<  M>   (eq= s< si>))
 (MI<  M=   (s<))
 (MI<  M<   (s<))
 (MI<  FI>  (mi< mi= mi>))
 (MI<  F<   (mi<))
 (MI<  EQ=  (mi<))
 (MI<  DI>  (bi< bi= bi>))
 (MI<  D<   (d< f< oi<))
 (MI<  BI>  (bi< bi= bi>))
 (MI<  BI=  (bi<))
 (MI<  BI<  (bi<))
 (MI<  B>   (b< b= b> di> fi> m< m= m> o< o= o>))
 (MI<  B=   (b< m< o<))
 (MI<  B<   (b< m< o<))
 (M>  SI>   (m>))
 (M>  S<    (m< m= m>))
 (M>  OI>   (o>))
 (M>  OI=   (o>))
 (M>  OI<   (d< o< o= o> s<))
 (M>  O>    (b>))
 (M>  O=    (b>))
 (M>  O<    (b< b= b>))
 (M>  MI>   (fi>))
 (M>  MI=   (fi>))
 (M>  MI<   (eq= f< fi>))
 (M>  M>    (b>))
 (M>  M=    (b>))
 (M>  M<    (b< b= b>))
 (M>  FI>   (b>))
 (M>  F<    (d< o< o= o> s<))
 (M>  EQ=   (m>))
 (M>  DI>   (b>))
 (M>  D<    (d< o< o= o> s<))
 (M>  BI>   (bi> di> mi> oi> si>))
 (M>  BI=   (bi> di> mi> oi> si>))
 (M>  BI<   (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (M>  B>    (b>))
 (M>  B=    (b>))
 (M>  B<    (b< b= b>))
 (M=  SI>   (m>))
 (M=  S<    (m<))
 (M=  OI>   (o>))
 (M=  OI=   (o=))
 (M=  OI<   (d< o< s<))
 (M=  O>    (b>))
 (M=  O=    (b=))
 (M=  O<    (b<))
 (M=  MI>   (fi>))
 (M=  MI=   (eq=))
 (M=  MI<   (f<))
 (M=  M>    (b>))
 (M=  M=    (b=))
 (M=  M<    (b<))
 (M=  FI>   (b>))
 (M=  F<    (d< o< s<))
 (M=  EQ=   (m=))
 (M=  DI>   (b>))
 (M=  D<    (d< o< s<))
 (M=  BI>   (bi> di> mi> oi> si>))
 (M=  BI=   (bi= mi= oi=))
 (M=  BI<   (bi< mi< oi<))
 (M=  B>    (b>))
 (M=  B=    (b=))
 (M=  B<    (b<))
 (M<  SI>   (m< m= m>))
 (M<  S<    (m<))
 (M<  OI>   (d< o< o= o> s<))
 (M<  OI=   (d< o< s<))
 (M<  OI<   (d< o< s<))
 (M<  O>    (b< b= b>))
 (M<  O=    (b<))
 (M<  O<    (b<))
 (M<  MI>   (eq= f< fi>))
 (M<  MI=   (f<))
 (M<  MI<   (f<))
 (M<  M>    (b< b= b>))
 (M<  M=    (b<))
 (M<  M<    (b<))
 (M<  FI>   (b< b= b>))
 (M<  F<    (d< o< s<))
 (M<  EQ=   (m<))
 (M<  DI>   (b< b= b>))
 (M<  D<    (d< o< s<))
 (M<  BI>   (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (M<  BI=   (bi< mi< oi<))
 (M<  BI<   (bi< mi< oi<))
 (M<  B>    (b< b= b>))
 (M<  B=    (b<))
 (M<  B<    (b<))
 (FI>  SI>  (di>))
 (FI>  S<   (o< o= o>))
 (FI>  OI>  (di> oi> si>))
 (FI>  OI=  (di> oi> si>))
 (FI>  OI<  (di> oi< oi= oi> si>))
 (FI>  O>   (o>))
 (FI>  O=   (o>))
 (FI>  O<   (o< o= o>))
 (FI>  MI>  (di> oi> si>))
 (FI>  MI=  (di> oi> si>))
 (FI>  MI<  (di> oi< oi= oi> si>))
 (FI>  M>   (m>))
 (FI>  M=   (m>))
 (FI>  M<   (m< m= m>))
 (FI>  FI>  (fi>))
 (FI>  F<   (eq= f< fi>))
 (FI>  EQ=  (fi>))
 (FI>  DI>  (di>))
 (FI>  D<   (d< o< o= o> s<))
 (FI>  BI>  (bi> di> mi> oi> si>))
 (FI>  BI=  (bi> di> mi> oi> si>))
 (FI>  BI<  (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (FI>  B>   (b>))
 (FI>  B=   (b>))
 (FI>  B<   (b< b= b>))
 (F<  SI>   (bi< bi= bi> mi< mi= mi> oi< oi= oi>))
 (F<  S<    (d<))
 (F<  OI>   (bi< bi= bi> mi< mi= mi> oi< oi= oi>))
 (F<  OI=   (bi< mi< oi<))
 (F<  OI<   (bi< mi< oi<))
 (F<  O>    (d< o< o= o> s<))
 (F<  O=    (d< o< s<))
 (F<  O<    (d< o< s<))
 (F<  MI>   (bi< bi= bi>))
 (F<  MI=   (bi<))
 (F<  MI<   (bi<))
 (F<  M>    (m< m= m>))
 (F<  M=    (m<))
 (F<  M<    (m<))
 (F<  FI>   (eq= f< fi>))
 (F<  F<    (f<))
 (F<  EQ=   (f<))
 (F<  DI>   (bi< bi= bi> di> mi< mi= mi> oi< oi= oi> si>))
 (F<  D<    (d<))
 (F<  BI>   (bi< bi= bi>))
 (F<  BI=   (bi<))
 (F<  BI<   (bi<))
 (F<  B>    (b< b= b>))
 (F<  B=    (b<))
 (F<  B<    (b<))
 (EQ=  SI>  (si>))
 (EQ=  S<   (s<))
 (EQ=  OI>  (oi>))
 (EQ=  OI=  (oi=))
 (EQ=  OI<  (oi<))
 (EQ=  O>   (o>))
 (EQ=  O=   (o=))
 (EQ=  O<   (o<))
 (EQ=  MI>  (mi>))
 (EQ=  MI=  (mi=))
 (EQ=  MI<  (mi<))
 (EQ=  M>   (m>))
 (EQ=  M=   (m=))
 (EQ=  M<   (m<))
 (EQ=  FI>  (fi>))
 (EQ=  F<   (f<))
 (EQ=  EQ=  (eq=))
 (EQ=  DI>  (di>))
 (EQ=  D<   (d<))
 (EQ=  BI>  (bi>))
 (EQ=  BI=  (bi=))
 (EQ=  BI<  (bi<))
 (EQ=  B>   (b>))
 (EQ=  B=   (b=))
 (EQ=  B<   (b<))
 (DI>  SI>  (di>))
 (DI>  S<   (di> fi> o< o= o>))
 (DI>  OI>  (di> oi> si>))
 (DI>  OI=  (di> oi> si>))
 (DI>  OI<  (di> oi< oi= oi> si>))
 (DI>  O>   (di> fi> o>))
 (DI>  O=   (di> fi> o>))
 (DI>  O<   (di> fi> o< o= o>))
 (DI>  MI>  (di> oi> si>))
 (DI>  MI=  (di> oi> si>))
 (DI>  MI<  (di> oi< oi= oi> si>))
 (DI>  M>   (di> fi> o>))
 (DI>  M=   (di> fi> o>))
 (DI>  M<   (di> fi> o< o= o>))
 (DI>  FI>  (di>))
 (DI>  F<   (di> oi< oi= oi> si>))
 (DI>  EQ=  (di>))
 (DI>  DI>  (di>))
 (DI>  D<   (d< di> eq= f< fi> o< o= o> oi< oi= oi> s< si>))
 (DI>  BI>  (bi> di> mi> oi> si>))
 (DI>  BI=  (bi> di> mi> oi> si>))
 (DI>  BI<  (bi< bi= bi> di> mi< mi> oi< oi= oi> si> mi=))
 (DI>  B>   (b> di> fi> m> o>))
 (DI>  B=   (b> di> fi> m> o>))
 (DI>  B<   (b< b= b> di> fi> m< m= m> o< o= o>))
 (D<  SI>   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (D<  S<    (d<))
 (D<  OI>   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (D<  OI=   (bi< d< f< mi< oi<))
 (D<  OI<   (bi< d< f< mi< oi<))
 (D<  O>    (b< b= b> d< m< m= m> o< o= o> s<))
 (D<  O=    (b< d< m< o< s<))
 (D<  O<    (b< d< m< o< s<))
 (D<  MI>   (bi< bi= bi>))
 (D<  MI=   (bi<))
 (D<  MI<   (bi<))
 (D<  M>    (b< b= b>))
 (D<  M=    (b<))
 (D<  M<    (b<))
 (D<  FI>   (b< b= b> d< m< m= m> o< o= o> s<))
 (D<  F<    (d<))
 (D<  EQ=   (d<))
 (D<  DI>   (b< b= b> bi< bi= bi> d< di> eq= f< fi> m< m= m> mi< mi= mi> o< o= o> oi< oi= oi> s< si>))
 (D<  D<    (d<))
 (D<  BI>   (bi< bi= bi>))
 (D<  BI=   (bi<))
 (D<  BI<   (bi<))
 (D<  B>    (b< b= b>))
 (D<  B=    (b<))
 (D<  B<    (b<))
 (BI>  SI>  (bi>))
 (BI>  S<   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (BI>  OI>  (bi>))
 (BI>  OI=  (bi>))
 (BI>  OI<  (bi< bi= bi>))
 (BI>  O>   (bi> mi> oi>))
 (BI>  O=   (bi> mi> oi>))
 (BI>  O<   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (BI>  MI>  (bi>))
 (BI>  MI=  (bi>))
 (BI>  MI<  (bi< bi= bi>))
 (BI>  M>   (bi> mi> oi>))
 (BI>  M=   (bi> mi> oi>))
 (BI>  M<   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (BI>  FI>  (bi>))
 (BI>  F<   (bi< bi= bi>))
 (BI>  EQ=  (bi>))
 (BI>  DI>  (bi>))
 (BI>  D<   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (BI>  BI>  (bi>))
 (BI>  BI=  (bi>))
 (BI>  BI<  (bi< bi= bi>))
 (BI>  B>   (b> bi> di> fi> m> mi> o> oi> si>))
 (BI>  B=   (b> bi> di> fi> m> mi> o> oi> si>))
 (BI>  B<   (b< b= b> bi< bi= bi> d< di> eq= f< fi> m< m= m> mi< mi= mi> o< o= o> oi< oi= oi> s< si>))
 (BI=  SI>  (bi>))
 (BI=  S<   (bi< d< f< mi< oi<))
 (BI=  OI>  (bi>))
 (BI=  OI=  (bi=))
 (BI=  OI<  (bi<))
 (BI=  O>   (bi> mi> oi>))
 (BI=  O=   (bi= mi= oi=))
 (BI=  O<   (bi< d< f< mi< oi<))
 (BI=  MI>  (bi>))
 (BI=  MI=  (bi=))
 (BI=  MI<  (bi<))
 (BI=  M>   (bi> mi> oi>))
 (BI=  M=   (bi= mi= oi=))
 (BI=  M<   (bi< d< f< mi< oi<))
 (BI=  FI>  (bi>))
 (BI=  F<   (bi<))
 (BI=  EQ=  (bi=))
 (BI=  DI>  (bi>))
 (BI=  D<   (bi< d< f< mi< oi<))
 (BI=  BI>  (bi>))
 (BI=  BI=  (bi=))
 (BI=  BI<  (bi<))
 (BI=  B>   (b> bi> di> fi> m> mi> o> oi> si>))
 (BI=  B=   (b= bi= eq= m= mi= o= oi=))
 (BI=  B<   (b< bi< d< f< m< mi< o< oi< s<))
 (BI<  SI>  (bi< bi= bi>))
 (BI<  S<   (bi< d< f< mi< oi<))
 (BI<  OI>  (bi< bi= bi>))
 (BI<  OI=  (bi<))
 (BI<  OI<  (bi<))
 (BI<  O>   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (BI<  O=   (bi< d< f< mi< oi<))
 (BI<  O<   (bi< d< f< mi< oi<))
 (BI<  MI>  (bi< bi= bi>))
 (BI<  MI=  (bi<))
 (BI<  MI<  (bi<))
 (BI<  M>   (bi< bi= bi> d< f< mi< mi= mi> oi< oi= oi>))
 (BI<  M=   (bi< d< f< mi< oi<))
 (BI<  M<   (bi< d< f< mi< oi<))
 (BI<  FI>  (bi< bi= bi>))
 (BI<  F<   (bi<))
 (BI<  EQ=  (bi<))
 (BI<  DI>  (bi< bi= bi>))
 (BI<  D<   (bi< d< f< mi< oi<))
 (BI<  BI>  (bi< bi= bi>))
 (BI<  BI=  (bi<))
 (BI<  BI<  (bi<))
 (BI<  B>   (b< b= b> bi< bi= bi> d< di> eq= f< fi> m< m= m> mi< mi= mi> o< o= o> oi< oi= oi> s< si>))
 (BI<  B=   (b< bi< d< f< m< mi< o< oi< s<))
 (BI<  B<   (b< bi< d< f< m< mi< o< oi< s<))
 (B>  SI>   (b>))
 (B>  S<    (b< b= b>))
 (B>  OI>   (b> m> o>))
 (B>  OI=   (b> m> o>))
 (B>  OI<   (b< b= b> d< m< m= m> o< o= o> s<))
 (B>  O>    (b>))
 (B>  O=    (b>))
 (B>  O<    (b< b= b>))
 (B>  MI>   (b> m> o>))
 (B>  MI=   (b> m> o>))
 (B>  MI<   (b< b= b> d< m< m= m> o< o= o> s<))
 (B>  M>    (b>))
 (B>  M=    (b>))
 (B>  M<    (b< b= b>))
 (B>  FI>   (b>))
 (B>  F<    (b< b= b> d< m< m= m> o< o= o> s<))
 (B>  EQ=   (b>))
 (B>  DI>   (b>))
 (B>  D<    (b< b= b> d< m< m= m> o< o= o> s<))
 (B>  BI>   (b> bi> di> fi> m> mi> o> oi> si>))
 (B>  BI=   (b> bi> di> fi> m> mi> o> oi> si>))
 (B>  BI<   (b< b= b> bi< bi= bi> d< di> eq= f< fi> m< m= m> mi< mi= mi> o< o= o> oi< oi= oi> s< si>))
 (B>  B>    (b>))
 (B>  B=    (b>))
 (B>  B<    (b< b= b>))
 (B=  SI>   (b>))
 (B=  S<    (b<))
 (B=  OI>   (b> m> o>))
 (B=  OI=   (b= m= o=))
 (B=  OI<   (b< d< m< o< s<))
 (B=  O>    (b>))
 (B=  O=    (b=))
 (B=  O<    (b<))
 (B=  MI>   (b> m> o>))
 (B=  MI=   (b= m= o=))
 (B=  MI<   (b< d< m< o< s<))
 (B=  M>    (b>))
 (B=  M=    (b=))
 (B=  M<    (b<))
 (B=  FI>   (b>))
 (B=  F<    (b< d< m< o< s<))
 (B=  EQ=   (b=))
 (B=  DI>   (b>))
 (B=  D<    (b< d< m< o< s<))
 (B=  BI>   (b> bi> di> fi> m> mi> o> oi> si>))
 (B=  BI=   (b= bi= eq= m= mi= o= oi=))
 (B=  BI<   (b< bi< d< f< m< mi< o< oi< s<))
 (B=  B>    (b>))
 (B=  B=    (b=))
 (B=  B<    (b<))
 (B<  SI>   (b< b= b>))
 (B<  S<    (b<))
 (B<  OI>   (b< b= b> d< m< m= m> o< o= o> s<))
 (B<  OI=   (b< d< m< o< s<))
 (B<  OI<   (b< d< m< o< s<))
 (B<  O>    (b< b= b>))
 (B<  O=    (b<))
 (B<  O<    (b<))
 (B<  MI>   (b< b= b> d< m< m= m> o< o= o> s<))
 (B<  MI=   (b< d< m< o< s<))
 (B<  MI<   (b< d< m< o< s<))
 (B<  M>    (b< b= b>))
 (B<  M=    (b<))
 (B<  M<    (b<))
 (B<  FI>   (b< b= b>))
 (B<  F<    (b< d< m< o< s<))
 (B<  EQ=   (b<))
 (B<  DI>   (b< b= b>))
 (B<  D<    (b< d< m< o< s<))
 (B<  BI>   (b< b= b> bi< bi= bi> d< di> eq= f< fi> m< m= m> mi< mi= mi> o< o= o> oi< oi= oi> s< si>))
 (B<  BI=   (b< bi< d< f< m< mi< o< oi< s<))
 (B<  BI<   (b< bi< d< f< m< mi< o< oi< s<))
 (B<  B>    (b< b= b>))
 (B<  B=    (b<))
 (B<  B<    (b<))
)
  
  :algebraic-specification (;; wild card: patten that applies to all relation:
                            (*  ((1 ((a1 1))) < (1 ((a2 1))))  ; for all relations: A,B are proper non-empty intervals
				((1 ((b1 1))) < (1 ((b2 1))))) ; a1<a2 & b1<b2
                             
                            ;; patterns to handle relative length of intervals <, =, >
			    ;; (1.) length(A) = length(B)
			    ;; patterns for equal length intervals (NB: pattern one for single letter
			    ;; allen relations, pattern two covers two letter allen relations)
			    (?=  ((-1 ((a1 1))) (1 ((a2 1))) = (-1 ((b1 1))) (1 ((b2 1)))))
			    (??= ((-1 ((a1 1))) (1 ((a2 1))) = (-1 ((b1 1))) (1 ((b2 1)))))
                            ;;
			    ;; (2.) length(A) < length(B)
			    (?<  ((-1 ((a1 1))) (1 ((a2 1))) < (-1 ((b1 1))) (1 ((b2 1)))))
			    (??< ((-1 ((a1 1))) (1 ((a2 1))) < (-1 ((b1 1))) (1 ((b2 1)))))
			    ;; 
			    ;; (3.) length(A) > length(B)
			    (?>  ((-1 ((a1 1))) (1 ((a2 1))) > (-1 ((b1 1))) (1 ((b2 1)))))
			    (??> ((-1 ((a1 1))) (1 ((a2 1))) > (-1 ((b1 1))) (1 ((b2 1)))))

			    ;; Allen part of the relation
			    (EQ= ((1 ((a1 1))) = (1 ((b1 1))))
				 ((1 ((a2 1))) = (1 ((b2 1))))) ; equality
			    (b?  ((1 ((a2 1))) < (1 ((b1 1)))))  ; A before B
			    (bi? ((1 ((b2 1))) < (1 ((a1 1))))) ; B before A
			    (d?  ((1 ((a1 1))) > (1 ((b1 1))))   ; A during B
			         ((1 ((a2 1))) < (1 ((b2 1)))))
			    (di? ((1 ((a1 1))) < (1 ((b1 1))))  ; B during A
				 ((1 ((a2 1))) > (1 ((b2 1)))))
			    (o?  ((1 ((a1 1))) < (1 ((b1 1))))   ; A overlaps B
			         ((1 ((a2 1))) > (1 ((b1 1))))
			         ((1 ((a2 1))) < (1 ((b2 1)))))
			    (oi? ((1 ((b1 1))) < (1 ((a1 1))))  ; B overlaps A
				 ((1 ((b2 1))) > (1 ((a1 1))))
				 ((1 ((b2 1))) < (1 ((a2 1)))))
			    (m?  ((1 ((a2 1))) = (1 ((b1 1)))))  ; A meets B
			    (mi? ((1 ((b2 1))) = (1 ((a1 1))))) ; B meets A			    
			    (s?  ((1 ((a1 1))) = (1 ((b1 1))))   ; A starts B
			         ((1 ((a2 1))) < (1 ((b2 1)))))
			    (si? ((1 ((b1 1))) = (1 ((a1 1))))  ; B starts A
				 ((1 ((b2 1))) < (1 ((a2 1)))))
			    (f?  ((1 ((a1 1))) > (1 ((b1 1))))   ; A finishes B
			         ((1 ((a2 1))) = (1 ((b2 1)))))
			    (fi? ((1 ((b1 1))) > (1 ((a1 1))))  ; B finishes A
				 ((1 ((b2 1))) = (1 ((a2 1))))))

  ;; qualifier not really needed since we have the algebraic specification
  :qualifier #'(lambda (p1 p2)
		 (let ((s1 (first p1))
		       (e1 (second p1))
		       (s2 (first p2))
		       (e2 (second p2)))
		   (let ((allen-rel (cond ((< s1 s2) (cond ((< e1 s2) 'B)
							   ((= e1 s2) 'M)
							   (t (cond ((< e1 e2) 'O)
								    ((= e1 e2) 'FI)
								    (t 'DI)))))
					  ((= s1 s2) (cond ((< e1 e2) 'S)
							   ((= e1 e2) 'EQ)
							   (t 'SI)))
					  (t (cond ((< e2 s1) 'BI)
						   ((= e2 s1) 'MI)
						   (t (cond ((< e2 e1) 'OI)
							    ((= e2 e1) 'F)
							    (t 'D)))))))
			 (dif (- (- e1 s1) (- e2 s2))))
		     (intern (format nil "~a~a" 
				     allen-rel
				     (cond ((< 0 dif) '>)
					   ((> 0 dif) '<)
					   (t '=)))))))

)


