-- ^ Thing is established as the TopSort of all sorts
-- ^ defined in the CASL_DL spec, a predefined signature
-- ^ is added
trSign :: DLSign -> CASLSign
trSign inSig =
    let
        inC = projectToCASL inSig `uniteCASLSign` predefSign
        inSorts  = sortSet inSig
        inData   = sortSet predefSign
    in
      inC
      {
        sortRel = Rel.insertKey thing
          $ Rel.insertKey dataS
          $ Set.fold (`Rel.insertDiffPair` dataS)
                  (Set.fold (`Rel.insertDiffPair` thing)
                   (sortRel inC) inSorts)
          $ Set.delete dataS inData
      }
trSign :: DLSign -> CASLSign
trSign inSig =
    let
        inC = projectToCASL inSig `uniteCASLSign` predefSign
        inSorts  = sortSet inSig
        inData   = sortSet predefSign
    in
      inC
      {
        sortRel = Rel.insertKey thing
          $ Rel.insertKey dataS
          $ Set.fold (`Rel.insertDiffPair` dataS)
                  (Set.fold (`Rel.insertDiffPair` thing)
                   (sortRel inC) inSorts)
          $ Set.delete dataS inData
      }
trSign inSig =
    let
        inC = projectToCASL inSig `uniteCASLSign` predefSign
        inSorts  = sortSet inSig
        inData   = sortSet predefSign
    in
      inC
      {
        sortRel = Rel.insertKey thing
          $ Rel.insertKey dataS
          $ Set.fold (`Rel.insertDiffPair` dataS)
                  (Set.fold (`Rel.insertDiffPair` thing)
                   (sortRel inC) inSorts)
          $ Set.delete dataS inData
      }