## 2008-06-07

### enumerater using PROgram in LOGic

That's close on two points!
First, I have handed in this report below, in time!

Second, Tomorrow, I will participate in the party held by WRESS, where there will be gathered 300 people who can speak English for discussing! I heard team tables were already dicided, and the table I'm in gatherd good English speakers. How fun it seems! I will make full use of it!

----------
1. 問題設定
2. 考え方
3. 作成したプログラム
4. 実行結果
5. 考察
6. 感想

1. 問題設定
三つの自然数の足し算の全ての場合を列挙する。

2. 考え方

3. 作成したプログラム
/* X + Y = Z */

/* A + B + C = D */

/* 3項加算演算で起こりうる全ての場合を列挙する */
enum3(A,B,C,D) :-

4. 実行結果
?- enum3(A,B,C,D).
A = 0,
B = 0,
C = 0,
D = 0 ;

A = 0,
B = 0,
C = s(0),
D = s(0) ;

A = 0,
B = s(0),
C = 0,
D = s(0) ;

A = s(0),
B = 0,
C = 0,
D = s(0) ;

A = 0,
B = 0,
C = s(s(0)),
D = s(s(0)) ;

A = 0,
B = s(0),
C = s(0),
D = s(s(0)) ;

A = 0,
B = s(s(0)),
C = 0,
D = s(s(0)) ;

A = s(0),
B = 0,
C = s(0),
D = s(s(0)) ;

A = s(0),
B = s(0),
C = 0,
D = s(s(0)) ;

A = s(s(0)),
B = 0,
C = 0,
D = s(s(0)) ;

5. 考察
本項目では、バックトラックの理解を深めるため、prologで関数enum3を呼び出したとき、処理系の内部ではどのような振る舞いが行われているのかを考察したい。