haskell-te: 4a11ddf8b58f5a1300f33822bd947088f82d0636

     1: ; Natural numbers
     2: (declare-datatypes () ((Nat (Z) (S (p Nat)))))
     3: 
     4: ; Functions equivalent to the constructors
     5: (define-fun constructor-Z () Nat
     6:   (as Z Nat))
     7: 
     8: (define-fun constructor-S ((local-p Nat)) Nat
     9:   (as (S local-p) Nat))
    10: 
    11: ; Functions equivalent to the destructors
    12: (define-fun destructor-p ((local-x Nat)) Nat
    13:   (match local-x
    14:     (case (S local-p) local-p)))
    15: 
    16: ; Arithmetic functions
    17: (define-fun-rec
    18:   plus
    19:     ((x Nat) (y Nat)) Nat
    20:     (match x
    21:       (case  Z      y)
    22:       (case (S x2) (S (plus x2 y)))))
    23:       
    24: (define-fun-rec
    25:   times
    26:     ((x Nat) (y Nat)) Nat
    27:     (match x
    28:       (case  Z      Z)
    29:       (case (S x2) (plus y (times x2 y)))))
    30:       
    31: (define-fun-rec
    32:   exp
    33:     ((x Nat) (y Nat)) Nat
    34:     (match y
    35:       (case  Z     (S Z))
    36:       (case (S y2) (times x (exp x y)))))
    37: 
    38: (check-sat)

Generated by git2html.