Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;ПЕРВАЯ ИЗ НОВОЙ ЛАБЫ
- (define (Fano lst)
- (define lst1 (map length ( map (λ (x) (cdr x)) lst)))
- (define lst2 ( map (λ (x) (cdr x)) lst))
- (define (MinLen lst1 mim)
- (if (empty? lst1) mim
- (if (< mim (car lst1)) (MinLen (cdr lst1) mim)
- (MinLen (cdr lst1) (car lst1)))))
- (define Cut ( map ( λ (x) (take x (MinLen lst1 (car lst1)))) lst2))
- (define Cut2 ( map ( λ (x) (take-right x (MinLen lst1 (car lst1)))) lst2))
- (define (fAnO x lst)
- (if (empty? lst) #t
- (if (equal? x (car lst)) #f
- (fAnO x (cdr lst)))))
- (define (fano lst3)
- (if (empty? lst3) #t
- (if (not (fAnO (car lst3) (cdr lst3))) #f
- (fano (cdr lst3)))))
- (or (fano Cut) (fano Cut2)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement