 		    (format
 		     "(let ((TypeObligations::generateTerminationConditions? nil)
                             (TypeObligations::generateExhaustivityConditions? t)
+                            (Simplify::simplifyUsingSubtypes? t)
                             (Prover::treatNatSpecially? nil))
                         (IsaTermPrinter::printUIDtoThyFile-2 %S %s))"
 		     filename

		    (format
		     "(let ((TypeObligations::generateTerminationConditions? nil)
                            (TypeObligations::generateExhaustivityConditions? t)
                            (Prover::treatNatSpecially? nil))
                        (IsaTermPrinter::deleteThyFilesForUID %S)
                        (IsaTermPrinter::printUIDtoThyFile-2 %S t))"


;;; Haskell generation
(defun sw:convert-top-spec-to-haskell (non-recursive?)
    "Generates Haskell code for spec assuming spec is top-level.
With an argument, it doesn't convert imports."
  (interactive "P")
  (sw:convert-spec-to-haskell non-recursive? t))

(defun sw:convert-spec-to-haskell (non-recursive? &optional slicing?)
  "Generates Haskell code for spec.
With an argument, it doesn't convert imports."
  (interactive "P")
  (save-buffer)
