dwolter_SparQ/Calculi/single-cross.lisp
;;; 
;;; Double cross calculus
;;;

(def-calculus "Single Cross Calculus (SCC)"
  :arity :ternary
  :parametric? nil
  :basis-entity :2d-point
  :qualifier (external-lib "libscc.dylib" "scc_qualify")
  :identity-relation b
  :inverse-operation (( 0 4 )
                      ( 7 3 )
                      ( 6 3 )
                      ( 5 3 2 1 )
                      ( 4 0 )
                      ( 3 7 6 5 )
                      ( 2 5 )
                      ( 1 5 )
		      ( b 4 )
                      ( Dou Dou )
                      ( Tri Tri ))
  
  :shortcut-operation (( 0 4 )
                       ( 7 3 )
                       ( 6 3 )
                       ( 5 3 2 1 )
                       ( 4 4 0 Dou )
                       ( 3 5 6 7 )
                       ( 2 5 )
                       ( 1 5 )
                       ( b b )
                       ( Dou 4 )
                       ( Tri Tri ))
  
  :homing-operation (( 0 4 )
                     ( 7 5 )
                     ( 6 5 )
                     ( 5 (5 6 7))		    
                     ( 4 (0 b 4))
                     ( 3 (1 2 3))
                     ( 2 3 )
                     ( 1 3 )
                     ( b Dou )
                     ( Dou 4 )
                     ( Tri Tri ))
  
  :base-relations ( 0 7 6 5 4 3 2 1 b Dou Tri )  
  
  :composition-operation (( 0 0 ( 0 ))
			  ( 0 1 ( 1 ))
			  ( 0 2 ( 1 ))
			  ( 0 3 ( 1 2 3 ))
			  ( 0 4 ( 0 4 b ))
			  ( 0 5 ( 5 6 7 ))
			  ( 0 6 ( 7 ))
			  ( 0 7 ( 7 ))
			  ( 0 b ( 0 ))
			  ( 0 Dou (  ))
			  ( 0 Tri (  ))

			  ( 1 0 ( 1 ))
			  ( 1 1 ( 1 2 3 ))
			  ( 1 2 ( 1 2 3 ))
			  ( 1 3 ( 1 2 3 ))
			  ( 1 4 ( 1 5 b ))
			  ( 1 5 ( 0 1 5 6 7 ))
			  ( 1 6 ( 0 1 7 ))
			  ( 1 7 ( 0 1 7 ))
			  ( 1 b ( 1 ))
			  ( 1 Dou (  ))
			  ( 1 Tri (  ))

			  ( 2 0 ( 2 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1 ))
			  ( 7 2 ( 7 0 1 ))
			  ( 7 3 ( 7 0 1 2 3 ))
			  ( 7 4 ( 7 3 b ))
			  ( 7 5 ( 3 4 5 6 7 ))
			  ( 7 6 ( 5 6 7 ))
			  ( 7 7 ( 5 6 7 ))
			  ( 7 b ( 7 ))
			  ( 7 Dou (  ))
			  ( 7 Tri (  ))

			  ( b 0 ( ))
			  ( b 1 ( ))
			  ( b 2 ( ))
			  ( b 3 ( ))
			  ( b 4 ( ))
			  ( b 5 ( ))
			  ( b 6 ( ))
			  ( b 7 ( ))
			  ( b b ( ))
			  ( b Dou ( Dou ))
			  ( b Tri ( Tri ))

			  ( Dou 0 ( Dou ))
			  ( Dou 1 ( Dou ))
			  ( Dou 2 ( Dou ))
			  ( Dou 3 ( Dou ))
			  ( Dou 4 ( Dou ))
			  ( Dou 5 ( Dou ))
			  ( Dou 6 ( Dou ))
			  ( Dou 7 ( Dou ))
			  ( Dou b ( Dou ))
			  ( Dou Dou ( ))
			  ( Dou Tri ( ))


			  ( Tri 0 ( ))
			  ( Tri 1 ( ))
			  ( Tri 2 ( ))
			  ( Tri 3 ( ))
			  ( Tri 4 ( ))
			  ( Tri 5 ( ))
			  ( Tri 6 ( ))
			  ( Tri 7 ( ))
			  ( Tri b ( ))
			  ( Tri Dou ( Dou ))
                          ( Tri Tri ( Tri )))
)
