#lang typed-scheme
(define-type-alias Dictionary (Symbol -> Number))
(define-type-alias Machine (Listof Number))
(define-type-alias Operand (U Nothing (Dictionary -> Number)))
(define-struct: Bitfield ([sign : Number] [width : Number] [value : Number]))
(define-struct: I:addwf ([f : Operand] [d : Operand] [a : Operand]))
(define-struct: Nothing ())
(define nothing (make-Nothing))
'(: A:addwf (I:addwf -> Bitfield))
(: D:addwf (Bitfield -> I:addwf))
(: E:addwf (I:addwf -> (Machine -> Machine)))
(define bf make-Bitfield)
'(define (A:addwf b)
(append-bitfield
(bf -1 1 0)
(bf -1 1 0)
(bf -1 1 0)))
(define (D:addwf b) (make-I:addwf nothing nothing nothing))
(define ((E:addwf i) machine) machine)