Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Queue-Definition/ACL2/queue-definition.acl2
Normal file
14
Task/Queue-Definition/ACL2/queue-definition.acl2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
(defun enqueue (x xs)
|
||||
(cons x xs))
|
||||
|
||||
(defun dequeue (xs)
|
||||
(declare (xargs :guard (and (consp xs)
|
||||
(true-listp xs))))
|
||||
(if (or (endp xs) (endp (rest xs)))
|
||||
(mv (first xs) nil)
|
||||
(mv-let (x ys)
|
||||
(dequeue (rest xs))
|
||||
(mv x (cons (first xs) ys)))))
|
||||
|
||||
(defun empty (xs)
|
||||
(endp xs))
|
||||
Loading…
Add table
Add a link
Reference in a new issue