1.4.11 Trees
Examples: |
> (alphorder 6 4) |
() |
> (alphorder 4 6) |
t |
> (alphorder 4 4) |
t |
> (alphorder "abc" "bcd") |
t |
> (alphorder "bcd" "abc") |
() |
> (alphorder #\a "a") |
t |
> (alphorder "a" #\a) |
() |
Examples: |
> (eqlablep nil) |
t |
> (eqlablep 4) |
t |
> (eqlablep #\a) |
t |
> (eqlablep 'symbol) |
t |
> (eqlablep "string") |
() |
(equal x y) |
Example: |
> (identity 'x) |
x |
Examples: |
> (lexorder 6 4) |
() |
> (lexorder 4 6) |
t |
> (lexorder #\a #\b) |
t |
> (lexorder #\b #\a) |
() |
> (lexorder 'a 'b) |
t |
> (lexorder 'b 'a) |
() |
> (lexorder "abc" "bcd") |
t |
> (lexorder "bcd" "abc") |
() |
> (lexorder (list 1 2) (list 3 4)) |
t |
> (lexorder (list 3 4) (list 1 2)) |
() |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Examples: | |||||
| |||||
rename-below: used outside of begin-below in: (rename-below | |||||
(the-ref *tree*)) | |||||
> (caar *tree*) | |||||
eval:85:0: *tree*: undefined in: *tree* | |||||
> (cdar *tree*) | |||||
eval:86:0: *tree*: undefined in: *tree* | |||||
> (cadr *tree*) | |||||
eval:87:0: *tree*: undefined in: *tree* | |||||
> (cddr *tree*) | |||||
eval:88:0: *tree*: undefined in: *tree* | |||||
> (caaar *tree*) | |||||
eval:89:0: *tree*: undefined in: *tree* | |||||
> (cdaar *tree*) | |||||
eval:90:0: *tree*: undefined in: *tree* | |||||
> (cadar *tree*) | |||||
eval:91:0: *tree*: undefined in: *tree* | |||||
> (cddar *tree*) | |||||
eval:92:0: *tree*: undefined in: *tree* | |||||
> (caadr *tree*) | |||||
eval:93:0: *tree*: undefined in: *tree* | |||||
> (cdadr *tree*) | |||||
eval:94:0: *tree*: undefined in: *tree* | |||||
> (caddr *tree*) | |||||
eval:95:0: *tree*: undefined in: *tree* | |||||
> (cdddr *tree*) | |||||
eval:96:0: *tree*: undefined in: *tree* | |||||
> (caaaar *tree*) | |||||
eval:97:0: *tree*: undefined in: *tree* | |||||
> (cdaaar *tree*) | |||||
eval:98:0: *tree*: undefined in: *tree* | |||||
> (cadaar *tree*) | |||||
eval:99:0: *tree*: undefined in: *tree* | |||||
> (cddaar *tree*) | |||||
eval:100:0: *tree*: undefined in: *tree* | |||||
> (caadar *tree*) | |||||
eval:101:0: *tree*: undefined in: *tree* | |||||
> (cdadar *tree*) | |||||
eval:102:0: *tree*: undefined in: *tree* | |||||
> (caddar *tree*) | |||||
eval:103:0: *tree*: undefined in: *tree* | |||||
> (cdddar *tree*) | |||||
eval:104:0: *tree*: undefined in: *tree* | |||||
> (caaadr *tree*) | |||||
eval:105:0: *tree*: undefined in: *tree* | |||||
> (cdaadr *tree*) | |||||
eval:106:0: *tree*: undefined in: *tree* | |||||
> (cadadr *tree*) | |||||
eval:107:0: *tree*: undefined in: *tree* | |||||
> (cddadr *tree*) | |||||
eval:108:0: *tree*: undefined in: *tree* | |||||
> (caaddr *tree*) | |||||
eval:109:0: *tree*: undefined in: *tree* | |||||
> (cdaddr *tree*) | |||||
eval:110:0: *tree*: undefined in: *tree* | |||||
> (cadddr *tree*) | |||||
eval:111:0: *tree*: undefined in: *tree* | |||||
> (cddddr *tree*) | |||||
eval:112:0: *tree*: undefined in: *tree* |
(quote ...) |
Examples: |
> 'a |
a |
> '(1 2 3 4) |
(1 2 3 4) |
(quasiquote ...) |
Examples: |
> `a |
a |
> `(1 2 3 4) |
(1 2 3 4) |
(unquote ...) |
Example: |
> '(list ,a b c d) |
(list ,a b c d) |
Examples: |
> (subst 2 1 (list 1 1 1 3 1 1 1)) |
(2 2 2 3 2 2 2) |
> (subst 'z 'a (list 'a 'b (list 'd 'a (list 'a 'e)) 'a)) |
(z b (d z (z e)) z) |
(acl2-count v) → natp |
v : t |
The size of a cons-pair is one more than the sum of the sizes of its car and cdr. The size of an integer is its absolute value, the size of a rational number is the sum of the sizes of its numerator and denominator, and the size of a complex number is one more than the sum of the sizes of its real and imaginary parts. The size of a string is its length. The size of all other values (characters and symbols) is 0.
Examples: |
> (acl2-count 3/4) |
7 |
> (acl2-count (complex 3 4)) |
8 |
> (acl2-count "ABCD") |
4 |
> (acl2-count 'ABCD) |
0 |
> (acl2-count '(a b c d)) |
4 |