Hello fellow forum members,
I am struggling to understand what I am supposed to be doing with ACL2.
So I am given these axioms that define a function called up, and I just need to translate these into ACL2.
-- axioms for predicate for increasing lists of numbers
(up nil) = T {up0}
(up (cons x nil)) = T {up1}
(up (cons x1 (cons x2 xs))) = (and (<= x1 x2) (up (cons x2 xs))) {up2}
Here is what I have... but it does not work.
(defun problem1up (xs)
(if (> (len xs) 1)
(problem1up (cons (first xs) (cons (second xs) xs)))
(if (> (len xs) 0)
(problem1up (cons (first xs) nil))
(problem1up nil))))
Any help would be definitely appreciated. I just need a kick in the right direction.
Thank you :)