Subversion Repositories programming

Rev

Rev 65 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 65 Rev 66
Line 57... Line 57...
57
    (t        (cons (COMBINE (car L) (cdr L)) 
57
    (t        (cons (COMBINE (car L) (cdr L)) 
58
                    (MY-REDUCE (DEL-EXP (cadr (COMBINE (car L) (cdr L))) L))))
58
                    (MY-REDUCE (DEL-EXP (cadr (COMBINE (car L) (cdr L))) L))))
59
  )
59
  )
60
)
60
)
61
 
61
 
-
 
62
(defun DEL-ZERO (L)
-
 
63
  (cond
-
 
64
    ((null L) nil)
-
 
65
    ((= 0 (caar L)) (DEL-ZERO (cdr L)))
-
 
66
    (t              (cons (car L) (DEL-ZERO (cdr L))))
-
 
67
  )
-
 
68
)
-
 
69
 
62
;;; This takes a non-reduced, unsorted list representing a
70
;;; This takes a non-reduced, unsorted list representing a
63
;;; PNF expression, and reduces and sorts it into correct
71
;;; PNF expression, and reduces and sorts it into correct
64
;;; Polynomial-Normal-Form.
72
;;; Polynomial-Normal-Form.
65
(defun PNF (L) (ISORT (MY-REDUCE L)))
73
(defun PNF (L) (ISORT (DEL-ZERO (MY-REDUCE L))))
66
 
74