プロダクションルールの言語、知識表現、
一部を英語にしてみる。余りにも古いものなので自分でも書いた内容を忘れている。2006 6.20

N88BASICのソースと実行ファイルと例題
F−BASICコンパイラでWindowsXP Windows2000で動作を確認してある

 
"Program making program"

Symbolic reasoning language for artificial intelligence


Transrating English in 2006 6.20

Production rules system 
Since 1984
Written in Micosoft BASIC 
Windows 2000, Windows Xp execute file
Sample souce list  


Program making program

Self programming system
Auto programming  
knowledge enginering
knowledge representing
Artificial langualge for knowledge representation



ABSTRUCT

All of things consist of some kind of values.
I think these are adjectives and adverbs.
And concepts consist of adjectives and adverbs.           

The scines are builted up some kind of values from "The series of scine" .
The objects are builted up some kind of values from the scines.
That values are lower level of builtting up scines.
objects consist of attributes which are builted up by more lower value.

I think cycrop's project will never end.
We describe everthing in the world, all of contexts, all of characteristics of objects 
We can never do such a thing.  
My purpose is making real artificial intelligence.
No intresting in making article.




1999 march written by Takehiro Ishizaki 

occupation is Japanese doctor of internal medicine. 
specilize in digestion system and autoimmune disease 
pattern recognition
neural-net
machine learning
robotics


This article is written in English.
But I am not good at English writtings.
If you want to know details, please E-mail for me.
My e-mail address is ( c q l 0 0 0 6 7 @ n i f t y . n e . j p ) 
Please remove space !
For preventing auto collectting e-mail address program and  stopping spam mail.







contents

                         3

1.Introduction

2.theory of model world, Artficial Language                             6
structure of searching,resoning

3.type of variables, type of constants, how to describe list           20

4.effector,statement,command                                           22

5.How to use this system                                               23

6.Exsample 1, blaind searching , problem maze                          24

7. Exsample 2, pattern much ,Tower of hanoi                            29

8. Exsample 3, using estimating function , eight puzzle                32

9. Example 4, setting of estmating function                            34 

10. statement manual, command manual                                   36 

11. conculusion                                                        45

12. souce list                                                         46







1.Introduction

If you try to compute someting using computer, you must writting program.
Problem must be described some kind of computer program. 

This (Program making program) is using artificial langualge.
You describe the problem using Artificial language.
I made Artificial language for solving ordinary dairy matters and puzzle and etal. 


Real world,
Problem -> AL(artificial language)-> resoning
something fact in the book describing


In the first, computer's data is empty.
We intend to compute a someting, it need someting data.
Knowledge representation is very important subject.
Exactry describing of the matter is lead to exactry result. 
Not to mention, if there is no data, we get nothing. 


In the next ,We set somthing goal.
If we will not set goal, computer resoning is not stopping. 

This (program making program) is using knowledge representing Artificial langualge,
and setting goal, and searching the path of first state to goal state. 


My purpuse is making the system ,which has many of knowledge compar with humanbeing speedy and exactry.
I made this (program making program) since 1985.
In 1985,Japanese gaverment was developping the fifth computer system using the language Prolog.
Prolog was one of symbolic resoning system ,made in England. 


This program was made 1985-1994.
In those days, I was using Quick Basic and N88BASIC made by NEC.
There was not enough speed and memory,this system using temprary file for making up not enough memory.
This system's user interface is very old. 


This (Program making program ) is not complete.
Because, I intend to making real artificial intelligence.
There is many difficult problem to make such a complicated system.
Dealing with real world's vison is one of problem.


I think basic artificial intelligence's basic function is searching.
For exsample GPS (General Problem Solver), which is Alan Newell and Herbert A. Simon's system.
There are 3 elements.
First state, goal state, usable rule for changing the state.

I read article about somewhere's symposium, 
Recentry, artificial intelligence is a deadlock, and era of night mare.
But, I don't think so.

In those days, GPS (General Problem Solver) was making,
Scientist belived in computer and artficial intelligence would be beyond human intelligence in ten or twenty years.
But, we know that was not be true. 

Nowaday, the book, society of the mind written by Marvin Minsky,says agent theory will be realized artificial intelligence.
I cannot understand why agent theory is realized real artificial intelligence.
I wonder all the people can understand this theory.
Do you know by intuition agent theory is artificial intelligence?

My first artificial intelligence is solving aryhtmetic problem in junior high school.
using method of try and error.
I used NEC personal computer PC-6001 Z-80 8bit 2MHz 32KBytes memory,microsift BASIC.
Solving aryhtmetic problem,I intented to solve more general problem.
In those days, I thuoght try and error program can make a new program.
I named this system "Program making Program".
Now ,I don't know suiatble name of this language system.
So,this language name is "Program making Program".
Execution file name is only "program.exe" or "prog.exe".

I encountered many problems,combinational explosion, knowldge expression, etc.

Did you see computer solve a complicated program in speedy and exactry.
This is not mere numerical computation.
Solving problem ,for instace Puzzle or chess or etc, using try and error system.
If you don't like such a programs, you will not undetstand artificial intelligence.

Making Windows softweares are very difficult, compare with old fassioned BASIC or Turbo-C program.
Windows system is very large and complicated.
Nowadays,computer programming is very difficult. 

I impressed NEC PC-6001's systhesyzed human voice and color graphics.
Recentry,all of ordinary personal computer have such functions. 

I read the book about CD (conceptual dependancy) theory and script theory written by Roger Shank.
There are some sample LISP programs. 
This book says dealing with natural language sentnces devided into some primary words.

In those days, there are some kind of LISP language, and there are many difference of the way of describing.
Each LISP language have each substitution functon representation.
For instance ,set ,setq, set! 
One of LISP was function name outside parensis. 
Commmon LISP is very lage system for 8Bit personal computers.
I cannot afford to buy LISP or PROLOG, and I did not think recurecive programing method is airtifficil intelligence.

I aim at making artficial intelligence using production rule lungualge.
Production rule's structure is "if A then B".
But, "Program making Program" 's effector is "S1 S2 S3....."
Setting first state and end state and usable rules.
"Program making Program" search start state and end state using vertical searching method.

There are two method of searching.
The one is using estimating function for goal.
The other is testing all of combination of capable of the state.
Thw way of determing of estimating functions are using distance first state from goal state or user can set function using with statement.

This language name is "Program making Program".
In junior high school day's,I wanted auto making program.
And I thought and made a program. 
There are first state, goal state and usable rules.
Rules is adapting states try and error until attainment of goal.
The rules of path is decided first state from goal state.
I thought this process is making program.

In those day's, I used to try to solve home work mathematical problem , puzzle and etc.
Using Microsoft BASIC language.

I wanted to make a special language for solving general problems.
But, I had not such a programming knowledge.
I tried and tried to make a Language, I mastered programming.

Blind searching is making a many of combination, and can be solve small problems.
This problem is called combination explosion. 
I added estimating function in searching process.
It is needed symbol description general knowldge for resoning.
So,I made knowledge representing statement.  
The word "Program" is constructing "pro" and "gram".
"pro" is descripting aprior,and "gram" is description.

The name of this language is "Program making program".
I thought this name is strange and wanted to change before.
But,I had no idea to name it.
Now,for the reasons I say this language "Program making program".   

Puzzle or mathematical problem or toy world problem is not needed formularized knowledge representation.

I intend to describe ordinary daily lifes knowledge.
I made knowledge representing statement, and named AL ( Artificial Langualge).
AL is able to use statement in "Program making program".

This language was described Microsoft BASIC.
Because,specifications was chainging and chainging.
I tried many times to make direct macine languale for improve processing speed.
But,It was unstable processing string with variable length.
BASIC compiler was improved and easy to make a speedy processing program.
I used to BASIC language for this system.


In 1997 12.2

2.Theory of model world , AL (Artficial Language) and structure of searching. 


You want to reasoning using computer, you must describe contens some kind of computer language.
"Program making program" is production rule language and describing knowledge using AL (Artficial Language).


Real worlds problems            describling
some kind of knowledge  ->   AL (Artficial Language)   -> resoning
in the book 

The computer can solve problems exactry using knowledge which is written by some kind of computer language. 
In the first, we must give the computer some kind of programs which is representing including ordinary dairy life's knowledge.
It is very improtant for us to make firm knowledge represantation artificial language.

Not to mention,if there is no knowledge, we cannot to solve any kind of problems.
 
In the next ,we set the goal.
The computer is resoning first state to the goal state.
And adapting the rurles each state try and error.
The rules is written in knowledge representive language.
This is "Program making program".


Theory of the model world

All of things are consist of some kind of value.
I think these are adjectives and adverbs.
And concepts are consist of adjectives and adverbs.

The model world is constructred by symbol, which is representing real world's state.
The computer is receveing and receving real world's information,not interrupting.  

I call this "The series of scine".
"The series of scine" is recording everything video data ,audio data sevo data and etc senceor data, since starting artificial intelligence computer system. 
   
This is theoritical thing and this cannot be realize using nowadays computers.
But,it is neccesary to think representing knowledge.
"The series of scine" is recording everthing in the real world,which computer system's sensor can record.

All of things consist of some kind of values.
I think these are adjectives and adverbs.
And concepts consist of adjectives and adverbs.           

The scines are builted up some kind of values from "The series of scine" .
The objects are builted up some kind of values from the scines.
That values are lower level of builtting up scines.
objects consist of attributes which are builted up by more lower value.

I think cycrop's project will never end.
We describe everthing in the world, all of contexts, all of characteristics of objects 
We can never do such a thing.  
 




                            structure of the model wrold

--------------------------------------------------------------------------
|                                     |
|            "The series of scine"               |
|        every information since starting system             |
|                                     |
|  --------------------                          |
|  |         |         ---------------------       |
|  |   scine    |         |          |       |
|  |         |         |   scine     |       |
|  |         |         |          |       |
|  --------------------              ---------------------         |
|              -----------------------------------------   |
|              |       scine           |   |
|              |                    |   |
|     ------------    |  object1  object1     object1   |   |
|     |     |    |                    |   |
|     |     |    |  object2    object2     object2   |   |
|     | scine  |    |                    |   |
|     |     |    |  object3    object3   object3    |   |
|     |     |    |                    |   |
|     |     |    |    t   ->    t+1   ->  t+2     |   |
|     ------------    |                    |   |
|              -----------------------------------------   |
--------------------------------------------------------------------------


Relationship model world between artificial intelligence computer system

Relationship model world between computer system is subjectivity and ideological.
We must set in computer somekind of subjectivity and ideological things.
The computer system is in the real world, and behaving with maximum of estimating value which is we determin estimating function. 
The estimating function is representing human's subjectivity and ideological things.


real world  <-  model world  ->   evalueation,human's subjectivity value 
            <-  action       <-


The computer system records real world's state and model world's state.
Model world's states are assumption experience of "The series of scine".

Description of model world intrinsic association, resoning is same form representing ,intrinsic association, resoning.
This is aim at self describing.  
I think self describing is able to form new concept and optimize of resonings.  



Structure of resonings

It is needed to describe to solve a problem what is first state and what is goal state, and what kind of rules the computer can use.
The palce which is describing states are model world.
The describing working place is model world.
The model world is consist of resisters. 



The model world

first state   ->      state1   ->      state2   -> ........->   goal state 
            effector1        effector2             effectors 
          
The distance the goal state from each state is model world's estimating value.
The effector adapt the model world and makes next state.
The computer system selects effector which is making nearly the goal state.
We intend to start to search,we are setting effectors, setting first state , the goal state.
In addition, we can describe optional estimating function with using statement.

This langualge is using vertical seraching method.
We can set the searching number of time for stopping of searching. 


Knowledge representation of AL (Artificial Language)
The basic of representing knowlegde 
The words are referring to some kind of state.
   
We named the things in the real world with changing time and the thing in the model world's state. 
I think whatever any kind of abstruct concept can be reducing into real world's exstans.
It is possibble or impossible, I must reduce abstruct concept into real world's extances.

For instance, the word "beautiful" is abstruct concept,but we can understand. 
It is difficult to declear the word "beautiful" in the strictly. 
And the word "Law" is very huge and abstruct concept.
But each law is reduce into real world's exstances in the change of the time. 
We name the things in the real world's scine which we think the prototype.  
The prototype scine are maked numerus real world's scine.


Toy world

We think toy world are blocks world, chess, puzzle and etc.
Herbert Alexander Simon studied the chess, back gamon ,Winograd made AI system "Shudle".  
But I think "Toy world" is not such a things.
I think toy world is describe using formalized sysmbol, and location and state of existances in changing time.   



The process of describing AL 
existance-1,existance-2,existance-3 ,chainging in the time.

one existance

There is one existance in the real world, 
The exsitance may be moving ,stopping, disappeare,chainging caracteristic of itself.


Two existances

The existance with moving or changing first is the nominatve case.
The existance with moving or changing in the next time the other existance is the objective case.
Deciding nominative case or objective case is cause of time relation .

Three existances

The existance with moving or changing int the last is nominate subjective case. 

For instance,

The carpenter makes house by wood with using saw. 

Nominative case is the carpenter.
In this scine, the carpenter is moving in the first.
The saw is in the next time. 
The wood is in the third.
The house is emerging in the end. 


                 t               t+1            t+2          t+3         t+4

existance-1   carpenter       carpenter      carpenter     carpenter   carpenter

existance-2      saw          moving  saw      moving saw    saw          

existance-3     wood            wood         cutting wood   cutting                               
existance-4                                                             house


t      There are the carpenter,saw, wood. 
t+1    The carpenter with using the saw. 
t+2    The saw is cutting the wood.
t+3    The house is built.

AL is named and describe existances with changing in the time.
This instance is named since of "building the house".



The limit of ability of CD (conceptual dependancy) theory

CD (conceptual dependancy) theory was made by Schank, Reasbeck and Abelson in 1975,
for understanding natural language in the computer science. 
This is called script theory, and there are many of books. 

CD (conceptual dependancy) theory is consist of primitive words.

ATRANS, MTRANS, SPEAK, EXPEL, PROPEL, MOVE, etc
 
CD system is reasoning and understanding news papers articles, stories about fary tails.

AL is not using fixed primitive words.
AL is described existance in changing time.

NTT is Japanese telephone's company.
NTT studies macine tranceration system which is using about 3000 semantics.
But,self organigation system is needed simple mechanism.
It is needed simple structure for self description or reference itself.

AL is designed real worlds description and reasoning for the robot which is beyond human's intelligence.



AL(artificial lunguage)

(In 1988-1990,the word "Artificial Life" is not popular,and I didn't know it.)
 
AL(artificial lunguage) is method of knwoldge represtation statement in "Program making program". 
AL is production system's effector and designed for symbolic resoning, getting real world's information.
Schank's CD (conceptual dependancy) theory is using some primitive words.
CD system and script theory is uncomplete for symbol grounding problem, understanding ordinary dayli lifes.  
For robotics ,it is needed all of real world's infomation getting automaticaly ,and forming concepts.  

Kant thought time and raum are apriori.

I think time ,raum, existances ,logical relations and human's subjective values are apriori.   


Comparing AL with CD 

I thought everything in the real world trancelate into model world's representation.
Describbing real world scine is making model.
I think resoning is predicting.
CD using some of primitive words.
I think CD is unsufficent for describing real worlds, and difficult to conecting macine vison.
AL is describing existances state in changing time. 


Dealing with the model world

I think the artficial intelligence systems are in the real world, and have real time processing.
The AI system has some kind of functions which estimates humanbeing's value.   
The AI system plans getting maximum value or minimum value which vales are setting apriori. 
The model world is dealing with assumption matter,past scine, in the feature, every scine which can be describing some kind of sysmbol.



The way of description of existances

The existances consists of some of attribute.

*MW+(time)+(assumption number)+(parell world number)+(case nominative = 1 )+atrribute+.....+  =

*MW is means model world.
* means registor.

This is "program making program's" registor.

The order of atrribute is contribute to level of abstruct.  

For instance, trying to description of the desk in front of me.
The attibute is 

furniture+desk+for-study+kagawa-prefecture+miki-city+Ishizaki

If the effector is description general "desk".
The effector ,only "furniture+desk" can be matching it.

*T  Time 

description of order of the scine,using integer.

*A  assumption

The description of the assumption level,using integer. 
Representation of assumption or imaginary scine.
Real world scine is nubmer zero.
Imaginary scine is one.
Imaginary scine in the imaginary is 2.
Imaginary scine in the imaginary scine in the imaginary is 3.

For instance, the novel's scine is *A=1.
The novel's character thinks somethings is *A=2
 

*N   parallel worlds , using integer

The scine consist of some existances in the chainging time.
The scine and the script is same meaning.
I think AL is expanding CD and script theory.
The description some scine in the same time is using *N.
*N is representing parallel worlds,using integer.   
There is no system itself in the AL.

*K   case   nominative case is 0   objective case is 1 

*KV  kind of the value , list of atrributes 

For instance, trying to description of the desk in front of me.
The attibute is 

furniture+desk+for-study+kagawa-prefecture+miki-city+Ishizaki

location, time scales, distance scales, size
colors, shape, value of price,name, information , memorandom,
something which may be unit.



The concreate represantation registor.

*T+*A+*N+*K+*KV = value
*T+*N = predicate verb



The practice of AL representation

Trying to describe sentences from the immunology text book.

Exsample-1

T-cell is stimulating by the antigen,and proliferation,but T-cell not become antigen product cell.

caution.

"-" sysmbol is separating sysmbol, and can not be used registor in statement.

",)" is representing null string. 

NAL is negative AL statement,Representing NOT.  


CC(*MW+*T+0+*N+0+name+T_cell)
-AL(0,name+T_cell,)
-AL(0,script,stimulating_antigen)
-INC(*T)
-AL(0,script,proliferation)
-INC(*T)
-NAL(0,name+antigne_producting_cell)  






Example-2

It needs T-cells function that B-cell will be antibodies prodcting cell.

CC(*MW+*T+0+1+0+name+B_cell,*MW+*T+0+1+0+name+T_cell)
-AL(0,name+B_cell,)
-INC(*T)
-AL(0,name+antibody_prodcting_cell,)
-AL(1,name+T_cell,)
-INC(*T)
-AL(0,script,antibody_producting)




例3

例えば全身放射線照射をしたマウスに胸腺リンパ球、あるいは骨髄リンパ球を単独に移入して抗原刺激を加えても抗体産生は起こらない。

CC(*MW+*T+0+*N+0+name+マウス)
−AL(0,name+マウス,)
−AL(0,script,全身放射線照射)
−INC(*T)
−AL(0,verb+入れる,胸腺リンパ球)
−INC(*T)
−AL(0,script,抗原刺激)
−INC(*T)
−NAL(0,script,抗体産生)




CC(*MW+*T+0+*N+0+name+マウス)
−AL(0,name+マウス,)
−AL(0,script,全身放射線照射)
−INC(*T)
−AL(0,verb+入れる,骨髄リンパ球)
−INC(*T)
−AL(0,script,抗原刺激)
−INC(*T)
−NAL(0,script,抗体産生)

同意語変換

CC(*MW+*T+0+*N+0+name+T細胞)
−AL(0,name+T細胞,)
−AL(0,name+T細胞+骨髄リンパ球,)


スクリプトの内部の値の種類としてのスクリプトを展開する場合には入れ子構造としての時間で表記する。

時間について一般作用素表記にする。
CC(*MW+*T+0+1+0+*KV)
を頭部に持つ事により以下の作用素適用を可能にする。
または、等のORの表現は高速化のために別々の作用素として記述する。


1 2 3 4 5 6 7 8 9  時間
初期状態
○−○−○
○−○−○−○−○−○ スクリプト2
スクリプト1  ○−○−○−○
            ○−○−○
            目標状態

(○ ALステートメント)





scriptと言うタグを用いて抽象的な表現を行なう。この表現により細部への展開も評価関数の値により起こる。
これはあるscriptで定義したものの細部が必要な場合には探索に於ける評価関数の値に依って細部を定義した作用素が用いられることである。
もしも、具体的な記述を使用することなく評価関数の値が目標値に近付いて行く場合には具体的な記述に関しての探索は省略されることとなる。
この細部への展開の際には現在の時間に書かれているレジスタの上にさらに上に書込む。
もしも、抽象的な表現のみで探索が可能ならば具体的な存在について記述してある作用素は必要ないのである。
しかし、知識、情報と言うものは元々、実世界のものであるのであるから実世界の存在に直接関係の有るものとして還元される必要が有る。
さらには、自己組織的な学習では実世界の情報から推論を行なうものであり、概念も対象も存在しない所から始めなければならないとすれば、教示が学習を著しく促進するにせよ完全にボトムアップの学習が可能でなければならない。
このシステムのALではそれは実現はされていないが、考え方として必要と思われる。


初期状態のレベル
         −−−
            −−−
               −−−
                  −−−
                      目標状態のレベル



ALは知識表現であり、当初はこれを用いたエキスパートシステムを作成することを考えていたのである。使用方法としては、書籍に載っている知識を人間が全体を理解することなしにALでの作用素表現として記述して推論を行なわせることである。
断片的な知識を記述することで全体の推論を機械で行なうことを目的としたのである。
この様なことが可能ならば、ALを記述する技術を持つ者が複数存在すれば大量の知識をALに翻訳して機械的に大規模な人間を越える推論を可能にすることができる。
しかし、属性値を統一しないことにはALの対象の記述が不可能であり、属性値を統一することは記述する人間がALでの属性を全て把握する必要があるのである。
これでは知識全部を人間が把握した上で記述する必要があるので最初の目的と反する。
これには属性値の獲得が自己組織的にシステムが行なわなければならないことを示すものである。



実世界とAL表現

実世界の情報はビットマップで構成されるが、これを記号推論のALの考え方につなげることを試みることにする。
シャンクのスクリプト理論で例として用いられているものにレストランの例題が有る。
これは、レストランに入った客がとる行動を、特定の台本を演じているものとして考えるものである。客がレストランに入ると、テーブルに座り、メニューを見て、ボーイを呼び注文する。食べ終われると代金を支払い、店をでる。
細かい動作を別にするとレストランで客がとる行動は類型化している。




場面(スクリプト)
           時間 →

対象1        対象1        対象1
属性1        属性1        属性1
属性2        属性2        属性2

対象2        対象2        対象2

対象3        対象3        対象3


このレストランの場面は常にどの対象についても成り立つわけではない。対象として良いものには条件が有る。例えば対象1はレストランの客であるとする。
それが、レストランに入って来た対象が犬であった場合どうであろうか。このレストランのスクリプトを作用素として適用することは不適切である。
その条件として働くものは対象を構成する属性である。
この場合には洋服を着ている事や、身体的に人間であると認められる事柄が人間である対象を構成している属性となる。








対象の確立と知識の一般化

ALでは対象と成るものは予め人間が記述することを前提としている。
しかし、実世界には対象が対象であることは最初から分っている訳ではない。
システムにあるパターンが与えられたとする。与えられたパターンと一致するものが無い場合には与えられたパターンを光学的ぼやけ等の処理を行なって似たようなパターンを検索する。
コグニトロンの様な特徴検出細胞を通すことは多対一のぼやけ処理の一つで有ると思われる。
基本的には単純な連想から成るものであり、対象を一つの対象として認識する必要性と言うものは、これから先に今までと同じでない場面に遭遇した場合に今までの経験に有る場面を繋ぎ合わせることで対処しようと言うものである。
対象と言うものが対象として明瞭に記号的に区切られるものでは無く、個々の人間の経験に拠るものと言葉に対応したものである。
記号は実世界のものを指したものである。




ALと実世界への接続

対象とは何か

対象は複数の属性から成り立つ、属性は対象として扱うことが出来る。
また場面も対象として扱うことが可能である。
未来と言う概念も時間を対象として扱っているものである。

対象と操作

推論には対象が存在する。対象は属性に分解できる。属性は対象を構成する。
時間さえも対象として扱うことが可能である。
場面も対象である。仮想的な次元も、平行世界も繰返し構造全体も
全てが対象として扱うことが出来る。

表象主義的な人工知能は記号を用いるが、形式論的なモデルそのものが否定される訳ではない。
それは、どの様に扱うかの問題である。逆に考えて見れば述語論理で画像を直接的に学習可能であるかどうかを問うことでも理解できよう。
画像データも最終的には個々のビットの集合である。
ビットで表現できるものは記号でも可能である。
記号でも可能であると言うことが意味することは、一つの概念を表わすのに数個の記号で表現するのではなく画像のピクセルに対応する記号としてのものである。
記号が文字どおり画像を形成するほどに使用するのである。

この様な記号の利用の仕方で状況意味論を用いた推論を行なう。
表象主義と言うもの自体は実世界の場面、状況と関係なく一般化された対象間の関係を記述するものである。論理学は歴史的に日常の状況、場面から純粋な単純化された関係を取り出すことに目的が置かれたのである。これは今までの計算機資源の関係から支持されたものであり。本来的な知能の実現とはやや離れるものがある。































3.変数

変数には半角で「*」を最初に付ける。以下に変数をレジスタと表現する事がある。
例としては

*A
*B
*Width
*大きさ
*重さ

変数の名称は大文字、小文字を区別し変数と成る文字列は日本語でも可能である。変数の名称に使用できる文字の長さは使用するBASIC言語と計算機資源に依存する。


変数の型

この言語には変数に型は存在しない。代入するものは文字でも数値でも扱うことが出来る。
数値の場合には単精度の浮動小数として計算される。これは使用するBASICに依存する。
文字を四則演算しようとすると、ゼロとして扱う。


定数の型

定数の型は以下のものが利用できる。
整数、浮動小数、文字列、リスト


配列変数としての扱い

この言語では以下の様な変数の表記が可能である。

例
*A+*B+*C
*A+2+3
*ADDRESS+東京都+文京区


代入の仕方
例として

LD(*A+*B+*C,ABC)
LD(*A+2+3,123)
LD(*ADDRESS+東京都+文京区,なんとか会社)


リスト

この言語では入れ子構造無しのリストを変数の値として扱う事が出来る。

例
*A=a_b_c_d

_は半角のスペースを用いる。

リストを操作するステートメントとして以下のものがある。
(詳細はステートメントマニュアルを参照)

MOVE(項1,項2) 項2に項1からリストの左端の物を取りだし代入。
MOVE({代入されるレジスタ},{代入される位置},{代入する項},{位置})
LD({代入されるレジスタ},{代入される位置},{代入する項},{位置})
APP({代入されるレジスタ},{結合する項})
LEN({代入されるレジスタ},{対象となる項},{機能})
SORT(レジスタ)



入れ子構造のリストを用いない理由

LISPのS式の表現で有効と思われる事は入れ子構造としての知識表現であり、柔軟な知識表現が可能である。しかし、入れ子構造のリストを高速に検索、操作することは困難である。

入れ子構造と言う物はモデルの内部に又モデルを表記する事である。
レジスタの属性表現こそが入れ子構造の表記として有効に働く物と思われる。
この表現の仕方はコンパイラを想定した場合そのまま変数の配列に変換できるので速度的に有利であると思われる。

4.作用素、ステートメント、コマンド

作用素

作用素はステートメントから成り立つ。

作用素はステートメントを − でつないで表現する。
LD(*A,1)−LD(*B,2)−LD(*C,3)

ある状態に対して作用素は、構成するステートメントが全部実行可能ならば成立する。
BASIC的な表現で
IF A=1 THEN B=5
と言う表現は
eq(*A,1)−LD(*B,5)
とこの言語では表現する。

明瞭に条件部と実行部に分けていないが、ステートメントとして実行可能かどうかを見ることでこれに対応している。


ステートメント

最初の状態の設定や探索の実行、作用素に使用する。
文法的に誤りが合った場合には、実行時に誤った箇所が表示される。


コマンド

作用素データのセーブ、ロード、探索の制御用のバッチファイルのセーブ、ロード
画面の消去、モデル世界のレジスタ内容の消去、表示
その他は、コマンドの一覧を参照
これらの操作を行なう為に用いる。








5.実行の手順

探索を行なう為には、作用素を記述して、探索を制御する為のバッチファイルを作成する。

起動した直後には、探索制御の為の画面が表示される。
+をコマンドとして実行すると画面が切換わり、作用素の編集画面に移る。
もう一度、+を実行すると元の探索制御の画面に移る。

N88BASICではLINE INPUTでスクリーンエディターが簡単に出来た。しかし、Quick BASICでは一行しか入力できないので、作用素の編集や、探索制御のバッチファイルを作成する場合には、他のエディターを使用する方が良い。

GUESSステートメントを用いると拡張子「SAK」のテンポラリーファイルが作成される。実行後の各モデル世界の確認のために消去は手動で行なうようになっている。

























6.例1 迷路

迷路を解く場合には、迷路の分岐点に名称を付けて、どこに通じているかを記述していく。

入口をINとして出口をOUTとする。

INからはAに通じている。
AはBとCに通じている。
CはDとEに通じている。
EはKとFに通じている。
FはGとHに通じている。
HはIとJに通じている。
EはJに通じている。
Jは出口のOUTに通じている。

これを作用素として表現すると以下の様になる。
場所を表わす変数として*Pを用いる。


作用素ファイル ファイル名 MAZE

eq(*P,IN)-LD(*P,A)
eq(*P,A)-LD(*P,B)
eq(*P,A)-LD(*P,C)
eq(*P,C)-LD(*P,D)
eq(*P,C)-LD(*P,E)
eq(*P,E)-LD(*P,K)
eq(*P,E)-LD(*P,F)
eq(*P,F)-LD(*P,G)
eq(*P,F)-LD(*P,H)
eq(*P,H)-LD(*P,I)
eq(*P,H)-LD(*P,J)
eq(*P,E)-LD(*P,J)
eq(*P,J)-LD(*P,OUT)





探索制御のバッチファイル ファイル名 メイロ

LD(*P,IN)
SEARCH(MAZE,eq(*P,OUT))


この2つをファイルとして作成する。ステートメント、括弧、アスタリスク、カンマは半角で入力する。
変数名、変数の値は全角でも良い。
作用素のファイルを拡張子無しでMAZE、探索制御のバッチファイルをメイロとする。
拡張子は付けても付けなくても良い。


「プログラム作成プログラム」を起動する。

プログラム作成プログラム Version 7.2
Copyrighted By T.Ishizaki 1992(c)
500 Functions Free

Ready
_


以上の画面が表示される。_はカーソルを表わす。
500 Functions Freeは500のデータを作用素、探索制御のバッチファイルでそれぞれ扱うことが可能であることを表示している。プログラムのソースの一番最初のM=500を書換えることで変更できる。
作用素のデータが500と探索制御のバッチファイルのデータが500ずつと言う意味である。
ここで、作成した探索制御のバッチファイルを読み込む。
コマンド、ステートメントは全て半角で入力する。
半角で

LOADメイロ・

を実行するとファイルの読み込みが出来たのであれば

Ready
_
が表示される。
LIST・を実行すると

1 LD(*P,IN)
2 SEARCH(MAZE,eq(*P,OUT))

Ready
_

と表示される。

この行番号は編集の為に便宜的に付けたものであるので、データをセーブする際には取除かれる。

1 LD(*P,IN)

LDステートメント

LD(変数名,代入するもの)

代入するものには変数を指定可能である。





2 SEARCH(MAZE,eq(*P,OUT))

SEARCHステートメント、盲目探索を実行する為のステートメント
目標が達成するまで、全ての組合せを試す。

SEARCH(作用素ファイル名,目標条件と成るステートメント)

目標条件は複数のステートメントを使用することが出来る。
作用素ファイル名の拡張子は何でも良い。






探索の実行

RUN・

を実行すると以下の様な結果が出力される。

RUN
推論中

****    探索条件達成    ****

0 桁

*P = IN
1 桁 eq(*P,IN)-LD(*P,A)

*P = A
2 桁 eq(*P,A)-LD(*P,C)

*P = C
3 桁 eq(*P,C)-LD(*P,E)

*P = E
4 桁 eq(*P,E)-LD(*P,J)

*P = J
5 桁 eq(*P,J)-LD(*P,OUT)

*P = OUT


探索を継続しますか(Y/N)? n
所要時間 8 秒 組合せ 299

Rady
_




「探索を継続しますか?」の表示にたしてy・を入力した場合には他の解答の探索を開始する。ここで用いた探索ステートメントSEARCHは、全ての可能な作用素の適用の組合せを実行する。目標条件に合う組合せである場合には、上に記したような「目標条件達成」の表示と変数(レジスタ)と使用した作用素の経過を表示する。

探索制御のバッチファイルでは0桁のモデル世界の変数(レジスタ)を操作できる。
0桁のモデル世界とは最初の状態である。
探索ステートメントSEARCHに設定したeq(*P,OUT)が目標条件となり探索が行なわれる。

この迷路の問題を拡張して、各地点間の距離を作用素に記述し評価関数を用いる探索ステートメントを利用すれば最短経路を求める問題や、巡回セールスマン問題(TSP)を解くことが可能である。



























7.例2 ハノイの搭、パターンマッチを利用の例

 「プログラム作成プログラム」ではパターンマッチを利用して作用素を記述することが可能である。パターンマッチを利用することで一般化された作用素を記述することができ、必要な作用素の数を減らすことが出来る。

パターンマッチの例


作用素ファイル CCTEST

CC(*A+*B+*C+*D)-PRC(###########,B = ,*B,C = ,*C,D = ,*D)

探索制御のバッチファイル CCCTEST

LD(*A+6,3)
LD(*A+4+5,2)
LD(*A+1+2+3,1)
GUESS(CCTEST,eq(*D,3))

CCステートメントは変数(レジスタ)とパターンマッチを行なうステートメントである。

*A+6という変数に対して、作用素の最初のステートメントのCC(*A+*B+*C)を適用すると、*A+6と*A+*B+*Cがパターンマッチする。

*A+6
*A+*B+*C

*Bに6が代入され、*Cには値が無いので何も代入されない。
この作用素の次のステートメントを実行すると

CC(*A+*B+*C)-PRC(###########,A = ,*A,B = ,*B,C = ,*C)

PRCステートメントにより変数(レジスタ)の内容が表示される。
PRCステートメントは改行付きの表示を行なうものであり、引数の最初に半角のアスタリスク(*)がある場合には変数の内容を表示する。



ハノイの搭

ハノイの搭は人工知能の教科書に良く例題として用いられているものであるが、Lispなどの言語を用いて再帰的に解いているものが殆どである。
以下に示す解き方は、初期状態として*B+1の棒から隣の*B+2の棒へ円板を移す事を試行錯誤的に行なうものである。


作用素ファイル ファイル名 HANOI

CC(*B+*C1,*B+*C2)-ne(*B+*C2,)-eq(*B+*C1,)-MOVE(*B+*C2,*B+*C1)
CC(*B+*C1,*B+*C2)-ne(*B+*C2,)-<:(*B+*C2,*B+*C1)-MOVE(*B+*C2,*B+*C1)


探索の制御ファイル ファイル名 RPHANOI

LD(*B+1,1 2)
LD(*B+2,)
LD(*B+3,)
search(hanoi,eq(*B+2,1 2))



作用素の説明
一行め
CC(*B+*C1,*B+*C2)-ne(*B+*C2,)-eq(*B+*C1,)-MOVE(*B+*C2,*B+*C1)
CCステートメントでレジスタの先頭が*Bのレジスタを2つ選択する。
選択したレジスタ*B+*C2がヌルでなく、*B+*C1がヌルの場合には*B+*C1に*B+*C2の要素を一つ移動させる。

2行め
CC(*B+*C1,*B+*C2)-ne(*B+*C2,)-<:(*B+*C2,*B+*C1)-MOVE(*B+*C2,*B+*C1)
CCステートメントで2つのレジスタを選択する。
*B+*C2がヌルでなく、*B+*C1の方が*B+*C2より大きい場合に*B+*C1に*B+*C2の要素を一つ移動する。
リストを数値として比較する場合には先頭の要素を評価する。




探索の制御ファイルの説明

LD(*B+1,1 2)
LD(*B+2,)
LD(*B+3,)

棒1、棒2、棒3の状態を設定する。
棒1に「1 2」の円板が乗っていることを記述している。

search(hanoi,eq(*B+2,1 2))
hanoiの作用素ファイルを使用して盲目探索を実行する。
*B+2の値が「1 2」になることを目標として設定している。

探索を実行するにはRUN・を実行する。


























8.例3 エイトパズル、評価関数を用いた探索の例

数字を順番に並べ変えるもので「*」は空の状態を示す。
一つずつ数字を移動して目標状態にする。

最初の状態         目標状態

*52           123
843           456
716           78*



作用素ファイル ファイル名 8パズル

eq(*1,)-LD(*R,*2)-LD(*2,)-LD(*1,*R)
eq(*1,)-LD(*R,*4)-LD(*4,)-LD(*1,*R)
eq(*3,)-LD(*R,*2)-LD(*2,)-LD(*3,*R)
eq(*3,)-LD(*R,*6)-LD(*6,)-LD(*3,*R)
eq(*2,)-LD(*R,*1)-LD(*1,)-LD(*2,*R)
eq(*2,)-LD(*R,*3)-LD(*3,)-LD(*2,*R)
eq(*2,)-LD(*R,*5)-LD(*5,)-LD(*2,*R)
eq(*4,)-LD(*R,*7)-LD(*7,)-LD(*4,*R)
eq(*4,)-LD(*R,*5)-LD(*5,)-LD(*4,*R)
eq(*4,)-LD(*R,*1)-LD(*1,)-LD(*4,*R)
eq(*5,)-LD(*R,*2)-LD(*2,)-LD(*5,*R)
eq(*5,)-LD(*R,*4)-LD(*4,)-LD(*5,*R)
eq(*5,)-LD(*R,*6)-LD(*6,)-LD(*5,*R)
eq(*5,)-LD(*R,*8)-LD(*8,)-LD(*5,*R)
eq(*6,)-LD(*R,*3)-LD(*3,)-LD(*6,*R)
eq(*6,)-LD(*R,*5)-LD(*5,)-LD(*6,*R)
eq(*6,)-LD(*R,*9)-LD(*9,)-LD(*6,*R)
eq(*7,)-LD(*R,*4)-LD(*4,)-LD(*7,*R)
eq(*7,)-LD(*R,*8)-LD(*8,)-LD(*7,*R)
eq(*8,)-LD(*R,*7)-LD(*7,)-LD(*8,*R)
eq(*8,)-LD(*R,*5)-LD(*5,)-LD(*8,*R)
eq(*8,)-LD(*R,*9)-LD(*9,)-LD(*8,*R)
eq(*9,)-LD(*R,*6)-LD(*6,)-LD(*9,*R)
eq(*9,)-LD(*R,*8)-LD(*8,)-LD(*9,*R)

探索の制御のファイル ファイル名 eight

LD(*1,2)
LD(*2,3)
LD(*3,6)
LD(*4,1)
LD(*5,5)
LD(*6,4)
LD(*7,7)
LD(*8,)
LD(*9,8)
GUESS(8パズル,eq(*1,1)-eq(*2,2)-eq(*3,3)-eq(*4,4)-eq(*5,5)-eq(*6,6)-eq(*7,7)-eq(*8,8)-eq(*9,))


LD命令で初期状態を設定する。
GUESSステートメントで探索を実行する。
このステートメントは設定した目標条件のステートメントが成立する個数を評価として探索を行なう。

ハノイの搭は一般化された作用素を用いているので動作速度は遅くなる。
CCステートメントを用いた一般化された作用素はdebugも困難であるので、一つ一つの規則について作用素を記述していく方が確実で実行も速い。
この問題では外部評価関数として、それぞれの数字の位置を設定すると問題の解決は速くなる。















9.例4 外部評価関数探索の例

外部評価関数の動作をテストするための例である。
X+Y=5に成るXとYを−10≦X −10≦Yの範囲で求める。

作用素ファイル ファイル名 TESTES

add(*X,1,*X)
add(*Y,1,*Y)



探索の制御のファイル ファイル名 ES

LD(*X,0)
LD(*Y,0)
EST(w,add(*EST,*X,*Y))
GUESS(TESTES,=:(*EST,5)-PRC(*EST))


探索の制御のファイルの説明

EST(w,add(*EST,*X,*Y))
評価関数をX+Yに設定する。

GUESS(TESTES,=:(*EST,5)-PRC(*EST))
評価関数の値が5に成ることに目標を設定する。

探索を継続して行くと、XとYの値が同じ組が出て来るが、これは作用素の順番が違う場合も数えているからである。
X=1とY=4が答えの場合でも、Xに1を足す順番がYの後になるかその次になるかの組合せが出来るのでX=1,Y=4の答えは複数出て来る。








経路探索の例

ある点からある点への移動経路を探索する例。
座標(18,4)から座標(15,7)までの探索を行なう。

作用素ファイル ファイル名 DIST

add(*Y,1,*Y)
add(*X,1,*X)
sub(*X,1,*X)
sub(*Y,1,*Y)

探索の制御のファイル ファイル名 DIS

LD(*X,18)-LD(*Y,4)
EST(w,LD(*L,*X)-sub(*L,15,*L)-mul(*L,*L,*L))
EST(w,LD(*L1,*Y)-sub(*L1,7,*L1)-mul(*L1,*L1,*L1))
EST(w,add(*L,*L1,*L)-sub(50,*L,*L)-LD(*EST,*L))
GUESS(DIST,eq(*X,15)-eq(*Y,7))


評価関数にL=−(X^2+Y^2)を設定している。
探索は評価関数の値が最大になるように行なうように出来ているので、最小の距離を求める場合には全体の式にマイナスを掛ける。
















10.ステートメント、コマンドのマニュアル


ステートメントの解説


[ 比較 ]

項はレジスタ、定数のどちらでもよい。


数値の比較

=:(項1,項2)   項1=項2
¥:(項1,項2)   項1キ項2
<=(項1,項2)   項1<=項2
>=(項1,項2)   項1>=項2
<:(項1,項2)   項1<項2
>:(項1,項2)   項1>項2



文字の比較

eq(項1,項2)   項1=項2
ne(項1,項2)   項1キ項2



[ 算術 ]



項1,項2で四則演算をし結果を項3に代入する。項3は必ずレジスタを指定。

add(項1,項2,項3)   項1+項2=項3
mul(項1,項2,項3)   項1*項2=項3
div(項1,項2,項3)   項1/項2=項3
sub(項1,項2,項3)   項1−項2=項3
mod(項1,項2,項3)   項1 mod 項2=項3
絶対値

ABS(代入されるレジスタ,対象)
対象の絶対値をレジスタに代入する。
対象が数値以外の時は0が代入される。


乱数

RND({代入されるレジスタ},{範囲となる整数})

0から範囲となる整数の値の合いだの乱数をレジスタに代入する。


[ 表示 ]

PRT(項1,項2,項3,...)   項を全て表示、表示の後改行しない。
PRC(項1,項2,項3,...)   項を全て表示した後改行する。


[ 入力 ]

INP(項)    キーボードからの入力、項はレジスタのみ。


[ 代入 ]

LD(項,項2)  項1に項2を代入、項1はレジスタ。

MOVE(項1,項2) 項2に項1からリストの左端の物を取りだし代入。

例

  操作
  
  LD(*A,1 2 3)
  LD(*B,a b c)
  MOVE(*A,*B)


  結果

  *A=2 3
  *B=1 a b c

リスト操作ステートメント

LD({代入されるレジスタ},{代入される位置},{代入する項},{位置})

位置としてLを指定すると最も左の位置を指定したのと同値
位置としてRを指定すると最も左の位置を指定したのと同値

代入が行なわれない場合には処理不可フラグが1となる。

例
 
操作
   LD(*A,1 2 3)
   LD(*B,a b c)
   LD(*A,L,*B,2)

結果

   *A=b 2 3
   *B=a b c

MOVE({代入されるレジスタ},{代入される位置},{代入する項},{位置})
位置としてLを指定すると最も左の位置を指定したのと同値
位置としてRを指定すると最も左の位置を指定したのと同値

代入が行なわれない場合には処理不可フラグが1となる。

例
 
操作
   LD(*A,1 2 3)
   LD(*B,a b c)
   MOVE(*A,L,*B,2)


結果

   *A=b 1 2 3
   *B=a c



リストの結合

APP(代入されるレジスタ,結合する項)

代入するレジスタの内容のリストに結合する項をリストとしてつなぐ。



リスト、文字列の長さ

LEN({代入されるレジスタ},{対象となる項},{機能})

機能  L  対象となる項のリストの個数をレジスタに代入する。
    S  対象となる項の文字列の文字の数をレジスタに代入する。


リストの並べ変え

SORT(レジスタ)

レジスタ内容のリストをASCIIコード順に並べ変えを行ない同名のレジスタに代入する。











文字列操作

代入が行なわれないと処理不可フラグが1となる。

LEFT$(代入されるレジスタ,対象となる項,文字数)

RIGHT$(代入されるレジスタ,対象となる項,文字数)

MID$(代入されるレジスタ,対象となる項,位置,文字数)

位置は整数で指定。



[ 探索用ステートメント ]


探索桁

X(レジスタ)

現在の探索桁をレジスタに代入する。

レジスタ数

P(レジスタ)

現在の探索桁に存在するレジスタ数を返す。


探索目標

GOAL

引数はない。
このステートメントを実行すると適用した作用素の番号、それぞれの探索桁のレジスタを表示、探索を終了する。
このステートメントは作用素中で用いる事はしない。


パターンマッチ

CC(レジスタ1,レジスタ2,レジスタ3,....)

作用素の先頭のみに許されるステートメントである。
パターンマッチ可能なレジスタに対してパターンマッチを行ない、作用素内の次のステートメントを実行する。
このステートメントに与えられた引数に対して全ての組合せのパターンマッチを行なう。
例
  *A+1+3
  *A+2+2
  *A+3+1

上記のレジスタに対して

CC(*A+*B+*C)−PRC(*B,*C)

                        の作用素を適用する。

*B、*Cレジスタは*Aの添字に対しパターンマッチを行なう。

この場合、

  *B=1  *C=3  としてつぎのPRCステートメントを実行する場合
  *B=2  *C=2  としてつぎのPRCステートメントを実行する場合
  *B=3  *C=1  としてつぎのPRCステートメントを実行する場合

の3つの組合せがある。


探索実行ステートメント

評価関数探索

GUESS({作用素ファイル},{探索条件})

現在のモデル世界に対してどの程度、探索条件を達成しているかが評価関数とする。探索はこの評価関数に従って、評価関数値の高い作用素から先に適用する。
評価関数は、探索条件その物が達成できた数、内部評価関数、別に定義する物の2つ種類がある。外部評価関数


外部評価関数定義

EST({機能},{評価関数となるステートメント})

機能

{c}クリア
{w}書込
レジスタ、*ESTの値を評価関数として探索に用いる。
*ESTの値をユーザーは任意に定義する。


段階探索

GUESS2({最大組合せ数},{作用素ファイル},{探索条件})

探索を行なう際の作用素の適用回数を予め設定する。作用素ファイルと探索条件の設定の仕方は他の探索ステートメントと同じである。
段階探索では、評価関数を使用するのではなく、一つ一つの探索条件を満たしながら探索を行なう事で最終的に探索条件全体を達成する作用素列を探すステートメントである。






コマンドの説明

コマンドは入力直後に直接実行される。
ほとんどのコマンドをBASICのインタープリタのものと似せて作ってあるが、4文字を超えるものは短略してある。


探索の実行

探索制御する手順を実行する
RUN

Z

作用素や探索の制御手順データの編集に使用する。
便宜上つけてある行番号を一つ空ける。
N88BASICでLINEINPUTでスクリーンエディタを使用する場合に
使用する。
N88BASIC以外の新しいBASICで使用する場合には、あらかじめ他のエディタを使用してデータを書くほうが効率が良い。

例
1 LD(*A,1)
2 LD(*B,2)
3 LD(*C,3)

Z2

1 LD(*A,1)
2
3 LD(*B,2)
4 LD(*C,3)


+
作用素編集画面に移動する。作用素編集画面でこのコマンドを使用するともとの画面に戻る。


*
レジスタの内容表示
*Aを実行するとX=0のレジスタの値が表示される。

new
作用素や探索実行手順の消去

LIST
リストの表示、Microsoft系のBASICに準拠している。

例
LIST
全部のリストの表示、「1」を押すことで表示を中断する。

LIST5
5番目の行のリストを表示する。

LIST −5
5番目までのリストの表示

LIST 2−5
2番目から5番目迄のリストの表示

LIST 5−
5番目以降のリストの表示

LLIS
BASICインタープリタでのLLISTの意味である。
プリンターにリストを表示する。
実行にはLPRINTを使用しているのでどのBASICでも問題無いと思われる。

SAVE[ファイル名]
データの保存

コマンドの直後にファイル名を入れること。スペースを入れると読み込む事が出来ない。その他はドライブディレクトリの指定も可能である

LOAD[ファイル名]
データファイルの読み込み

コマンドの直後にファイル名を入れること。スペースを入れると読み込む事が出来ない。

MERG[ファイル名]

ファイルの連結

現在あるデータに指定したファイルを連結する。
コマンドの直後にファイル名を入れること。スペースを入れると読み込む事が出来ない。

FILE
ディレクトリのファイル内容の表示


注釈

「’」

注釈の先頭に用いる。探索の制御ファイルでのみ使用できる。作用素ファイルには使用できない。

例
'     作用素ファイル
'     最短の距離を求める。
'
'
LD(*X,18)-LD(*Y,4)
EST(w,LD(*L,*X)-sub(*L,15,*L)-mul(*L,*L,*L))
EST(w,LD(*L1,*Y)-sub(*L1,7,*L1)-mul(*L1,*L1,*L1))
EST(w,add(*L,*L1,*L)-sub(50,*L,*L)-LD(*EST,*L))
GUESS(DIST,eq(*X,15)-eq(*Y,7))

動作がインタープリタであるので作用素中に使用すると計算量が増えるために使用できないようにしている。




















11.あとがき

 作用素ファイルは他にも色々とあったのであるが、Versionが合わないものや、実行にとても時間が掛るものであり、直に動作したものはこれらのものだけであった。
 草稿として書いたものはテキストで合計600KBytes有ったのであるが、不用な部分を削除して見るとだいぶ少ないものになってしまった。
まとめすぎて少なすぎたのではないだろうかと思う。要らないと思う部分が全体を構成する上で必要なのではないかとも思う。
この文章は記号レベルでの推論についてまとめたものである。実世界には対象と言う確立されたものは無く、対象を確立して行くことが必要と成る。
対象が確立されたものとしてではなく、対象と成るものをどの様に見出すかと言うことを次にまとめて見ようと考えている。
実世界を扱うにはビットマップレベルのデータを扱う必要が有る。そこで、ニューラルネットや検索テーブルを用いて記録パターンを検索する方法、差分エンジンを構成することを考える。



























12.「プログラム作成プログラム」のソースリスト

このソースリストはN88BASICかQick Basic 4.5で使用することを前提としている。
このプログラムは制作を開始したのが1985年であり、最終的にソースを改変したのが1992年である。かなり以前に制作し、Verの変更も有ったのでこの言語で使用する作用素データは色々有るのであるが、今回のVer7.2で使用できるものには数が限られている。
プログラムそのものには特に見るべき技術は無いが、知識表現の為の一つの考え方としての試作品として見てもらいたい。
あくまで、この言語は過渡的なものであり完成は有りえない。


F−BASIC386やF−BASIC95forWindowsでは以下の変更が必要である。この変更により動作可能である事を確認しているが、個別の機種に対してはそれぞれのコンパイラで行なう方がより安定な動作が望めるであろうと思われる。


235 ON ERROR GOSUB 30000
30000 KILL TMP$:RESUM