## 2014年6月6日金曜日

### Scheme - データによる抽象の構築(汎用演算のシステム(例: 記号代数(多項式の算術演算、項リストの表現、記号代数における型の階層構造(拡張問題: 有理関数(多項式の積と最大公約数(最大公約多項式))))))

その他参考書籍

```P1: (polynomial (x (2 1) (1 -2) (0 1)))
P2: (polynomial (x (2 11) (0 7)))
P3: (polynomial (x (1 13) (0 5)))

Q1: (polynomial (x (add-terms ((4 11) (2 7))
())))))
Q1: (polynomial (x (add-terms ((4 11) (2 7))
((2 11) (0 7))))))
Q1: (polynomial (x (add-terms ((4 11) (2 7))
((3 -22) (2 11) (1 -14) (0 7)))))
Q1: (polynomial (x ((4 11) (3 -22) (2 18) (1 -14) (0 7))))

Q2: (polynomial (x (add-terms ((3 13) (2 5))
())))))
Q2: (polynomial (x (add-terms ((3 13) (2 5))
((1 13) (0 5))))))
Q2: (polynomial (x (add-terms ((3 13) (2 5))
((2 -26) (1 3) (0 5)))))
Q2: (polynomial (x ((3 13) (2 -21) (1 3) (0 5))))

Q1: (polynomial (x ((4 11) (3 -22) (2 18) (1 -14) (0 7))))
Q2: (polynomial (x ((3 13) (2 -21) (1 3) (0 5))))

(gcd-poly Q1 Q2)

(gcd-terms ((4 11) (3 -22) (2 18) (1 -14) (0 7))
((3 13) (2 -21) (1 3) (0 5)))

(gcd-terms ((3 13) (2 -21) (1 3) (0 5))
((3 (- -22 -231/13))
(2 (- 18 33/13))
(1 (- -14 55/13))
(0 7)))

(gcd-terms ((3 13) (2 -21) (1 3) (0 5))
((3 -55/13) (2 201/13) (1 -237/13) (0 7)))

(gcd-terms ((3 -55/13) (2 201/13) (1 -237/13) (0 7))
((2 (- -21 (* 201/13 (* -13/55 13))))
(1 (- 3 (* -237/13 (* -13/55 13))))
(0 (- 5 (* 7 (* -13/55 13))))))

(gcd-terms ((3 -55/13) (2 201/13) (1 -237/13) (0 7))
((2 1458/55) (1 -2916/55) (0 1458/55)))

(gcd-terms ((2 1458/55) (1 -2916/55) (0 1458/55))
((2 (- 201/13 (* -2916/55 (* 55/1458 -55/13))))
(1 (- -237/13 (* 1458/55 (* 55/1458 -55/13))))
(0 7)))

(gcd-terms ((2 1458/55) (1 -2916/55) (0 1458/55))
((2 7) (1 -14) (0 7)))

(gcd-terms ((2 7) (1 -14) (0 7))
((1 (- -2916/55 (* -14 (* 1/7 1458/55))))
(0 (- 1458/55 (* 7 (* 1/7 1458/55))))))

(gcd-terms ((2 7) (1 -14) (0 7))
((1 0) (0 0)))

(gcd-terms ((2 7) (1 -14) (0 7))
())

((2 7) (1 -14) (0 7))

(polynomial (x (2 7) (1 -14) (0 7)))
```