(defun remove (elem array) (cond ((null array) nil) ((eql elem (car array)) (cdr array)) (t (cons (car array) (remove elem (cdr array)))) ) ) (defun in (elem array) (cond ((null array) nil) ((eql elem (car array)) t) (t (in elem (cdr array))) ) ) (defun set (array) (cond ((null array) nil) ((in (car array) (cdr array)) (set (cdr array))) (t (cons (car array) (set (cdr array)))) ) ) (defun РАВЕНСТВО-МНОЖЕСТВ (set1 set2) (cond ((and (null set1) (null set2)) t) ((null set1) nil) ((null set2) nil) ((in (car set1) set2) (РАВЕНСТВО-МНОЖЕСТВ (cdr set1) (remove (car set1) set2))) (t nil) ) ) (print (РАВЕНСТВО-МНОЖЕСТВ '(1 2 3 4) '(4 1 3)))
Standard input is empty
NIL
Warning: reserving address range 0x80000c0000...0x1fffffffffff that contains memory mappings. clisp might crash later!
Memory dump:
0x8000000000 - 0x80000bffff
0x15236a600000 - 0x15236a8e4fff
0x15236aa15000 - 0x15236aa39fff
0x15236aa3a000 - 0x15236abacfff
0x15236abad000 - 0x15236abf5fff
0x15236abf6000 - 0x15236abf8fff
0x15236abf9000 - 0x15236abfbfff
0x15236abfc000 - 0x15236abfffff
0x15236ac00000 - 0x15236ac02fff
0x15236ac03000 - 0x15236ae01fff
0x15236ae02000 - 0x15236ae02fff
0x15236ae03000 - 0x15236ae03fff
0x15236ae80000 - 0x15236ae8ffff
0x15236ae90000 - 0x15236aec3fff
0x15236aec4000 - 0x15236affafff
0x15236affb000 - 0x15236affbfff
0x15236affc000 - 0x15236affefff
0x15236afff000 - 0x15236affffff
0x15236b000000 - 0x15236b003fff
0x15236b004000 - 0x15236b203fff
0x15236b204000 - 0x15236b204fff
0x15236b205000 - 0x15236b205fff
0x15236b2ca000 - 0x15236b2cdfff
0x15236b2ce000 - 0x15236b2cefff
0x15236b2cf000 - 0x15236b2d0fff
0x15236b2d1000 - 0x15236b2d1fff
0x15236b2d2000 - 0x15236b2d2fff
0x15236b2d3000 - 0x15236b2d3fff
0x15236b2d4000 - 0x15236b2e1fff
0x15236b2e2000 - 0x15236b2effff
0x15236b2f0000 - 0x15236b2fcfff
0x15236b2fd000 - 0x15236b300fff
0x15236b301000 - 0x15236b301fff
0x15236b302000 - 0x15236b302fff
0x15236b303000 - 0x15236b308fff
0x15236b309000 - 0x15236b30afff
0x15236b30b000 - 0x15236b30bfff
0x15236b30c000 - 0x15236b30cfff
0x15236b30d000 - 0x15236b30dfff
0x15236b30e000 - 0x15236b33bfff
0x15236b33c000 - 0x15236b34afff
0x15236b34b000 - 0x15236b3f0fff
0x15236b3f1000 - 0x15236b487fff
0x15236b488000 - 0x15236b488fff
0x15236b489000 - 0x15236b489fff
0x15236b48a000 - 0x15236b49dfff
0x15236b49e000 - 0x15236b4c5fff
0x15236b4c6000 - 0x15236b4cffff
0x15236b4d0000 - 0x15236b4d1fff
0x15236b4d2000 - 0x15236b4d7fff
0x15236b4d8000 - 0x15236b4dafff
0x15236b4dd000 - 0x15236b4ddfff
0x15236b4de000 - 0x15236b4defff
0x15236b4df000 - 0x15236b4dffff
0x15236b4e0000 - 0x15236b4e0fff
0x15236b4e1000 - 0x15236b4e1fff
0x15236b4e2000 - 0x15236b4e8fff
0x15236b4e9000 - 0x15236b4ebfff
0x15236b4ec000 - 0x15236b4ecfff
0x15236b4ed000 - 0x15236b50dfff
0x15236b50e000 - 0x15236b515fff
0x15236b516000 - 0x15236b516fff
0x15236b517000 - 0x15236b517fff
0x15236b518000 - 0x15236b518fff
0x55d95b32c000 - 0x55d95b41cfff
0x55d95b41d000 - 0x55d95b526fff
0x55d95b527000 - 0x55d95b586fff
0x55d95b588000 - 0x55d95b5b6fff
0x55d95b5b7000 - 0x55d95b5e7fff
0x55d95b5e8000 - 0x55d95b5ebfff
0x55d95be18000 - 0x55d95be38fff
0x7ffeb4e7e000 - 0x7ffeb4e9efff
0x7ffeb4ea9000 - 0x7ffeb4eacfff
0x7ffeb4ead000 - 0x7ffeb4eaefff
WARNING: DEFUN/DEFMACRO(REMOVE): #<PACKAGE COMMON-LISP> is locked
Ignore the lock and proceed
WARNING: DEFUN/DEFMACRO: redefining function REMOVE in /home/s20S8Z/prog.lisp,
was defined in C
WARNING: DEFUN/DEFMACRO(SET): #<PACKAGE COMMON-LISP> is locked
Ignore the lock and proceed
WARNING: DEFUN/DEFMACRO: redefining function SET in /home/s20S8Z/prog.lisp,
was defined in C