遺伝的アルゴリズムを使った対話システム

書籍「自然言語処理ことはじめ」に載っていた。
どうやら、単語を遺伝子配列の単位としているらしい。

自然言語処理ことはじめ―言葉を覚え会話のできるコンピュータ

自然言語処理ことはじめ―言葉を覚え会話のできるコンピュータ

1

During expression evaluation newLISP or any other interactive language system will constantly generate new memory objects resulting from intermediate evaluation results or from de-referencing memory objects due to new assignments or change of those memory objects in there contents. If this un-referenced memory were not taken care of by deletion than newLISP would run out of memory over time.

To understand newLISP's type of automatic memory management it is necessary to review the traditional methods employed by other languages.


式を評価するnewLISPあるいは他の対話型言語システムでは、
1.計算中の中間評価結果
2.新しい割当のためメモリオブジェクトに対となる参照の生成
3.メモリオブジェクトの内容の変更
これにより、新しいメモリオブジェクトを絶えず生成するでしょう。
もし、この参照されないメモリをnewLISPが削除しなければ、
いつかメモリを使い果たすでしょう。


newLISPの自動メモリ管理を理解するために、他の言語によって
使われた伝統的方法を見直すことが必要です。

Traditional automatic memory management

伝統的な自動メモリ管理
Traditional automatic memory management
In most programming languages automatic memory management is realized by a process called Garbage Collection. This is a process where allocated but unused memory gets occasionally freed again. When memory is allocated it is registered in some form. Some other process, typically working asynchronous to the normal statement evaluation investigates the allocated memory pool for unused parts, which can be recycled for future use.

This process is typically triggered by some memory allocation limit or happens synchronously between steps of the normal evaluation process.


ほとんどのプログラミング言語では、自動的なメモリ管理は
ガーベジコレクションと呼ばれるプロセスによって実現されます。
これは時々実行されるプロセスで、割り当てられたものの
未使用であるメモリを解放し再び利用可能にするものです。
メモリが割り付けられる場合、それはなんらかの形式で登録されます。

他のあるプロセス(典型的には正常なステートメント評価)に対して
非同期に働き、未使用部分として割り当てられたメモリプールを調査します。
(今後の使用のためにその部分を再生することができます)。
このプロセスは、メモリ割当の限界が引き金となって起動するか、
あるいは、正常な評価プロセスのステップ間に同期して起動します。

One Reference Only, (ORO) memory management

1つの参照のみ(One Reference Only:ORO)、メモリ管理
Memory management in newLISP is different from memory management in other dynamic languages and based on a One Reference Only rule. Memory is never marked or reference counted, but a decision to delete a newly created memory object is taken right away after it has been created.


newLISPの中のメモリ管理は他のダイナミックな言語での
メモリ管理とは異なり、1つの参照のみと言うルールに基づきます。
メモリをマークしないか、参照をカウントしていましたが、
作成された後、新しく作成されたメモリ・オブジェクトを削除する決定は
すぐに得られます。

Empirical studies of LISP have shown that most LISP cells are not shared but can be reclaimed immediately during the evaluation process. newLISP does this by pushing a reference of each created memory object on to a result stack. When a higher order evaluation level is reached these memory objects can be deleted. Note, that this should not be confused with One-bit Reference Counting, no bits are set to mark objects as sticky or not, except for some optimizations for primitives like set, define and eval all evaluation results get pushed on the result stack for delayed deletion at the next higher evaluation level.


LISPの実証的研究は、ほとんどのLISPセルを共有させてなくとも、
評価プロセスの間にすぐさま再生利用することができるのを示しました。
newLISPは、それぞれの作成されたメモリオブジェクトの結果スタックへの
参照をプッシュすることによって、これを行います。
?より高いオーダー評価レベルに達しているとき、
これらのメモリオブジェクトを削除することができます。
注意:
1.これは1ビット参照を数えることと混同してはいけません
2.ビットは関連付けのためにメモリオブジェクトをマークするように設定されません
3.?defineとeval、すべての評価結果が次の、より高い評価レベルにおける
  遅延した削除のための結果スタックにプッシュされます


(やはり「伝統的な自動メモリ管理」を理解しないと
 意訳できないかもしれないので、そっちへ戻る)

JAVA LISP 「QUILT」

http://www.cobalt.co.jp/writing/java_lisp/java-lisp1.htm
javaでのschemeの実装を目指しているらしいページ
実装の参考になるかも。
javaで実装することは確かにガベージコレクション
実装する必要がないので楽にできるかもしれない。
javaを使うことでの速度の問題についてはこのページで触れていますが
僕には良く判りませんでした(´・ω・`)ショボーン