fork download
  1. (defun remove (elem array)
  2. (cond
  3. ((null array) nil)
  4. ((eql elem (car array)) (cdr array))
  5. (t (cons (car array) (remove elem (cdr array))))
  6. )
  7. )
  8.  
  9. (defun in (elem array)
  10. (cond
  11. ((null array) nil)
  12. ((eql elem (car array)) t)
  13. (t (in elem (cdr array)))
  14. )
  15. )
  16.  
  17. (defun set (array)
  18. (cond
  19. ((null array) nil)
  20. ((in (car array) (cdr array)) (set (cdr array)))
  21. (t (cons (car array) (set (cdr array))))
  22. )
  23. )
  24.  
  25. (defun РАВЕНСТВО-МНОЖЕСТВ (set1 set2)
  26. (cond
  27. ((and (null set1) (null set2)) t)
  28. ((null set1) nil)
  29. ((null set2) nil)
  30. ((in (car set1) set2) (РАВЕНСТВО-МНОЖЕСТВ (cdr set1) (remove (car set1) set2)))
  31. (t nil)
  32. )
  33. )
  34.  
  35. (print (РАВЕНСТВО-МНОЖЕСТВ '(1 2 3 4) '(4 1 3 2)))
Success #stdin #stdout #stderr 0.02s 10404KB
stdin
Standard input is empty
stdout
T 
stderr
Warning: reserving address range 0x80000c0000...0x1fffffffffff that contains memory mappings. clisp might crash later!
Memory dump:
  0x8000000000 - 0x80000bffff
  0x14fe8fc00000 - 0x14fe8fee4fff
  0x14fe90015000 - 0x14fe90039fff
  0x14fe9003a000 - 0x14fe901acfff
  0x14fe901ad000 - 0x14fe901f5fff
  0x14fe901f6000 - 0x14fe901f8fff
  0x14fe901f9000 - 0x14fe901fbfff
  0x14fe901fc000 - 0x14fe901fffff
  0x14fe90200000 - 0x14fe90202fff
  0x14fe90203000 - 0x14fe90401fff
  0x14fe90402000 - 0x14fe90402fff
  0x14fe90403000 - 0x14fe90403fff
  0x14fe90480000 - 0x14fe9048ffff
  0x14fe90490000 - 0x14fe904c3fff
  0x14fe904c4000 - 0x14fe905fafff
  0x14fe905fb000 - 0x14fe905fbfff
  0x14fe905fc000 - 0x14fe905fefff
  0x14fe905ff000 - 0x14fe905fffff
  0x14fe90600000 - 0x14fe90603fff
  0x14fe90604000 - 0x14fe90803fff
  0x14fe90804000 - 0x14fe90804fff
  0x14fe90805000 - 0x14fe90805fff
  0x14fe90983000 - 0x14fe90986fff
  0x14fe90987000 - 0x14fe90987fff
  0x14fe90988000 - 0x14fe90989fff
  0x14fe9098a000 - 0x14fe9098afff
  0x14fe9098b000 - 0x14fe9098bfff
  0x14fe9098c000 - 0x14fe9098cfff
  0x14fe9098d000 - 0x14fe9099afff
  0x14fe9099b000 - 0x14fe909a8fff
  0x14fe909a9000 - 0x14fe909b5fff
  0x14fe909b6000 - 0x14fe909b9fff
  0x14fe909ba000 - 0x14fe909bafff
  0x14fe909bb000 - 0x14fe909bbfff
  0x14fe909bc000 - 0x14fe909c1fff
  0x14fe909c2000 - 0x14fe909c3fff
  0x14fe909c4000 - 0x14fe909c4fff
  0x14fe909c5000 - 0x14fe909c5fff
  0x14fe909c6000 - 0x14fe909c6fff
  0x14fe909c7000 - 0x14fe909f4fff
  0x14fe909f5000 - 0x14fe90a03fff
  0x14fe90a04000 - 0x14fe90aa9fff
  0x14fe90aaa000 - 0x14fe90b40fff
  0x14fe90b41000 - 0x14fe90b41fff
  0x14fe90b42000 - 0x14fe90b42fff
  0x14fe90b43000 - 0x14fe90b56fff
  0x14fe90b57000 - 0x14fe90b7efff
  0x14fe90b7f000 - 0x14fe90b88fff
  0x14fe90b89000 - 0x14fe90b8afff
  0x14fe90b8b000 - 0x14fe90b90fff
  0x14fe90b91000 - 0x14fe90b93fff
  0x14fe90b96000 - 0x14fe90b96fff
  0x14fe90b97000 - 0x14fe90b97fff
  0x14fe90b98000 - 0x14fe90b98fff
  0x14fe90b99000 - 0x14fe90b99fff
  0x14fe90b9a000 - 0x14fe90b9afff
  0x14fe90b9b000 - 0x14fe90ba1fff
  0x14fe90ba2000 - 0x14fe90ba4fff
  0x14fe90ba5000 - 0x14fe90ba5fff
  0x14fe90ba6000 - 0x14fe90bc6fff
  0x14fe90bc7000 - 0x14fe90bcefff
  0x14fe90bcf000 - 0x14fe90bcffff
  0x14fe90bd0000 - 0x14fe90bd0fff
  0x14fe90bd1000 - 0x14fe90bd1fff
  0x560eac084000 - 0x560eac174fff
  0x560eac175000 - 0x560eac27efff
  0x560eac27f000 - 0x560eac2defff
  0x560eac2e0000 - 0x560eac30efff
  0x560eac30f000 - 0x560eac33ffff
  0x560eac340000 - 0x560eac343fff
  0x560eae290000 - 0x560eae2b0fff
  0x7ffd67b1b000 - 0x7ffd67b3bfff
  0x7ffd67b6c000 - 0x7ffd67b6ffff
  0x7ffd67b70000 - 0x7ffd67b71fff
WARNING: DEFUN/DEFMACRO(REMOVE): #<PACKAGE COMMON-LISP> is locked
         Ignore the lock and proceed
WARNING: DEFUN/DEFMACRO: redefining function REMOVE in /home/jd1TbF/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/jd1TbF/prog.lisp,
         was defined in C