=======================================================================
  CORRECT TEST OUTPUT FOR LISP ASSIGNMENT 1
  =======================================================================
  Prepared by Andy Learn, 28 Jan 2002.
  
  -----------------------------------------------------------------------
  SPECIAL NOTE ON DEGENERATE CASES:
  
   For this assignment, I didn't specify how to handle degenerate or 
   weird cases. You can handle these however you choose, as long as 
   you EXPLAIN to me what you intend your function to do.
   
   For problem 1, the degenerate case is removing something from itself.
   I specifically included a test1d function to test this, if you
   want to try it. When I wrote my solution, I handled atoms like 
   (remove 'a 'a) but not lists like  (remove '(a b) '(a b)).
  
   In problem 2, an odd case I left in the test2 function is association
   lists that include single items instead of pairs. For these, you can:
  
    a) Ignore it completely
    b) Assume the single item is the name, so if (you) (me) was included  
       in the input, it would make the profession NIL, so the output  
       would include the inverted list (nil you me)
    c) Assume the single item is the profession, so if (theory) (systems) 
       was included in the input, it would make the ouput include either
       (theory) (systems) -- specify no people by assumption -- or 
       (theory nil) (systems nil) -- specify no people explicitly.
  
  I won't take off any points for ignoring degenerate or weird cases, 
  but may give a bonus point or two if you do handle them. 
  
  In general, Lisp functions can be written to be very general, where they
  handle smartly anything you give them.  Or, if you're writing the function
  for a project where you're using it in a very specific way, you can do
  your error checking at a higher level. Just make sure you THINK ABOUT
  those degenerate or weird cases, because they will inevitably come up.
  -----------------------------------------------------------------------
  
  
  =======================================================================
  (test1)
  =======================================================================
  
  (REMOVE-ALL 'A '(B A C A D)) 
  
  (B C D) 
  
  (REMOVE-ALL '(A B) '(A B C (A (A B) B) (B A))) 
  
  (A B C (A B) (B A)) 
  
  (REMOVE-ALL 'A '(A B C (A (A B) B) (B A))) 
  
  (B C ((B) B) (B)) 
  
  (REMOVE-ALL '(A (B) C) '(A B C (A A (B) C) (D (A (B) C)))) 
  
  (A B C (A A (B) C) (D)) 
  
  (REMOVE-ALL NIL '(NIL (A) (B NIL (NIL)))) 
  
  ((A) (B NIL)) 
  DONE-WITH-TEST1
  
  
  =======================================================================
  (test1d)
  =======================================================================
  
  (REMOVE-ALL 'A 'A) 
  
  NIL 
  
  (REMOVE-ALL '(A B) '(A B)) 
  
  (A B)  ;;; or ideally, NIL. My solution doesn't handle this, though. ;;;
  
  (REMOVE-ALL '(A B) '(C A B)) 
  
  (C A B) 
  DONE-WITH-TEST1D
  
  =======================================================================
  (test2)
  =======================================================================
  
  (INVERT-ALIST '((MARY LAWYER) (JOHN DOCTOR) (SUE DOCTOR) (FRED DENTIST)
                  (JANE DOCTOR) (BILL LAWYER))) 
  
  ((LAWYER MARY BILL) (DOCTOR JOHN SUE JANE) (DENTIST FRED))   
  
  (INVERT-ALIST '((JAMES NL) (YOU?) (LEN NL) (CB VISION) (RANDAL VISION)
                  (GEORGE NL))) 
  
  ((NL JAMES LEN GEORGE) (VISION CB RANDAL) (YOU?))   
  
  (INVERT-ALIST '((CCM COOL) (HIP-HOP GAG-ME) (CLASSICAL COOL)
                  (RAP GAG-ME) (BIG-BAND COOL))) 
  
  ((COOL CCM CLASSICAL BIG-BAND) (GAG-ME HIP-HOP RAP))   
  DONE-WITH-TEST2
  
  =======================================================================
  (test3a)  (SAME RESULTS FOR test3b AND test3c)
  =======================================================================
  
  (ADD-POSITION-ITER '(7 5 1 4)) 
  
  (7 6 3 7)   
  
  (ADD-POSITION-ITER '(10 20 30 40 50)) 
  
  (10 21 32 43 54)   
  
  (ADD-POSITION-ITER '(7 5 1 4) :NUMBER-FROM 3) 
  
  (10 9 6 10)   
  
  (ADD-POSITION-ITER '(10 20 30 40 50) :NUMBER-FROM 5) 
  
  (15 26 37 48 59)   
  
  (ADD-POSITION-ITER '(7) :NUMBER-FROM 100) 
  
  (107)   
  
  (ADD-POSITION-ITER NIL) 
  
  NIL   
  DONE-WITH-TEST3
  
  =======================================================================
  (test4)
  =======================================================================
  
  (FIND-DEPTH 'NIL) 
  
  0   
  
  (FIND-DEPTH '((((NIL NIL))) NIL NIL (NIL NIL))) 
  
  4   
  
  (FIND-DEPTH '(A (B) (C (D (E F))) G)) 
  
  3