Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Arithmetic-Integer/ACL2/arithmetic-integer.acl2
Normal file
20
Task/Arithmetic-Integer/ACL2/arithmetic-integer.acl2
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
:set-state-ok t
|
||||
|
||||
(defun get-two-nums (state)
|
||||
(mv-let (_ a state)
|
||||
(read-object *standard-oi* state)
|
||||
(declare (ignore _))
|
||||
(mv-let (_ b state)
|
||||
(read-object *standard-oi* state)
|
||||
(declare (ignore _))
|
||||
(mv a b state))))
|
||||
|
||||
(defun integer-arithmetic (state)
|
||||
(mv-let (a b state)
|
||||
(get-two-nums state)
|
||||
(mv state
|
||||
(progn$ (cw "Sum: ~x0~%" (+ a b))
|
||||
(cw "Difference: ~x0~%" (- a b))
|
||||
(cw "Product: ~x0~%" (* a b))
|
||||
(cw "Quotient: ~x0~%" (floor a b))
|
||||
(cw "Remainder: ~x0~%" (mod a b))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue