module SdfOrdInstances where

import Sdf
import SdfEqInstances

{- Generated by DrIFT (Automatic class derivations for Haskell) -}
{-# LINE 1 "Sdf.hs" #-}
{-* Generated by DrIFT : Look, but Don't Touch. *-}
instance Ord Grammar where
    compare (Sdf_aliases aa) (Sdf_aliases aa') = compare aa aa'
    compare (Sdf_aliases aa) (Sdf_restrictions aa') = LT
    compare (Sdf_aliases aa) (Sdf_sorts_ aa') = LT
    compare (Sdf_aliases aa) (Sdf_priorities aa') = LT
    compare (Sdf_aliases aa) (Sdf_imp_section aa') = LT
    compare (Sdf_aliases aa) (Sdf_lexical_syntax aa') = LT
    compare (Sdf_aliases aa) (Sdf_context_free_syntax aa') = LT
    compare (Sdf_aliases aa) (Sdf_variables aa') = LT
    compare (Sdf_aliases aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_aliases aa) (Sdf_empty_grammar) = LT
    compare (Sdf_aliases aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_aliases aa) (Sdf_syntax aa') = LT
    compare (Sdf_aliases aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_aliases aa) (Sdf_context_free_priorities aa') = LT
    compare (Sdf_aliases aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_aliases aa) (Sdf_context_free_restrictions aa') = LT
    compare (Sdf_restrictions aa) (Sdf_aliases aa') = GT
    compare (Sdf_restrictions aa) (Sdf_restrictions aa') =
	    compare aa aa'
    compare (Sdf_restrictions aa) (Sdf_sorts_ aa') = LT
    compare (Sdf_restrictions aa) (Sdf_priorities aa') = LT
    compare (Sdf_restrictions aa) (Sdf_imp_section aa') = LT
    compare (Sdf_restrictions aa) (Sdf_lexical_syntax aa') = LT
    compare (Sdf_restrictions aa) (Sdf_context_free_syntax aa') = LT
    compare (Sdf_restrictions aa) (Sdf_variables aa') = LT
    compare (Sdf_restrictions aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_restrictions aa) (Sdf_empty_grammar) = LT
    compare (Sdf_restrictions aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_restrictions aa) (Sdf_syntax aa') = LT
    compare (Sdf_restrictions aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_restrictions aa) (Sdf_context_free_priorities aa') =
	    LT
    compare (Sdf_restrictions aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_restrictions aa) (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_sorts_ aa) (Sdf_aliases aa') = GT
    compare (Sdf_sorts_ aa) (Sdf_restrictions aa') = GT
    compare (Sdf_sorts_ aa) (Sdf_sorts_ aa') = compare aa aa'
    compare (Sdf_sorts_ aa) (Sdf_priorities aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_imp_section aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_lexical_syntax aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_context_free_syntax aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_variables aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_empty_grammar) = LT
    compare (Sdf_sorts_ aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_sorts_ aa) (Sdf_syntax aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_context_free_priorities aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_sorts_ aa) (Sdf_context_free_restrictions aa') = LT
    compare (Sdf_priorities aa) (Sdf_aliases aa') = GT
    compare (Sdf_priorities aa) (Sdf_restrictions aa') = GT
    compare (Sdf_priorities aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_priorities aa) (Sdf_priorities aa') = compare aa aa'
    compare (Sdf_priorities aa) (Sdf_imp_section aa') = LT
    compare (Sdf_priorities aa) (Sdf_lexical_syntax aa') = LT
    compare (Sdf_priorities aa) (Sdf_context_free_syntax aa') = LT
    compare (Sdf_priorities aa) (Sdf_variables aa') = LT
    compare (Sdf_priorities aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_priorities aa) (Sdf_empty_grammar) = LT
    compare (Sdf_priorities aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_priorities aa) (Sdf_syntax aa') = LT
    compare (Sdf_priorities aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_priorities aa) (Sdf_context_free_priorities aa') = LT
    compare (Sdf_priorities aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_priorities aa) (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_imp_section aa) (Sdf_aliases aa') = GT
    compare (Sdf_imp_section aa) (Sdf_restrictions aa') = GT
    compare (Sdf_imp_section aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_imp_section aa) (Sdf_priorities aa') = GT
    compare (Sdf_imp_section aa) (Sdf_imp_section aa') = compare aa aa'
    compare (Sdf_imp_section aa) (Sdf_lexical_syntax aa') = LT
    compare (Sdf_imp_section aa) (Sdf_context_free_syntax aa') = LT
    compare (Sdf_imp_section aa) (Sdf_variables aa') = LT
    compare (Sdf_imp_section aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_imp_section aa) (Sdf_empty_grammar) = LT
    compare (Sdf_imp_section aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_imp_section aa) (Sdf_syntax aa') = LT
    compare (Sdf_imp_section aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_imp_section aa) (Sdf_context_free_priorities aa') = LT
    compare (Sdf_imp_section aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_imp_section aa) (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_lexical_syntax aa) (Sdf_aliases aa') = GT
    compare (Sdf_lexical_syntax aa) (Sdf_restrictions aa') = GT
    compare (Sdf_lexical_syntax aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_lexical_syntax aa) (Sdf_priorities aa') = GT
    compare (Sdf_lexical_syntax aa) (Sdf_imp_section aa') = GT
    compare (Sdf_lexical_syntax aa) (Sdf_lexical_syntax aa') =
	    compare aa aa'
    compare (Sdf_lexical_syntax aa) (Sdf_context_free_syntax aa') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_variables aa') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_empty_grammar) = LT
    compare (Sdf_lexical_syntax aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_syntax aa') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_context_free_priorities aa') =
	    LT
    compare (Sdf_lexical_syntax aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_lexical_syntax aa) (Sdf_context_free_restrictions aa')
	    =
	    LT
    compare (Sdf_context_free_syntax aa) (Sdf_aliases aa') = GT
    compare (Sdf_context_free_syntax aa) (Sdf_restrictions aa') = GT
    compare (Sdf_context_free_syntax aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_context_free_syntax aa) (Sdf_priorities aa') = GT
    compare (Sdf_context_free_syntax aa) (Sdf_imp_section aa') = GT
    compare (Sdf_context_free_syntax aa) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_context_free_syntax aa) (Sdf_context_free_syntax aa')
	    =
	    compare aa aa'
    compare (Sdf_context_free_syntax aa) (Sdf_variables aa') = LT
    compare (Sdf_context_free_syntax aa) (Sdf_lexical_variables aa') =
	    LT
    compare (Sdf_context_free_syntax aa) (Sdf_empty_grammar) = LT
    compare (Sdf_context_free_syntax aa) (Sdf_conc_grammars aa' ab') =
	    LT
    compare (Sdf_context_free_syntax aa) (Sdf_syntax aa') = LT
    compare (Sdf_context_free_syntax aa) (Sdf_lexical_priorities aa') =
	    LT
    compare (Sdf_context_free_syntax aa)
	    (Sdf_context_free_priorities aa') =
	    LT
    compare (Sdf_context_free_syntax aa) (Sdf_lexical_restrictions aa')
	    =
	    LT
    compare (Sdf_context_free_syntax aa)
	    (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_variables aa) (Sdf_aliases aa') = GT
    compare (Sdf_variables aa) (Sdf_restrictions aa') = GT
    compare (Sdf_variables aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_variables aa) (Sdf_priorities aa') = GT
    compare (Sdf_variables aa) (Sdf_imp_section aa') = GT
    compare (Sdf_variables aa) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_variables aa) (Sdf_context_free_syntax aa') = GT
    compare (Sdf_variables aa) (Sdf_variables aa') = compare aa aa'
    compare (Sdf_variables aa) (Sdf_lexical_variables aa') = LT
    compare (Sdf_variables aa) (Sdf_empty_grammar) = LT
    compare (Sdf_variables aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_variables aa) (Sdf_syntax aa') = LT
    compare (Sdf_variables aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_variables aa) (Sdf_context_free_priorities aa') = LT
    compare (Sdf_variables aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_variables aa) (Sdf_context_free_restrictions aa') = LT
    compare (Sdf_lexical_variables aa) (Sdf_aliases aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_restrictions aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_priorities aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_imp_section aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_context_free_syntax aa') =
	    GT
    compare (Sdf_lexical_variables aa) (Sdf_variables aa') = GT
    compare (Sdf_lexical_variables aa) (Sdf_lexical_variables aa') =
	    compare aa aa'
    compare (Sdf_lexical_variables aa) (Sdf_empty_grammar) = LT
    compare (Sdf_lexical_variables aa) (Sdf_conc_grammars aa' ab') = LT
    compare (Sdf_lexical_variables aa) (Sdf_syntax aa') = LT
    compare (Sdf_lexical_variables aa) (Sdf_lexical_priorities aa') =
	    LT
    compare (Sdf_lexical_variables aa)
	    (Sdf_context_free_priorities aa') =
	    LT
    compare (Sdf_lexical_variables aa) (Sdf_lexical_restrictions aa') =
	    LT
    compare (Sdf_lexical_variables aa)
	    (Sdf_context_free_restrictions aa') =
	    LT
    compare Sdf_empty_grammar (Sdf_aliases aa) = GT
    compare Sdf_empty_grammar (Sdf_restrictions aa) = GT
    compare Sdf_empty_grammar (Sdf_sorts_ aa) = GT
    compare Sdf_empty_grammar (Sdf_priorities aa) = GT
    compare Sdf_empty_grammar (Sdf_imp_section aa) = GT
    compare Sdf_empty_grammar (Sdf_lexical_syntax aa) = GT
    compare Sdf_empty_grammar (Sdf_context_free_syntax aa) = GT
    compare Sdf_empty_grammar (Sdf_variables aa) = GT
    compare Sdf_empty_grammar (Sdf_lexical_variables aa) = GT
    compare Sdf_empty_grammar (Sdf_empty_grammar) = EQ
    compare Sdf_empty_grammar (Sdf_conc_grammars aa ab) = LT
    compare Sdf_empty_grammar (Sdf_syntax aa) = LT
    compare Sdf_empty_grammar (Sdf_lexical_priorities aa) = LT
    compare Sdf_empty_grammar (Sdf_context_free_priorities aa) = LT
    compare Sdf_empty_grammar (Sdf_lexical_restrictions aa) = LT
    compare Sdf_empty_grammar (Sdf_context_free_restrictions aa) = LT
    compare (Sdf_conc_grammars aa ab) (Sdf_aliases aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_restrictions aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_sorts_ aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_priorities aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_imp_section aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_context_free_syntax aa') =
	    GT
    compare (Sdf_conc_grammars aa ab) (Sdf_variables aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_lexical_variables aa') = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_empty_grammar) = GT
    compare (Sdf_conc_grammars aa ab) (Sdf_conc_grammars aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_conc_grammars aa ab) (Sdf_syntax aa') = LT
    compare (Sdf_conc_grammars aa ab) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_conc_grammars aa ab) (Sdf_context_free_priorities aa')
	    =
	    LT
    compare (Sdf_conc_grammars aa ab) (Sdf_lexical_restrictions aa') =
	    LT
    compare (Sdf_conc_grammars aa ab)
	    (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_syntax aa) (Sdf_aliases aa') = GT
    compare (Sdf_syntax aa) (Sdf_restrictions aa') = GT
    compare (Sdf_syntax aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_syntax aa) (Sdf_priorities aa') = GT
    compare (Sdf_syntax aa) (Sdf_imp_section aa') = GT
    compare (Sdf_syntax aa) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_syntax aa) (Sdf_context_free_syntax aa') = GT
    compare (Sdf_syntax aa) (Sdf_variables aa') = GT
    compare (Sdf_syntax aa) (Sdf_lexical_variables aa') = GT
    compare (Sdf_syntax aa) (Sdf_empty_grammar) = GT
    compare (Sdf_syntax aa) (Sdf_conc_grammars aa' ab') = GT
    compare (Sdf_syntax aa) (Sdf_syntax aa') = compare aa aa'
    compare (Sdf_syntax aa) (Sdf_lexical_priorities aa') = LT
    compare (Sdf_syntax aa) (Sdf_context_free_priorities aa') = LT
    compare (Sdf_syntax aa) (Sdf_lexical_restrictions aa') = LT
    compare (Sdf_syntax aa) (Sdf_context_free_restrictions aa') = LT
    compare (Sdf_lexical_priorities aa) (Sdf_aliases aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_restrictions aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_priorities aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_imp_section aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_context_free_syntax aa') =
	    GT
    compare (Sdf_lexical_priorities aa) (Sdf_variables aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_lexical_variables aa') =
	    GT
    compare (Sdf_lexical_priorities aa) (Sdf_empty_grammar) = GT
    compare (Sdf_lexical_priorities aa) (Sdf_conc_grammars aa' ab') =
	    GT
    compare (Sdf_lexical_priorities aa) (Sdf_syntax aa') = GT
    compare (Sdf_lexical_priorities aa) (Sdf_lexical_priorities aa') =
	    compare aa aa'
    compare (Sdf_lexical_priorities aa)
	    (Sdf_context_free_priorities aa') =
	    LT
    compare (Sdf_lexical_priorities aa) (Sdf_lexical_restrictions aa')
	    =
	    LT
    compare (Sdf_lexical_priorities aa)
	    (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_context_free_priorities aa) (Sdf_aliases aa') = GT
    compare (Sdf_context_free_priorities aa) (Sdf_restrictions aa') =
	    GT
    compare (Sdf_context_free_priorities aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_context_free_priorities aa) (Sdf_priorities aa') = GT
    compare (Sdf_context_free_priorities aa) (Sdf_imp_section aa') = GT
    compare (Sdf_context_free_priorities aa) (Sdf_lexical_syntax aa') =
	    GT
    compare (Sdf_context_free_priorities aa)
	    (Sdf_context_free_syntax aa') =
	    GT
    compare (Sdf_context_free_priorities aa) (Sdf_variables aa') = GT
    compare (Sdf_context_free_priorities aa)
	    (Sdf_lexical_variables aa') =
	    GT
    compare (Sdf_context_free_priorities aa) (Sdf_empty_grammar) = GT
    compare (Sdf_context_free_priorities aa)
	    (Sdf_conc_grammars aa' ab') =
	    GT
    compare (Sdf_context_free_priorities aa) (Sdf_syntax aa') = GT
    compare (Sdf_context_free_priorities aa)
	    (Sdf_lexical_priorities aa') =
	    GT
    compare (Sdf_context_free_priorities aa)
	    (Sdf_context_free_priorities aa') =
	    compare aa aa'
    compare (Sdf_context_free_priorities aa)
	    (Sdf_lexical_restrictions aa') =
	    LT
    compare (Sdf_context_free_priorities aa)
	    (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_lexical_restrictions aa) (Sdf_aliases aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_restrictions aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_priorities aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_imp_section aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_lexical_syntax aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_context_free_syntax aa')
	    =
	    GT
    compare (Sdf_lexical_restrictions aa) (Sdf_variables aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_lexical_variables aa') =
	    GT
    compare (Sdf_lexical_restrictions aa) (Sdf_empty_grammar) = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_conc_grammars aa' ab') =
	    GT
    compare (Sdf_lexical_restrictions aa) (Sdf_syntax aa') = GT
    compare (Sdf_lexical_restrictions aa) (Sdf_lexical_priorities aa')
	    =
	    GT
    compare (Sdf_lexical_restrictions aa)
	    (Sdf_context_free_priorities aa') =
	    GT
    compare (Sdf_lexical_restrictions aa)
	    (Sdf_lexical_restrictions aa') =
	    compare aa aa'
    compare (Sdf_lexical_restrictions aa)
	    (Sdf_context_free_restrictions aa') =
	    LT
    compare (Sdf_context_free_restrictions aa) (Sdf_aliases aa') = GT
    compare (Sdf_context_free_restrictions aa) (Sdf_restrictions aa') =
	    GT
    compare (Sdf_context_free_restrictions aa) (Sdf_sorts_ aa') = GT
    compare (Sdf_context_free_restrictions aa) (Sdf_priorities aa') =
	    GT
    compare (Sdf_context_free_restrictions aa) (Sdf_imp_section aa') =
	    GT
    compare (Sdf_context_free_restrictions aa) (Sdf_lexical_syntax aa')
	    =
	    GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_context_free_syntax aa') =
	    GT
    compare (Sdf_context_free_restrictions aa) (Sdf_variables aa') = GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_lexical_variables aa') =
	    GT
    compare (Sdf_context_free_restrictions aa) (Sdf_empty_grammar) = GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_conc_grammars aa' ab') =
	    GT
    compare (Sdf_context_free_restrictions aa) (Sdf_syntax aa') = GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_lexical_priorities aa') =
	    GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_context_free_priorities aa') =
	    GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_lexical_restrictions aa') =
	    GT
    compare (Sdf_context_free_restrictions aa)
	    (Sdf_context_free_restrictions aa') =
	    compare aa aa'

instance Ord Alias where
    compare (Sdf_alias aa ab) (Sdf_alias aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Aliases where
    compare (Sdf_list aa) (Sdf_list aa') = compare aa aa'

instance Ord Lookahead where
    compare (Sdf_char_class aa) (Sdf_char_class aa') = compare aa aa'
    compare (Sdf_char_class aa) (Sdf_seq aa' ab') = LT
    compare (Sdf_seq aa ab) (Sdf_char_class aa') = GT
    compare (Sdf_seq aa ab) (Sdf_seq aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Lookaheads where
    compare (Sdf_single aa) (Sdf_single aa') = compare aa aa'
    compare (Sdf_single aa) (Sdf_alt aa' ab') = LT
    compare (Sdf_single aa) (Sdf_list1 aa') = LT
    compare (Sdf_alt aa ab) (Sdf_single aa') = GT
    compare (Sdf_alt aa ab) (Sdf_alt aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_alt aa ab) (Sdf_list1 aa') = LT
    compare (Sdf_list1 aa) (Sdf_single aa') = GT
    compare (Sdf_list1 aa) (Sdf_alt aa' ab') = GT
    compare (Sdf_list1 aa) (Sdf_list1 aa') = compare aa aa'

instance Ord Restriction where
    compare (Sdf_follow aa ab) (Sdf_follow aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Restrictions where
    compare (Sdf_list2 aa) (Sdf_list2 aa') = compare aa aa'

instance Ord Attribute where
    compare Sdf_reject (Sdf_reject) = EQ
    compare Sdf_reject (Sdf_prefer) = LT
    compare Sdf_reject (Sdf_avoid) = LT
    compare Sdf_reject (Sdf_cons1 aa) = LT
    compare Sdf_reject (Sdf_constructor) = LT
    compare Sdf_reject (Sdf_memo) = LT
    compare Sdf_reject (Sdf_traverse) = LT
    compare Sdf_reject (Sdf_bracket) = LT
    compare Sdf_reject (Sdf_atr aa) = LT
    compare Sdf_reject (Sdf_id aa) = LT
    compare Sdf_prefer (Sdf_reject) = GT
    compare Sdf_prefer (Sdf_prefer) = EQ
    compare Sdf_prefer (Sdf_avoid) = LT
    compare Sdf_prefer (Sdf_cons1 aa) = LT
    compare Sdf_prefer (Sdf_constructor) = LT
    compare Sdf_prefer (Sdf_memo) = LT
    compare Sdf_prefer (Sdf_traverse) = LT
    compare Sdf_prefer (Sdf_bracket) = LT
    compare Sdf_prefer (Sdf_atr aa) = LT
    compare Sdf_prefer (Sdf_id aa) = LT
    compare Sdf_avoid (Sdf_reject) = GT
    compare Sdf_avoid (Sdf_prefer) = GT
    compare Sdf_avoid (Sdf_avoid) = EQ
    compare Sdf_avoid (Sdf_cons1 aa) = LT
    compare Sdf_avoid (Sdf_constructor) = LT
    compare Sdf_avoid (Sdf_memo) = LT
    compare Sdf_avoid (Sdf_traverse) = LT
    compare Sdf_avoid (Sdf_bracket) = LT
    compare Sdf_avoid (Sdf_atr aa) = LT
    compare Sdf_avoid (Sdf_id aa) = LT
    compare (Sdf_cons1 aa) (Sdf_reject) = GT
    compare (Sdf_cons1 aa) (Sdf_prefer) = GT
    compare (Sdf_cons1 aa) (Sdf_avoid) = GT
    compare (Sdf_cons1 aa) (Sdf_cons1 aa') = compare aa aa'
    compare (Sdf_cons1 aa) (Sdf_constructor) = LT
    compare (Sdf_cons1 aa) (Sdf_memo) = LT
    compare (Sdf_cons1 aa) (Sdf_traverse) = LT
    compare (Sdf_cons1 aa) (Sdf_bracket) = LT
    compare (Sdf_cons1 aa) (Sdf_atr aa') = LT
    compare (Sdf_cons1 aa) (Sdf_id aa') = LT
    compare Sdf_constructor (Sdf_reject) = GT
    compare Sdf_constructor (Sdf_prefer) = GT
    compare Sdf_constructor (Sdf_avoid) = GT
    compare Sdf_constructor (Sdf_cons1 aa) = GT
    compare Sdf_constructor (Sdf_constructor) = EQ
    compare Sdf_constructor (Sdf_memo) = LT
    compare Sdf_constructor (Sdf_traverse) = LT
    compare Sdf_constructor (Sdf_bracket) = LT
    compare Sdf_constructor (Sdf_atr aa) = LT
    compare Sdf_constructor (Sdf_id aa) = LT
    compare Sdf_memo (Sdf_reject) = GT
    compare Sdf_memo (Sdf_prefer) = GT
    compare Sdf_memo (Sdf_avoid) = GT
    compare Sdf_memo (Sdf_cons1 aa) = GT
    compare Sdf_memo (Sdf_constructor) = GT
    compare Sdf_memo (Sdf_memo) = EQ
    compare Sdf_memo (Sdf_traverse) = LT
    compare Sdf_memo (Sdf_bracket) = LT
    compare Sdf_memo (Sdf_atr aa) = LT
    compare Sdf_memo (Sdf_id aa) = LT
    compare Sdf_traverse (Sdf_reject) = GT
    compare Sdf_traverse (Sdf_prefer) = GT
    compare Sdf_traverse (Sdf_avoid) = GT
    compare Sdf_traverse (Sdf_cons1 aa) = GT
    compare Sdf_traverse (Sdf_constructor) = GT
    compare Sdf_traverse (Sdf_memo) = GT
    compare Sdf_traverse (Sdf_traverse) = EQ
    compare Sdf_traverse (Sdf_bracket) = LT
    compare Sdf_traverse (Sdf_atr aa) = LT
    compare Sdf_traverse (Sdf_id aa) = LT
    compare Sdf_bracket (Sdf_reject) = GT
    compare Sdf_bracket (Sdf_prefer) = GT
    compare Sdf_bracket (Sdf_avoid) = GT
    compare Sdf_bracket (Sdf_cons1 aa) = GT
    compare Sdf_bracket (Sdf_constructor) = GT
    compare Sdf_bracket (Sdf_memo) = GT
    compare Sdf_bracket (Sdf_traverse) = GT
    compare Sdf_bracket (Sdf_bracket) = EQ
    compare Sdf_bracket (Sdf_atr aa) = LT
    compare Sdf_bracket (Sdf_id aa) = LT
    compare (Sdf_atr aa) (Sdf_reject) = GT
    compare (Sdf_atr aa) (Sdf_prefer) = GT
    compare (Sdf_atr aa) (Sdf_avoid) = GT
    compare (Sdf_atr aa) (Sdf_cons1 aa') = GT
    compare (Sdf_atr aa) (Sdf_constructor) = GT
    compare (Sdf_atr aa) (Sdf_memo) = GT
    compare (Sdf_atr aa) (Sdf_traverse) = GT
    compare (Sdf_atr aa) (Sdf_bracket) = GT
    compare (Sdf_atr aa) (Sdf_atr aa') = compare aa aa'
    compare (Sdf_atr aa) (Sdf_id aa') = LT
    compare (Sdf_id aa) (Sdf_reject) = GT
    compare (Sdf_id aa) (Sdf_prefer) = GT
    compare (Sdf_id aa) (Sdf_avoid) = GT
    compare (Sdf_id aa) (Sdf_cons1 aa') = GT
    compare (Sdf_id aa) (Sdf_constructor) = GT
    compare (Sdf_id aa) (Sdf_memo) = GT
    compare (Sdf_id aa) (Sdf_traverse) = GT
    compare (Sdf_id aa) (Sdf_bracket) = GT
    compare (Sdf_id aa) (Sdf_atr aa') = GT
    compare (Sdf_id aa) (Sdf_id aa') = compare aa aa'

instance Ord OptExp where
    compare (Sdf_present aa) (Sdf_present aa') = compare aa aa'
    compare (Sdf_present aa) (Sdf_absent) = LT
    compare Sdf_absent (Sdf_present aa) = GT
    compare Sdf_absent (Sdf_absent) = EQ

instance Ord RealCon where
    compare (Sdf_real_con aa ab ac) (Sdf_real_con aa' ab' ac') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab',compare ac ac']

instance Ord AFun where
    compare (Sdf_Literal aa) (Sdf_Literal aa') = compare aa aa'

instance Ord ATerm' where
    compare (Sdf_fun aa) (Sdf_fun aa') = compare aa aa'

instance Ord Symbol where
    compare (Sdf_label aa ab) (Sdf_label aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_label aa ab) (Sdf_lit aa') = LT
    compare (Sdf_label aa ab) (Sdf_sort aa') = LT
    compare (Sdf_label aa ab) (Sdf_char_class1 aa') = LT
    compare (Sdf_label aa ab) (Sdf_empty1) = LT
    compare (Sdf_label aa ab) (Sdf_seq1 aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_opt aa') = LT
    compare (Sdf_label aa ab) (Sdf_iter aa') = LT
    compare (Sdf_label aa ab) (Sdf_iter_star aa') = LT
    compare (Sdf_label aa ab) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_label aa ab) (Sdf_set aa') = LT
    compare (Sdf_label aa ab) (Sdf_pair aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_func aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_label aa ab) (Sdf_perm aa') = LT
    compare (Sdf_label aa ab) (Sdf_cf aa') = LT
    compare (Sdf_label aa ab) (Sdf_lex aa') = LT
    compare (Sdf_label aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_label aa ab) (Sdf_layout) = LT
    compare (Sdf_label aa ab) (Sdf_start) = LT
    compare (Sdf_label aa ab) (Sdf_file_start) = LT
    compare (Sdf_lit aa) (Sdf_label aa' ab') = GT
    compare (Sdf_lit aa) (Sdf_lit aa') = compare aa aa'
    compare (Sdf_lit aa) (Sdf_sort aa') = LT
    compare (Sdf_lit aa) (Sdf_char_class1 aa') = LT
    compare (Sdf_lit aa) (Sdf_empty1) = LT
    compare (Sdf_lit aa) (Sdf_seq1 aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_opt aa') = LT
    compare (Sdf_lit aa) (Sdf_iter aa') = LT
    compare (Sdf_lit aa) (Sdf_iter_star aa') = LT
    compare (Sdf_lit aa) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_lit aa) (Sdf_set aa') = LT
    compare (Sdf_lit aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_func aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_lit aa) (Sdf_perm aa') = LT
    compare (Sdf_lit aa) (Sdf_cf aa') = LT
    compare (Sdf_lit aa) (Sdf_lex aa') = LT
    compare (Sdf_lit aa) (Sdf_varsym aa') = LT
    compare (Sdf_lit aa) (Sdf_layout) = LT
    compare (Sdf_lit aa) (Sdf_start) = LT
    compare (Sdf_lit aa) (Sdf_file_start) = LT
    compare (Sdf_sort aa) (Sdf_label aa' ab') = GT
    compare (Sdf_sort aa) (Sdf_lit aa') = GT
    compare (Sdf_sort aa) (Sdf_sort aa') = compare aa aa'
    compare (Sdf_sort aa) (Sdf_char_class1 aa') = LT
    compare (Sdf_sort aa) (Sdf_empty1) = LT
    compare (Sdf_sort aa) (Sdf_seq1 aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_opt aa') = LT
    compare (Sdf_sort aa) (Sdf_iter aa') = LT
    compare (Sdf_sort aa) (Sdf_iter_star aa') = LT
    compare (Sdf_sort aa) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_sort aa) (Sdf_set aa') = LT
    compare (Sdf_sort aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_func aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_sort aa) (Sdf_perm aa') = LT
    compare (Sdf_sort aa) (Sdf_cf aa') = LT
    compare (Sdf_sort aa) (Sdf_lex aa') = LT
    compare (Sdf_sort aa) (Sdf_varsym aa') = LT
    compare (Sdf_sort aa) (Sdf_layout) = LT
    compare (Sdf_sort aa) (Sdf_start) = LT
    compare (Sdf_sort aa) (Sdf_file_start) = LT
    compare (Sdf_char_class1 aa) (Sdf_label aa' ab') = GT
    compare (Sdf_char_class1 aa) (Sdf_lit aa') = GT
    compare (Sdf_char_class1 aa) (Sdf_sort aa') = GT
    compare (Sdf_char_class1 aa) (Sdf_char_class1 aa') = compare aa aa'
    compare (Sdf_char_class1 aa) (Sdf_empty1) = LT
    compare (Sdf_char_class1 aa) (Sdf_seq1 aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_opt aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_iter aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_iter_star aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_char_class1 aa) (Sdf_set aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_func aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_char_class1 aa) (Sdf_perm aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_cf aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_lex aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_varsym aa') = LT
    compare (Sdf_char_class1 aa) (Sdf_layout) = LT
    compare (Sdf_char_class1 aa) (Sdf_start) = LT
    compare (Sdf_char_class1 aa) (Sdf_file_start) = LT
    compare Sdf_empty1 (Sdf_label aa ab) = GT
    compare Sdf_empty1 (Sdf_lit aa) = GT
    compare Sdf_empty1 (Sdf_sort aa) = GT
    compare Sdf_empty1 (Sdf_char_class1 aa) = GT
    compare Sdf_empty1 (Sdf_empty1) = EQ
    compare Sdf_empty1 (Sdf_seq1 aa ab) = LT
    compare Sdf_empty1 (Sdf_opt aa) = LT
    compare Sdf_empty1 (Sdf_iter aa) = LT
    compare Sdf_empty1 (Sdf_iter_star aa) = LT
    compare Sdf_empty1 (Sdf_iter_sep aa ab) = LT
    compare Sdf_empty1 (Sdf_iter_star_sep aa ab) = LT
    compare Sdf_empty1 (Sdf_iter_n aa ab) = LT
    compare Sdf_empty1 (Sdf_iter_sep_n aa ab ac) = LT
    compare Sdf_empty1 (Sdf_set aa) = LT
    compare Sdf_empty1 (Sdf_pair aa ab) = LT
    compare Sdf_empty1 (Sdf_func aa ab) = LT
    compare Sdf_empty1 (Sdf_alt1 aa ab) = LT
    compare Sdf_empty1 (Sdf_perm aa) = LT
    compare Sdf_empty1 (Sdf_cf aa) = LT
    compare Sdf_empty1 (Sdf_lex aa) = LT
    compare Sdf_empty1 (Sdf_varsym aa) = LT
    compare Sdf_empty1 (Sdf_layout) = LT
    compare Sdf_empty1 (Sdf_start) = LT
    compare Sdf_empty1 (Sdf_file_start) = LT
    compare (Sdf_seq1 aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_seq1 aa ab) (Sdf_lit aa') = GT
    compare (Sdf_seq1 aa ab) (Sdf_sort aa') = GT
    compare (Sdf_seq1 aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_seq1 aa ab) (Sdf_empty1) = GT
    compare (Sdf_seq1 aa ab) (Sdf_seq1 aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_seq1 aa ab) (Sdf_opt aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_iter aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_iter_star aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_seq1 aa ab) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_seq1 aa ab) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_seq1 aa ab) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_seq1 aa ab) (Sdf_set aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_pair aa' ab') = LT
    compare (Sdf_seq1 aa ab) (Sdf_func aa' ab') = LT
    compare (Sdf_seq1 aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_seq1 aa ab) (Sdf_perm aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_cf aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_lex aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_seq1 aa ab) (Sdf_layout) = LT
    compare (Sdf_seq1 aa ab) (Sdf_start) = LT
    compare (Sdf_seq1 aa ab) (Sdf_file_start) = LT
    compare (Sdf_opt aa) (Sdf_label aa' ab') = GT
    compare (Sdf_opt aa) (Sdf_lit aa') = GT
    compare (Sdf_opt aa) (Sdf_sort aa') = GT
    compare (Sdf_opt aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_opt aa) (Sdf_empty1) = GT
    compare (Sdf_opt aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_opt aa) (Sdf_opt aa') = compare aa aa'
    compare (Sdf_opt aa) (Sdf_iter aa') = LT
    compare (Sdf_opt aa) (Sdf_iter_star aa') = LT
    compare (Sdf_opt aa) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_opt aa) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_opt aa) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_opt aa) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_opt aa) (Sdf_set aa') = LT
    compare (Sdf_opt aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_opt aa) (Sdf_func aa' ab') = LT
    compare (Sdf_opt aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_opt aa) (Sdf_perm aa') = LT
    compare (Sdf_opt aa) (Sdf_cf aa') = LT
    compare (Sdf_opt aa) (Sdf_lex aa') = LT
    compare (Sdf_opt aa) (Sdf_varsym aa') = LT
    compare (Sdf_opt aa) (Sdf_layout) = LT
    compare (Sdf_opt aa) (Sdf_start) = LT
    compare (Sdf_opt aa) (Sdf_file_start) = LT
    compare (Sdf_iter aa) (Sdf_label aa' ab') = GT
    compare (Sdf_iter aa) (Sdf_lit aa') = GT
    compare (Sdf_iter aa) (Sdf_sort aa') = GT
    compare (Sdf_iter aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_iter aa) (Sdf_empty1) = GT
    compare (Sdf_iter aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_iter aa) (Sdf_opt aa') = GT
    compare (Sdf_iter aa) (Sdf_iter aa') = compare aa aa'
    compare (Sdf_iter aa) (Sdf_iter_star aa') = LT
    compare (Sdf_iter aa) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_iter aa) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_iter aa) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_iter aa) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_iter aa) (Sdf_set aa') = LT
    compare (Sdf_iter aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_iter aa) (Sdf_func aa' ab') = LT
    compare (Sdf_iter aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_iter aa) (Sdf_perm aa') = LT
    compare (Sdf_iter aa) (Sdf_cf aa') = LT
    compare (Sdf_iter aa) (Sdf_lex aa') = LT
    compare (Sdf_iter aa) (Sdf_varsym aa') = LT
    compare (Sdf_iter aa) (Sdf_layout) = LT
    compare (Sdf_iter aa) (Sdf_start) = LT
    compare (Sdf_iter aa) (Sdf_file_start) = LT
    compare (Sdf_iter_star aa) (Sdf_label aa' ab') = GT
    compare (Sdf_iter_star aa) (Sdf_lit aa') = GT
    compare (Sdf_iter_star aa) (Sdf_sort aa') = GT
    compare (Sdf_iter_star aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_iter_star aa) (Sdf_empty1) = GT
    compare (Sdf_iter_star aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_iter_star aa) (Sdf_opt aa') = GT
    compare (Sdf_iter_star aa) (Sdf_iter aa') = GT
    compare (Sdf_iter_star aa) (Sdf_iter_star aa') = compare aa aa'
    compare (Sdf_iter_star aa) (Sdf_iter_sep aa' ab') = LT
    compare (Sdf_iter_star aa) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_iter_star aa) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_iter_star aa) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_iter_star aa) (Sdf_set aa') = LT
    compare (Sdf_iter_star aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_iter_star aa) (Sdf_func aa' ab') = LT
    compare (Sdf_iter_star aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_iter_star aa) (Sdf_perm aa') = LT
    compare (Sdf_iter_star aa) (Sdf_cf aa') = LT
    compare (Sdf_iter_star aa) (Sdf_lex aa') = LT
    compare (Sdf_iter_star aa) (Sdf_varsym aa') = LT
    compare (Sdf_iter_star aa) (Sdf_layout) = LT
    compare (Sdf_iter_star aa) (Sdf_start) = LT
    compare (Sdf_iter_star aa) (Sdf_file_start) = LT
    compare (Sdf_iter_sep aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_lit aa') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_sort aa') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_empty1) = GT
    compare (Sdf_iter_sep aa ab) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_opt aa') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_iter aa') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_iter_star aa') = GT
    compare (Sdf_iter_sep aa ab) (Sdf_iter_sep aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_iter_sep aa ab) (Sdf_iter_star_sep aa' ab') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_set aa') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_pair aa' ab') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_func aa' ab') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_perm aa') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_cf aa') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_lex aa') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_iter_sep aa ab) (Sdf_layout) = LT
    compare (Sdf_iter_sep aa ab) (Sdf_start) = LT
    compare (Sdf_iter_sep aa ab) (Sdf_file_start) = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_lit aa') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_sort aa') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_empty1) = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_opt aa') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_iter aa') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_iter_star aa') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_iter_star_sep aa ab) (Sdf_iter_star_sep aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_iter_star_sep aa ab) (Sdf_iter_n aa' ab') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_set aa') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_pair aa' ab') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_func aa' ab') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_perm aa') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_cf aa') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_lex aa') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_layout) = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_start) = LT
    compare (Sdf_iter_star_sep aa ab) (Sdf_file_start) = LT
    compare (Sdf_iter_n aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_iter_n aa ab) (Sdf_lit aa') = GT
    compare (Sdf_iter_n aa ab) (Sdf_sort aa') = GT
    compare (Sdf_iter_n aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_iter_n aa ab) (Sdf_empty1) = GT
    compare (Sdf_iter_n aa ab) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_iter_n aa ab) (Sdf_opt aa') = GT
    compare (Sdf_iter_n aa ab) (Sdf_iter aa') = GT
    compare (Sdf_iter_n aa ab) (Sdf_iter_star aa') = GT
    compare (Sdf_iter_n aa ab) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_iter_n aa ab) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_iter_n aa ab) (Sdf_iter_n aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_iter_n aa ab) (Sdf_iter_sep_n aa' ab' ac') = LT
    compare (Sdf_iter_n aa ab) (Sdf_set aa') = LT
    compare (Sdf_iter_n aa ab) (Sdf_pair aa' ab') = LT
    compare (Sdf_iter_n aa ab) (Sdf_func aa' ab') = LT
    compare (Sdf_iter_n aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_iter_n aa ab) (Sdf_perm aa') = LT
    compare (Sdf_iter_n aa ab) (Sdf_cf aa') = LT
    compare (Sdf_iter_n aa ab) (Sdf_lex aa') = LT
    compare (Sdf_iter_n aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_iter_n aa ab) (Sdf_layout) = LT
    compare (Sdf_iter_n aa ab) (Sdf_start) = LT
    compare (Sdf_iter_n aa ab) (Sdf_file_start) = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_label aa' ab') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_lit aa') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_sort aa') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_char_class1 aa') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_empty1) = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_opt aa') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_iter aa') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_iter_star aa') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_iter_sep_n aa' ab' ac') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab',compare ac ac']
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_set aa') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_pair aa' ab') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_func aa' ab') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_perm aa') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_cf aa') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_lex aa') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_varsym aa') = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_layout) = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_start) = LT
    compare (Sdf_iter_sep_n aa ab ac) (Sdf_file_start) = LT
    compare (Sdf_set aa) (Sdf_label aa' ab') = GT
    compare (Sdf_set aa) (Sdf_lit aa') = GT
    compare (Sdf_set aa) (Sdf_sort aa') = GT
    compare (Sdf_set aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_set aa) (Sdf_empty1) = GT
    compare (Sdf_set aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_set aa) (Sdf_opt aa') = GT
    compare (Sdf_set aa) (Sdf_iter aa') = GT
    compare (Sdf_set aa) (Sdf_iter_star aa') = GT
    compare (Sdf_set aa) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_set aa) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_set aa) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_set aa) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_set aa) (Sdf_set aa') = compare aa aa'
    compare (Sdf_set aa) (Sdf_pair aa' ab') = LT
    compare (Sdf_set aa) (Sdf_func aa' ab') = LT
    compare (Sdf_set aa) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_set aa) (Sdf_perm aa') = LT
    compare (Sdf_set aa) (Sdf_cf aa') = LT
    compare (Sdf_set aa) (Sdf_lex aa') = LT
    compare (Sdf_set aa) (Sdf_varsym aa') = LT
    compare (Sdf_set aa) (Sdf_layout) = LT
    compare (Sdf_set aa) (Sdf_start) = LT
    compare (Sdf_set aa) (Sdf_file_start) = LT
    compare (Sdf_pair aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_pair aa ab) (Sdf_lit aa') = GT
    compare (Sdf_pair aa ab) (Sdf_sort aa') = GT
    compare (Sdf_pair aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_pair aa ab) (Sdf_empty1) = GT
    compare (Sdf_pair aa ab) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_pair aa ab) (Sdf_opt aa') = GT
    compare (Sdf_pair aa ab) (Sdf_iter aa') = GT
    compare (Sdf_pair aa ab) (Sdf_iter_star aa') = GT
    compare (Sdf_pair aa ab) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_pair aa ab) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_pair aa ab) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_pair aa ab) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_pair aa ab) (Sdf_set aa') = GT
    compare (Sdf_pair aa ab) (Sdf_pair aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_pair aa ab) (Sdf_func aa' ab') = LT
    compare (Sdf_pair aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_pair aa ab) (Sdf_perm aa') = LT
    compare (Sdf_pair aa ab) (Sdf_cf aa') = LT
    compare (Sdf_pair aa ab) (Sdf_lex aa') = LT
    compare (Sdf_pair aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_pair aa ab) (Sdf_layout) = LT
    compare (Sdf_pair aa ab) (Sdf_start) = LT
    compare (Sdf_pair aa ab) (Sdf_file_start) = LT
    compare (Sdf_func aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_func aa ab) (Sdf_lit aa') = GT
    compare (Sdf_func aa ab) (Sdf_sort aa') = GT
    compare (Sdf_func aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_func aa ab) (Sdf_empty1) = GT
    compare (Sdf_func aa ab) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_func aa ab) (Sdf_opt aa') = GT
    compare (Sdf_func aa ab) (Sdf_iter aa') = GT
    compare (Sdf_func aa ab) (Sdf_iter_star aa') = GT
    compare (Sdf_func aa ab) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_func aa ab) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_func aa ab) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_func aa ab) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_func aa ab) (Sdf_set aa') = GT
    compare (Sdf_func aa ab) (Sdf_pair aa' ab') = GT
    compare (Sdf_func aa ab) (Sdf_func aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_func aa ab) (Sdf_alt1 aa' ab') = LT
    compare (Sdf_func aa ab) (Sdf_perm aa') = LT
    compare (Sdf_func aa ab) (Sdf_cf aa') = LT
    compare (Sdf_func aa ab) (Sdf_lex aa') = LT
    compare (Sdf_func aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_func aa ab) (Sdf_layout) = LT
    compare (Sdf_func aa ab) (Sdf_start) = LT
    compare (Sdf_func aa ab) (Sdf_file_start) = LT
    compare (Sdf_alt1 aa ab) (Sdf_label aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_lit aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_sort aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_char_class1 aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_empty1) = GT
    compare (Sdf_alt1 aa ab) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_opt aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_iter aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_iter_star aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_alt1 aa ab) (Sdf_set aa') = GT
    compare (Sdf_alt1 aa ab) (Sdf_pair aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_func aa' ab') = GT
    compare (Sdf_alt1 aa ab) (Sdf_alt1 aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_alt1 aa ab) (Sdf_perm aa') = LT
    compare (Sdf_alt1 aa ab) (Sdf_cf aa') = LT
    compare (Sdf_alt1 aa ab) (Sdf_lex aa') = LT
    compare (Sdf_alt1 aa ab) (Sdf_varsym aa') = LT
    compare (Sdf_alt1 aa ab) (Sdf_layout) = LT
    compare (Sdf_alt1 aa ab) (Sdf_start) = LT
    compare (Sdf_alt1 aa ab) (Sdf_file_start) = LT
    compare (Sdf_perm aa) (Sdf_label aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_lit aa') = GT
    compare (Sdf_perm aa) (Sdf_sort aa') = GT
    compare (Sdf_perm aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_perm aa) (Sdf_empty1) = GT
    compare (Sdf_perm aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_opt aa') = GT
    compare (Sdf_perm aa) (Sdf_iter aa') = GT
    compare (Sdf_perm aa) (Sdf_iter_star aa') = GT
    compare (Sdf_perm aa) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_perm aa) (Sdf_set aa') = GT
    compare (Sdf_perm aa) (Sdf_pair aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_func aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_alt1 aa' ab') = GT
    compare (Sdf_perm aa) (Sdf_perm aa') = compare aa aa'
    compare (Sdf_perm aa) (Sdf_cf aa') = LT
    compare (Sdf_perm aa) (Sdf_lex aa') = LT
    compare (Sdf_perm aa) (Sdf_varsym aa') = LT
    compare (Sdf_perm aa) (Sdf_layout) = LT
    compare (Sdf_perm aa) (Sdf_start) = LT
    compare (Sdf_perm aa) (Sdf_file_start) = LT
    compare (Sdf_cf aa) (Sdf_label aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_lit aa') = GT
    compare (Sdf_cf aa) (Sdf_sort aa') = GT
    compare (Sdf_cf aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_cf aa) (Sdf_empty1) = GT
    compare (Sdf_cf aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_opt aa') = GT
    compare (Sdf_cf aa) (Sdf_iter aa') = GT
    compare (Sdf_cf aa) (Sdf_iter_star aa') = GT
    compare (Sdf_cf aa) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_cf aa) (Sdf_set aa') = GT
    compare (Sdf_cf aa) (Sdf_pair aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_func aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_alt1 aa' ab') = GT
    compare (Sdf_cf aa) (Sdf_perm aa') = GT
    compare (Sdf_cf aa) (Sdf_cf aa') = compare aa aa'
    compare (Sdf_cf aa) (Sdf_lex aa') = LT
    compare (Sdf_cf aa) (Sdf_varsym aa') = LT
    compare (Sdf_cf aa) (Sdf_layout) = LT
    compare (Sdf_cf aa) (Sdf_start) = LT
    compare (Sdf_cf aa) (Sdf_file_start) = LT
    compare (Sdf_lex aa) (Sdf_label aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_lit aa') = GT
    compare (Sdf_lex aa) (Sdf_sort aa') = GT
    compare (Sdf_lex aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_lex aa) (Sdf_empty1) = GT
    compare (Sdf_lex aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_opt aa') = GT
    compare (Sdf_lex aa) (Sdf_iter aa') = GT
    compare (Sdf_lex aa) (Sdf_iter_star aa') = GT
    compare (Sdf_lex aa) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_lex aa) (Sdf_set aa') = GT
    compare (Sdf_lex aa) (Sdf_pair aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_func aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_alt1 aa' ab') = GT
    compare (Sdf_lex aa) (Sdf_perm aa') = GT
    compare (Sdf_lex aa) (Sdf_cf aa') = GT
    compare (Sdf_lex aa) (Sdf_lex aa') = compare aa aa'
    compare (Sdf_lex aa) (Sdf_varsym aa') = LT
    compare (Sdf_lex aa) (Sdf_layout) = LT
    compare (Sdf_lex aa) (Sdf_start) = LT
    compare (Sdf_lex aa) (Sdf_file_start) = LT
    compare (Sdf_varsym aa) (Sdf_label aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_lit aa') = GT
    compare (Sdf_varsym aa) (Sdf_sort aa') = GT
    compare (Sdf_varsym aa) (Sdf_char_class1 aa') = GT
    compare (Sdf_varsym aa) (Sdf_empty1) = GT
    compare (Sdf_varsym aa) (Sdf_seq1 aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_opt aa') = GT
    compare (Sdf_varsym aa) (Sdf_iter aa') = GT
    compare (Sdf_varsym aa) (Sdf_iter_star aa') = GT
    compare (Sdf_varsym aa) (Sdf_iter_sep aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_iter_star_sep aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_iter_n aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_iter_sep_n aa' ab' ac') = GT
    compare (Sdf_varsym aa) (Sdf_set aa') = GT
    compare (Sdf_varsym aa) (Sdf_pair aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_func aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_alt1 aa' ab') = GT
    compare (Sdf_varsym aa) (Sdf_perm aa') = GT
    compare (Sdf_varsym aa) (Sdf_cf aa') = GT
    compare (Sdf_varsym aa) (Sdf_lex aa') = GT
    compare (Sdf_varsym aa) (Sdf_varsym aa') = compare aa aa'
    compare (Sdf_varsym aa) (Sdf_layout) = LT
    compare (Sdf_varsym aa) (Sdf_start) = LT
    compare (Sdf_varsym aa) (Sdf_file_start) = LT
    compare Sdf_layout (Sdf_label aa ab) = GT
    compare Sdf_layout (Sdf_lit aa) = GT
    compare Sdf_layout (Sdf_sort aa) = GT
    compare Sdf_layout (Sdf_char_class1 aa) = GT
    compare Sdf_layout (Sdf_empty1) = GT
    compare Sdf_layout (Sdf_seq1 aa ab) = GT
    compare Sdf_layout (Sdf_opt aa) = GT
    compare Sdf_layout (Sdf_iter aa) = GT
    compare Sdf_layout (Sdf_iter_star aa) = GT
    compare Sdf_layout (Sdf_iter_sep aa ab) = GT
    compare Sdf_layout (Sdf_iter_star_sep aa ab) = GT
    compare Sdf_layout (Sdf_iter_n aa ab) = GT
    compare Sdf_layout (Sdf_iter_sep_n aa ab ac) = GT
    compare Sdf_layout (Sdf_set aa) = GT
    compare Sdf_layout (Sdf_pair aa ab) = GT
    compare Sdf_layout (Sdf_func aa ab) = GT
    compare Sdf_layout (Sdf_alt1 aa ab) = GT
    compare Sdf_layout (Sdf_perm aa) = GT
    compare Sdf_layout (Sdf_cf aa) = GT
    compare Sdf_layout (Sdf_lex aa) = GT
    compare Sdf_layout (Sdf_varsym aa) = GT
    compare Sdf_layout (Sdf_layout) = EQ
    compare Sdf_layout (Sdf_start) = LT
    compare Sdf_layout (Sdf_file_start) = LT
    compare Sdf_start (Sdf_label aa ab) = GT
    compare Sdf_start (Sdf_lit aa) = GT
    compare Sdf_start (Sdf_sort aa) = GT
    compare Sdf_start (Sdf_char_class1 aa) = GT
    compare Sdf_start (Sdf_empty1) = GT
    compare Sdf_start (Sdf_seq1 aa ab) = GT
    compare Sdf_start (Sdf_opt aa) = GT
    compare Sdf_start (Sdf_iter aa) = GT
    compare Sdf_start (Sdf_iter_star aa) = GT
    compare Sdf_start (Sdf_iter_sep aa ab) = GT
    compare Sdf_start (Sdf_iter_star_sep aa ab) = GT
    compare Sdf_start (Sdf_iter_n aa ab) = GT
    compare Sdf_start (Sdf_iter_sep_n aa ab ac) = GT
    compare Sdf_start (Sdf_set aa) = GT
    compare Sdf_start (Sdf_pair aa ab) = GT
    compare Sdf_start (Sdf_func aa ab) = GT
    compare Sdf_start (Sdf_alt1 aa ab) = GT
    compare Sdf_start (Sdf_perm aa) = GT
    compare Sdf_start (Sdf_cf aa) = GT
    compare Sdf_start (Sdf_lex aa) = GT
    compare Sdf_start (Sdf_varsym aa) = GT
    compare Sdf_start (Sdf_layout) = GT
    compare Sdf_start (Sdf_start) = EQ
    compare Sdf_start (Sdf_file_start) = LT
    compare Sdf_file_start (Sdf_label aa ab) = GT
    compare Sdf_file_start (Sdf_lit aa) = GT
    compare Sdf_file_start (Sdf_sort aa) = GT
    compare Sdf_file_start (Sdf_char_class1 aa) = GT
    compare Sdf_file_start (Sdf_empty1) = GT
    compare Sdf_file_start (Sdf_seq1 aa ab) = GT
    compare Sdf_file_start (Sdf_opt aa) = GT
    compare Sdf_file_start (Sdf_iter aa) = GT
    compare Sdf_file_start (Sdf_iter_star aa) = GT
    compare Sdf_file_start (Sdf_iter_sep aa ab) = GT
    compare Sdf_file_start (Sdf_iter_star_sep aa ab) = GT
    compare Sdf_file_start (Sdf_iter_n aa ab) = GT
    compare Sdf_file_start (Sdf_iter_sep_n aa ab ac) = GT
    compare Sdf_file_start (Sdf_set aa) = GT
    compare Sdf_file_start (Sdf_pair aa ab) = GT
    compare Sdf_file_start (Sdf_func aa ab) = GT
    compare Sdf_file_start (Sdf_alt1 aa ab) = GT
    compare Sdf_file_start (Sdf_perm aa) = GT
    compare Sdf_file_start (Sdf_cf aa) = GT
    compare Sdf_file_start (Sdf_lex aa) = GT
    compare Sdf_file_start (Sdf_varsym aa) = GT
    compare Sdf_file_start (Sdf_layout) = GT
    compare Sdf_file_start (Sdf_start) = GT
    compare Sdf_file_start (Sdf_file_start) = EQ

instance Ord Literal where
    compare (Sdf_quoted aa) (Sdf_quoted aa') = compare aa aa'
    compare (Sdf_quoted aa) (Sdf_uqlit aa') = LT
    compare (Sdf_uqlit aa) (Sdf_quoted aa') = GT
    compare (Sdf_uqlit aa) (Sdf_uqlit aa') = compare aa aa'

instance Ord Production where
    compare (Sdf_prod_fun aa ab ac ad) (Sdf_prod_fun aa' ab' ac' ad') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab',compare ac ac',compare ad ad']
    compare (Sdf_prod_fun aa ab ac ad) (Sdf_prod aa' ab' ac') = LT
    compare (Sdf_prod aa ab ac) (Sdf_prod_fun aa' ab' ac' ad') = GT
    compare (Sdf_prod aa ab ac) (Sdf_prod aa' ab' ac') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab',compare ac ac']

instance Ord Character where
    compare (Sdf_numeric aa) (Sdf_numeric aa') = compare aa aa'
    compare (Sdf_numeric aa) (Sdf_short aa') = LT
    compare (Sdf_numeric aa) (Sdf_top) = LT
    compare (Sdf_numeric aa) (Sdf_eof) = LT
    compare (Sdf_numeric aa) (Sdf_bot) = LT
    compare (Sdf_numeric aa) (Sdf_label_start) = LT
    compare (Sdf_short aa) (Sdf_numeric aa') = GT
    compare (Sdf_short aa) (Sdf_short aa') = compare aa aa'
    compare (Sdf_short aa) (Sdf_top) = LT
    compare (Sdf_short aa) (Sdf_eof) = LT
    compare (Sdf_short aa) (Sdf_bot) = LT
    compare (Sdf_short aa) (Sdf_label_start) = LT
    compare Sdf_top (Sdf_numeric aa) = GT
    compare Sdf_top (Sdf_short aa) = GT
    compare Sdf_top (Sdf_top) = EQ
    compare Sdf_top (Sdf_eof) = LT
    compare Sdf_top (Sdf_bot) = LT
    compare Sdf_top (Sdf_label_start) = LT
    compare Sdf_eof (Sdf_numeric aa) = GT
    compare Sdf_eof (Sdf_short aa) = GT
    compare Sdf_eof (Sdf_top) = GT
    compare Sdf_eof (Sdf_eof) = EQ
    compare Sdf_eof (Sdf_bot) = LT
    compare Sdf_eof (Sdf_label_start) = LT
    compare Sdf_bot (Sdf_numeric aa) = GT
    compare Sdf_bot (Sdf_short aa) = GT
    compare Sdf_bot (Sdf_top) = GT
    compare Sdf_bot (Sdf_eof) = GT
    compare Sdf_bot (Sdf_bot) = EQ
    compare Sdf_bot (Sdf_label_start) = LT
    compare Sdf_label_start (Sdf_numeric aa) = GT
    compare Sdf_label_start (Sdf_short aa) = GT
    compare Sdf_label_start (Sdf_top) = GT
    compare Sdf_label_start (Sdf_eof) = GT
    compare Sdf_label_start (Sdf_bot) = GT
    compare Sdf_label_start (Sdf_label_start) = EQ

instance Ord CharRange where
    compare (Sdf_Character aa) (Sdf_Character aa') = compare aa aa'
    compare (Sdf_Character aa) (Sdf_range aa' ab') = LT
    compare (Sdf_range aa ab) (Sdf_Character aa') = GT
    compare (Sdf_range aa ab) (Sdf_range aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord CharRanges where
    compare (Sdf_CharRange aa) (Sdf_CharRange aa') = compare aa aa'
    compare (Sdf_CharRange aa) (Sdf_conc aa' ab') = LT
    compare (Sdf_conc aa ab) (Sdf_CharRange aa') = GT
    compare (Sdf_conc aa ab) (Sdf_conc aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord OptCharRanges where
    compare Sdf_absent1 (Sdf_absent1) = EQ
    compare Sdf_absent1 (Sdf_present1 aa) = LT
    compare (Sdf_present1 aa) (Sdf_absent1) = GT
    compare (Sdf_present1 aa) (Sdf_present1 aa') = compare aa aa'

instance Ord CharClass where
    compare (Sdf_simple_charclass aa) (Sdf_simple_charclass aa') =
	    compare aa aa'
    compare (Sdf_simple_charclass aa) (Sdf_comp aa') = LT
    compare (Sdf_simple_charclass aa) (Sdf_diff aa' ab') = LT
    compare (Sdf_simple_charclass aa) (Sdf_isect aa' ab') = LT
    compare (Sdf_simple_charclass aa) (Sdf_union aa' ab') = LT
    compare (Sdf_comp aa) (Sdf_simple_charclass aa') = GT
    compare (Sdf_comp aa) (Sdf_comp aa') = compare aa aa'
    compare (Sdf_comp aa) (Sdf_diff aa' ab') = LT
    compare (Sdf_comp aa) (Sdf_isect aa' ab') = LT
    compare (Sdf_comp aa) (Sdf_union aa' ab') = LT
    compare (Sdf_diff aa ab) (Sdf_simple_charclass aa') = GT
    compare (Sdf_diff aa ab) (Sdf_comp aa') = GT
    compare (Sdf_diff aa ab) (Sdf_diff aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_diff aa ab) (Sdf_isect aa' ab') = LT
    compare (Sdf_diff aa ab) (Sdf_union aa' ab') = LT
    compare (Sdf_isect aa ab) (Sdf_simple_charclass aa') = GT
    compare (Sdf_isect aa ab) (Sdf_comp aa') = GT
    compare (Sdf_isect aa ab) (Sdf_diff aa' ab') = GT
    compare (Sdf_isect aa ab) (Sdf_isect aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_isect aa ab) (Sdf_union aa' ab') = LT
    compare (Sdf_union aa ab) (Sdf_simple_charclass aa') = GT
    compare (Sdf_union aa ab) (Sdf_comp aa') = GT
    compare (Sdf_union aa ab) (Sdf_diff aa' ab') = GT
    compare (Sdf_union aa ab) (Sdf_isect aa' ab') = GT
    compare (Sdf_union aa ab) (Sdf_union aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Associativity where
    compare Sdf_left (Sdf_left) = EQ
    compare Sdf_left (Sdf_right) = LT
    compare Sdf_left (Sdf_non_assoc) = LT
    compare Sdf_left (Sdf_assoc) = LT
    compare Sdf_right (Sdf_left) = GT
    compare Sdf_right (Sdf_right) = EQ
    compare Sdf_right (Sdf_non_assoc) = LT
    compare Sdf_right (Sdf_assoc) = LT
    compare Sdf_non_assoc (Sdf_left) = GT
    compare Sdf_non_assoc (Sdf_right) = GT
    compare Sdf_non_assoc (Sdf_non_assoc) = EQ
    compare Sdf_non_assoc (Sdf_assoc) = LT
    compare Sdf_assoc (Sdf_left) = GT
    compare Sdf_assoc (Sdf_right) = GT
    compare Sdf_assoc (Sdf_non_assoc) = GT
    compare Sdf_assoc (Sdf_assoc) = EQ

instance Ord Group where
    compare (Sdf_simple_group aa) (Sdf_simple_group aa') =
	    compare aa aa'
    compare (Sdf_simple_group aa) (Sdf_prods_group aa') = LT
    compare (Sdf_simple_group aa) (Sdf_assoc_group aa' ab') = LT
    compare (Sdf_prods_group aa) (Sdf_simple_group aa') = GT
    compare (Sdf_prods_group aa) (Sdf_prods_group aa') = compare aa aa'
    compare (Sdf_prods_group aa) (Sdf_assoc_group aa' ab') = LT
    compare (Sdf_assoc_group aa ab) (Sdf_simple_group aa') = GT
    compare (Sdf_assoc_group aa ab) (Sdf_prods_group aa') = GT
    compare (Sdf_assoc_group aa ab) (Sdf_assoc_group aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Priority where
    compare (Sdf_chain aa) (Sdf_chain aa') = compare aa aa'
    compare (Sdf_chain aa) (Sdf_assoc1 aa' ab' ac') = LT
    compare (Sdf_assoc1 aa ab ac) (Sdf_chain aa') = GT
    compare (Sdf_assoc1 aa ab ac) (Sdf_assoc1 aa' ab' ac') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab',compare ac ac']

instance Ord Priorities where
    compare (Sdf_comma aa) (Sdf_comma aa') = compare aa aa'

instance Ord IntCon where
    compare (Sdf_natural aa) (Sdf_natural aa') = compare aa aa'
    compare (Sdf_natural aa) (Sdf_positive aa') = LT
    compare (Sdf_natural aa) (Sdf_negative aa') = LT
    compare (Sdf_positive aa) (Sdf_natural aa') = GT
    compare (Sdf_positive aa) (Sdf_positive aa') = compare aa aa'
    compare (Sdf_positive aa) (Sdf_negative aa') = LT
    compare (Sdf_negative aa) (Sdf_natural aa') = GT
    compare (Sdf_negative aa) (Sdf_positive aa') = GT
    compare (Sdf_negative aa) (Sdf_negative aa') = compare aa aa'

instance Ord Renamings where
    compare (Sdf_renamings aa) (Sdf_renamings aa') = compare aa aa'

instance Ord Renaming where
    compare (Sdf_symbol aa ab) (Sdf_symbol aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']
    compare (Sdf_symbol aa ab) (Sdf_production aa' ab') = LT
    compare (Sdf_production aa ab) (Sdf_symbol aa' ab') = GT
    compare (Sdf_production aa ab) (Sdf_production aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Definition where
    compare (Sdf_list4 aa) (Sdf_list4 aa') = compare aa aa'

instance Ord Module where
    compare (Sdf_module_ aa ab ac) (Sdf_module_ aa' ab' ac') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab',compare ac ac']

instance Ord Section where
    compare (Sdf_exports_ aa) (Sdf_exports_ aa') = compare aa aa'
    compare (Sdf_exports_ aa) (Sdf_hiddens aa') = LT
    compare (Sdf_hiddens aa) (Sdf_exports_ aa') = GT
    compare (Sdf_hiddens aa) (Sdf_hiddens aa') = compare aa aa'

instance Ord Sections where
    compare (Sdf_list5 aa) (Sdf_list5 aa') = compare aa aa'

instance Ord ModuleName where
    compare (Sdf_unparameterized aa) (Sdf_unparameterized aa') =
	    compare aa aa'
    compare (Sdf_unparameterized aa) (Sdf_parameterized aa' ab') = LT
    compare (Sdf_parameterized aa ab) (Sdf_unparameterized aa') = GT
    compare (Sdf_parameterized aa ab) (Sdf_parameterized aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord ImpSection where
    compare (Sdf_imports_ aa) (Sdf_imports_ aa') = compare aa aa'

instance Ord Imports where
    compare (Sdf_list6 aa) (Sdf_list6 aa') = compare aa aa'

instance Ord Import where
    compare (Sdf_module1 aa) (Sdf_module1 aa') = compare aa aa'
    compare (Sdf_module1 aa) (Sdf_renamed_module aa' ab') = LT
    compare (Sdf_renamed_module aa ab) (Sdf_module1 aa') = GT
    compare (Sdf_renamed_module aa ab) (Sdf_renamed_module aa' ab') =
	    foldl (\x y -> if x == EQ then compare y EQ else y) EQ
	    [compare aa aa',compare ab ab']

instance Ord Symbols where
    compare (Sdf_list7 aa) (Sdf_list7 aa') = compare aa aa'

instance Ord Attributes where
    compare (Sdf_attrs aa) (Sdf_attrs aa') = compare aa aa'
    compare (Sdf_attrs aa) (Sdf_no_attrs) = LT
    compare Sdf_no_attrs (Sdf_attrs aa) = GT
    compare Sdf_no_attrs (Sdf_no_attrs) = EQ

instance Ord Productions where
    compare (Sdf_list8 aa) (Sdf_list8 aa') = compare aa aa'

instance Ord SDF where
    compare (Sdf_definition aa) (Sdf_definition aa') = compare aa aa'

--  Imported from other files :-
