Add negation for dense termlists

This commit is contained in:
Oliver Payne 2022-04-09 19:45:59 +01:00
parent a2e997a5eb
commit 0b608a1bf9
1 changed files with 7 additions and 0 deletions

View File

@ -659,6 +659,8 @@
(zero-pad
(- (order term) 1)
term-list))))))
(define (negate terms)
(map - terms))
(define (tag l) (attach-tag 'dense l))
@ -685,6 +687,11 @@
(put 'empty-termlist? '(dense)
empty-termlist?)
;; Operators
(put 'negate '(dense)
(lambda (termlist)
(tag (negate termlist))))
'done)