Questions tagged [acl2]

An automated theorem prover -- software system consisting of a programming language, an extensible theory in a first-order logic, and a mechanical theorem prover. The input language and implementation of ACL2 are built on Common Lisp.

ACL2 is both a programming language in which you can model computer systems and a tool to help you prove properties of those models.

Main website: ACL2

38 questions
3
votes
1 answer

How do I trace the ACL2 rewriter?

How do I trace the ACL2 rewriter? I would really like to know what's going on inside the prover. Is it advisable to seek out this type of information or should I just follow The Method?
interestedparty333
  • 2,386
  • 1
  • 21
  • 35
3
votes
1 answer

How do I avoid a crash into the low-level debugger when compiling ACL2 on SBCL?

How do I avoid a crash into the low-level debugger when compiling ACL2 on SBCL? Here is the error message I receive when compiling using SBCL 1.2.3 on Linux: ACL2 loading '((COMP-FN :EXEC NIL "1" STATE)). NIL Finished loading '((COMP-FN…
interestedparty333
  • 2,386
  • 1
  • 21
  • 35
3
votes
4 answers

Wheres-waldo function in LISP

I am trying to solve problems on LISP and I am stuck with this problem for many days. "Write a function, called wheres-waldo, that takes a lisp object (i.e., a data structure built from conses) as argument and returns a Lisp expression that…
Jason
  • 33
  • 4
2
votes
0 answers

ACL2 Decision Tree fails to execute the recursive call

For this problem, I'm assigned to implement a function that decides the output of a decision tree given the data. The logic: If it's a symbol, then that's the value to output otherwise, lookup the value of varname in the memory, and if it's less…
GokRix
  • 65
  • 1
  • 11
2
votes
3 answers

How to loop using recursion in ACL2?

I need to make something like this but in ACL2: for (i=1; i<10; i++) { print i; } It uses COMMON LISP, but I haven't any idea how to do this task... We can't use standard Common Lisp constructions such as LOOP, DO. Just recursion. I have some…
toxaus
  • 23
  • 4
2
votes
1 answer

Simple numeric theorem not accepted by ACL2

ACL2 doesn't prove the following theorem: (defthm thm-0 (implies (and (integerp n) (oddp n) (>= n 1)) (oddp (* n n)))) My guess is that an induction scheme that steps by two over the odd numbers should be…
Attila Karoly
  • 951
  • 5
  • 13
2
votes
0 answers

How do you expand an pure ACL2 script into a fully-fledged program

I see a lot of resources about how to use ACL2 to prove code, as you would expect, but none on how to use your proved code in production. Do I tweak my ACL2 code to work with CLISP/Scheme/Clojure? Can ACL2 run my code too? (where are the tutorials,…
0atman
  • 3,298
  • 4
  • 30
  • 46
2
votes
0 answers

Running and testing a property expressing a relationship between TAKE and APPEND

Basically, I need to write a what the title says, the only relationship I have been able to think of is if I take some number of elements from a list with TAKE and then take the not-as-important other half with CDR and then APPEND the two that I…
Ren
  • 4,594
  • 9
  • 33
  • 61
1
vote
2 answers

Proofpad program to determine whether a binary tree is a valid search tree

I am doing an assignment for my class on ProofPad which is a web-based IDE for ACL2. I have already been given two functions: ;;; BEGIN boilerplate code -- ignore :-) (in-package "ACL2") (include-book "testing" :dir :teachpacks) (include-book…
1
vote
1 answer

ACL2 how to keep part of a list?

So I am still relatively new to acl2 and lisp, I do not know of a way to do this in lisp. How can i go about achieving my comment?(cons a...) I keep thinking iterator, but i have been told ACL2 only uses recursion (defun keep-at-most-n-bits (l n) …
1
vote
1 answer

Adding Reciprocals in ACL2

I am very new to ACL2 so I understand that some of you may feel this is such a simple solution that you would frown upon my outreach for help. I am trying to figure out how to get my code to add up to an Nth reciprocal squared (I.E if n=4 then i am…
1
vote
1 answer

How to update variable values in ACL2?

I’m new to ACL2 theorem prover. I want to update the value of a variable based on XOR result of three variables. I think “setq” will do that for me. (setq out (xor (xor a b) c)) However, I get this error: ACL2 Error in TOP-LEVEL: The symbol SETQ…
mnaseer
  • 13
  • 3
1
vote
1 answer

Calling a function n times acl2

I cannot figure out how to call a function n times to be used in another function I have a function (defun right-shift (l) (append l '(0))) And I need to write another function that needs to shift '(l) n times (defun right-shift-n-times (l…
tswiggy
  • 11
  • 3
1
vote
0 answers

Graph Theory example not accepted by ACL2 Sedan

I'm studying the 'An Exercise in Graph Theory' example using the latest version of ACL2 Sedan. Unfortunately ACL2 does not accept the find-next-step function. I've checked several times it's typed in correctly and all functions it invokes are…
Attila Karoly
  • 951
  • 5
  • 13
1
vote
1 answer

Writing a select() function in ACL2

I'm trying to write a function in ACL2 (specifically ACL2s) that takes in a list and a natural number and returns the item in the list at the given index. So (select (list 1 2 3) 2) would return 3. Here is my code: ;; select: List x Nat ->…
camden
  • 1,908
  • 19
  • 18
1
2 3