(include-book "m1-story") (in-package "M1") (defmacro trans (x) `(acl2::trans ,x)) (defmacro trans1 (x) `(acl2::trans1 ,x)) (defmacro pe (x) `(acl2::pe ,x)) (defmacro ubt! (x) `(acl2::ubt! ,x)) ; --- start here --- (cadr '(a b c)) (defmacro cadr (x) (list 'car (list 'cdr x))) (cadr '(a b c)) (trans1 '(cadr (append a b))) (defmacro pushy (x) (list 'push x 'y)) (trans1 '(pushy (car temp))) (defun foo (temp y) (pushy (car temp))) (foo '(a b c) '(u v w)) (defmacro conditional (&rest args) (if (endp args) nil (list 'if (car (car args)) (car (cdr (car args))) (cons 'conditional (cdr args))))) (trans1 '(conditional (a b) (c d) (e f))) (trans '(conditional (a b) (c d) (e f))) (suppliedp :key1 '(:key0 val0 :key1 val1 :key2 val2)) (actual :key1 '(:key0 val0 :key1 val1 :key2 val2)) (actual 'c '(a b c d e f)) (actual 'b '(a b c d e f)) (pe 'modify) (pe 'execute-iload) (trans1 '(modify s :stack (push (nth (arg1 inst) (locals s)) (stack s)))) (pe 'execute-istore) (trans1 '(modify s :stack (pop (stack s)) :locals (update-nth (arg1 inst) (top (stack s)) (locals s)))) (pe 'execute-ifle) (trans1 '(modify s :pc (if (<= (top (stack s)) 0) (+ (arg1 inst) (pc s)) (+ 1 (pc s))) :stack (pop (stack s)))) (trans1 '(defsem (ILOAD k) (modify s :stack (push (nth k -locals-) -stack-)))) (trans1 '(SEMANTICS (ILOAD K) (MODIFY S :STACK (PUSH (NTH K -LOCALS-) -STACK-)))) (quote (explore "new-m1.lisp"))