CurryInfo: contract-prover-4.0.0 / Curry2SMT.preludeSort2SMT

definition:
 
preludeSort2SMT :: String -> [Command]
preludeSort2SMT sn
 | take 5 sn == "Tuple"
 = let arity = read (drop 5 sn)
       texp2sel i = ("Tuple" ++ show arity ++ "_" ++ show i,
                     SComb ('T' : show i) [])
   in [ Comment $ show arity ++ "-tuple type:"
      , DeclareDatatypes
          [(sn, arity,
            DT (map (\v -> 'T':show v) [1 .. arity])
               [DCons sn (map texp2sel [1 .. arity])])]]
 | sn == "Pair"
 = pairType
 | sn == "Maybe"
 = maybeType
 | sn == "Either"
 = eitherType
 | sn == "Ordering"
 = orderingType
 | sn == "Unit"
 = unitType
 | otherwise
 = []
demand:
 no demanded arguments
deterministic:
 deterministic operation
documentation:
 
Translates a prelude sort (with SMT name) into an SMT datatype declaration,
if necessary.
failfree:
 <FAILING>
indeterministic:
 referentially transparent operation
infix:
 no fixity defined
iotype:
 {(_) |-> {:,[]}}
name:
 preludeSort2SMT
precedence:
 no precedence defined
result-values:
 {:,[]}
signature:
 String -> [ESMT.Command]
solution-complete:
 operation might suspend on free variables
terminating:
 possibly non-terminating
totally-defined:
 possibly non-reducible on same data term