French フランス語 German ドイツ語 Greek ギリシャ語 Hindi ヒンディー語 Italian イタリア語 Japanese 日本語 Korean 韓国語 Portuguese ポルトガル語 Russian ロシア Spanish スペイン語

Funk2: Causal Reflective Programming funk2 :因果反射型プログラミング

Funk2: reflective programming language funk2 :反射型プログラミング言語



Overview概要


o または Supported systems サポートシステム
o または The goal の目標
o または How does it work? どのように動作しますか?
o または Examples of causal reflective programming 因果関係の例を反射型プログラミング
o または Basic programming examples 基本的なプログラミング例
o または Programming with primfunk funktions プログラミングprimfunk funktions
o または Programming with ptype objects ptypeオブジェクトプログラミング
o または Programming with primobject objects primobjectオブジェクトプログラミング
o または Current plan 現在の計画
o または Society of Mind final project ideas 心の社会ファイナルプロジェクトのアイデア
o または Downloads ダウンロード
o または Publications 出版物
o または Media presentations メディアプレゼンテーション
o または Developers 開発者


Supported systemsサポートシステム


Funk2 currently compiles on 32-bit and 64-bit Linux operating systems.コンパイルさfunk2現在32ビットおよび64ビットのLinuxオペレーティングシステムです。 64-bit pointers are recommended because of the amount of memory needed for the reflective capabilities; a 32-bit machine is currently only able to index a few gigabytes of memory. 64ビットのポインタが推奨さのために必要なメモリの量を反射能力;マシンは現在、 32ビットの数のみをインデックスに登録することギガバイトのメモリをします。



The goalの目標


The goal of the programming language Funk2 is to enable reflective algorithmic tracing for large heterogenous control systems.プログラミング言語の目標としてfunk2は、反射アルゴリズムのトレースを有効にする大規模な異種制御システムです。 A few point emphasized in the Funk2 programming language are:いくつかの点を強調してfunk2プログラミング言語は:

o または Layered Critical Causal Reflection層状の重要な因果反射
o または Efficient and Robust Control効率的かつロバスト制御
o または Learning by Credit Assignment学習クレジットの割り当て
o または Divergent Solution Paths発散解決策パス
o または Intricate Thread Control複雑なスレッド制御
o または Goal-oriented Learning目標指向の学習


How does it work?どのように動作しますか?

Examples of the most basic computational features include: (1) memory creation , (2) memory read , and (3) memory write .最も基本的な計算機能の例を含める: ( 1 ) メモリ作成 、 ( 2 ) メモリの読み取り 、および( 3 ) メモリの書き込みです。 Tracing all causal relationships between these basic features allows tracing the context of all other programmer-defined semantic abstractions .これらの間の因果関係をトレースのすべての基本的な機能により、トレースのコンテキストで他のすべてのプログラマ的に定義された意味の抽象化します。 All of these computational features create an intricate trace network of dependencies, automatically traceable and shared by many parallel threads of execution.これらのすべての計算機能のネットワークを作成するに複雑なトレース依存関係のため、自動的にトレーサブルと共有される多くのスレッドを並列実行します。 Funk2 allows causal tracing to occur modularly to dynamically chosen parts of large commonsense-scale artificial intelligence projects. funk2により、因果関係のトレースが発生する大規模なモジュールを動的に選択した部分を常識的な人工知能のプロジェクトです。 The resulting causal dependency trace networks can be processed by critical causal reflection threads.トレース結果の因果関係のネットワークの依存関係の重要な因果関係は、反射のスレッドによって処理されます。



Examples of causal reflective programming因果関係の例を反射型プログラミング



Here is how to retrieve the creation Cause for any piece of memory ( [] , the value of the symbol nil , is the only thing that does not reference a piece of memory):ここではどのように取得する任意の作品の創造の原因のメモリを( [ ]は、シンボルの値をnilには、唯一されていない作品のメモリを参照する) :

Note that in the Cause object there are multiple named slots holding information in the frame of the cause.オブジェクトの原因に注意してスロットには、複数の名前は、フレームの所蔵情報が表示さの原因です。 The frames of a Cause are thread , env , name , and args .原因は、 スレッドのフレームは、 環境名前 、およびargsします。 By default only 7 levels of recursion are printed to the screen.デフォルトで7のレベルの再帰のみが印刷して画面を表示します。 The symbol used for ending a recursion is the astrisk, * .In order to access the slots of an object, you can use funktions that are named to access and mutate objects.再帰を終えるために使われるのシンボルは、 astrisk 、 *です。スロットにアクセスするためには、オブジェクトの名前を使用することができますfunktions変異のオブジェクトにアクセスしてください。 For example, the following example shows how to retrieve only the name and args slots of a cause object.たとえば、以下の例の名前のみを取得する方法を示してスロットが原因とargsオブジェクトを作成します。


in--> [let [[cause [cause-of 12]]] [cons [cause-name cause] [cause-args cause]]] で-" l et[ [原因[原因- 1 2] ] ] [短所[原因-名原因] [原因- a rgs原因] ] ]
read> [ let [ [ cause [ cause-of 12 ] ] ] [ cons [ cause-name cause ] [ cause-args cause ] ] ] 読み取り> [ let [ [ 原因 [ 原因- 12 ] ] ] [ 短所 [ 原因-名原因 ] [ 原因- args原因 ] ] ]
out-> [ primfunk:read #xb7f03420 ] アウト- > [ primfunk :読み取り# xb7f03420 ]


Here is an example of how to remember the state of an object at specific historical points in time:ここでは、例をどのようにするオブジェクトの状態を記憶して特定の歴史的なポイントを時間:


in--> [globalize a [array-new 10]] で-"グローバル化する[配列-新しい1 0] ]
read> [ globalize a [ array-new 10 ] ] 読み取り> [ グローバル化、 [ 配列-新しい10 ] ]
out-> [] アウト- > [ ]

in--> a の作品-> 、
read> a 読み取り>
out-> ( [] [] [] [] [] [] [] [] [] [] ) アウト- > [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]

in--> [tracing_on-set at] で-" t racing_on-設定され]
read> [ tracing_on-set a t ] 読み取り> [ tracing_on -を設定するt ]の
out-> [] アウト- > [ ]

in--> [system_date] で-" s ystem_date]
read> [ system_date ] 読み取り> [ system_date ]
out-> ( date 1970 0 13983 6 29 7 526235 ) アウト- > 日付一九七〇 〇一三九八三六二九七五二六二三五

in--> [dotimes [i 5] [array-elt-set ai [+ i 10]]] で-" d otimes[私5 ] [配列- e lt-セット愛[ +私1 0] ] ]
read> [ dotimes [ i 5 ] [ array-elt-set a i [ + i 10 ] ] ] 読み取り> [ dotimes [ 私5 ] [ 配列- elt -を設定する私 [ +私10 ] ] ]
out-> [] アウト- > [ ]

in--> a の作品-> 、
read> a 読み取り>
out-> ( 10 11 12 13 14 [] [] [] [] [] ) アウト- > 10 11 12 13 14 [ ] [ ] [ ] [ ] [ ]

in--> [remember a (date 1970 0 13983 6 28 44 908595)] で-"覚えて、 (日一九七〇 〇一三九八三六二八四四九〇八五九五) ]
read> [ remember a ( date 1970 0 13983 6 28 44 908595 ) ] 読み取り> [ 覚えて、 日一九七〇 〇一三九八三六二八四四九〇八五九五 ]
out-> ( [] [] [] [] [] [] [] [] [] [] ) アウト- > [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]

in--> a の作品-> 、
read> a 読み取り>
out-> ( 10 11 12 13 14 [] [] [] [] [] ) アウト- > 10 11 12 13 14 [ ] [ ] [ ] [ ] [ ]


Here is another example of how to remember the state of an object at specific historical points in time:ここでもう一つの例をどのようにするオブジェクトの状態を記憶して特定の歴史的なポイントを時間:


in--> [globalize a [array-new 10]] で-"グローバル化する[配列-新しい1 0] ]
read> [ globalize a [ array-new 10 ] ] 読み取り> [ グローバル化、 [ 配列-新しい10 ] ]
out-> [] アウト- > [ ]

in--> [tracing_on-set at] で-" t racing_on-設定され]
read> [ tracing_on-set a t ] 読み取り> [ tracing_on -を設定するt ]の
out-> [] アウト- > [ ]

in--> [globalize dates [array-new 10]] で-"グローバル化の日付[配列-新しい1 0] ]
read> [ globalize dates [ array-new 10 ] ] 読み取り> [ グローバル化の日付 [ 配列-新しい10 ] ]
out-> [] アウト- > [ ]

in--> [dotimes [i 10] [array-elt-set dates i [system_date]] [array-elt-set aii]] で-" d otimes[私1 0] [配列- e lt-セット日付私[ s ystem_date] ] [配列- e lt-セットa ii] ]
read> [ dotimes [ i 10 ] [ array-elt-set dates i [ system_date ] ] [ array-elt-set a i i ] ] 読み取り> [ dotimes [ 私10 ] [ 配列- elt -セット日付私 [ system_date ] ] [ 配列- elt -を設定する私私 ] ]
out-> [] アウト- > [ ]

in--> a の作品-> 、
read> a 読み取り>
out-> ( 0 1 2 3 4 5 6 7 8 9 ) アウト- > 0 1 2 3 4 5 6 7 8 9

in--> dates の作品->日程
read> dates 読む> 日程
out-> ( ( date 1970 0 13983 6 12 19 283811 ) アウト- > ( ( 日一九七〇 〇一三九八三六一二一九二八三八一一
( date 1970 0 13983 6 12 19 561113 ) 日一九七〇 〇一三九八三六一二一九五六一一一三
( date 1970 0 13983 6 12 19 828195 ) 日一九七〇 〇一三九八三六一二一九八二八一九五
( date 1970 0 13983 6 12 20 94674 ) 日一九七〇 〇一三九八三六一二二〇九四六七四
( date 1970 0 13983 6 12 20 361727 ) 日一九七〇 〇一三九八三六一二二〇三六一七二七
( date 1970 0 13983 6 12 20 629388 ) 日一九七〇 〇一三九八三六一二二〇六二九三八八
( date 1970 0 13983 6 12 20 896560 ) 日一九七〇 〇一三九八三六一二二〇八九六五六〇
( date 1970 0 13983 6 12 21 163860 ) 日一九七〇 〇一三九八三六一二二一一六三八六〇
( date 1970 0 13983 6 12 21 431032 ) 日一九七〇 〇一三九八三六一二二一四三一〇三二
( date 1970 0 13983 6 12 21 699425 ) ) 日一九七〇 〇一三九八三六一二二一六九九四二五 ) )

in--> [let [[history nil]] [dotimes [i 10] [set history [cons [remember a [array-elt dates i]] history]]] history] で-" l et[ [履歴なし] ] [ d otimes[私1 0] [設定の歴史[短所[覚えて、 [アレイ- e lt日程私] ]の歴史] ] ]履歴]
read> [ let [ [ history [] ] ] [ dotimes [ i 10 ] [ set history [ cons [ remember a [ array-elt dates i ] ] history ] ] ] history ] 読み取り> [ let [ [ 履歴[ ] ] ] [ dotimes [ 私10 ] [ 設定の歴史 [ 短所 [ 覚えて、 [ アレイ- elt日程私 ] ] の歴史 ] ] ] 履歴 ]
out-> [ ( 0 1 2 3 4 5 6 7 8 [] ) アウト- > [ ( 0 1 2 3 4 5 6 7 8 [ ]
( 0 1 2 3 4 5 6 7 [] [] ) 0 1 2 3 4 5 6 7 [ ] [ ]
( 0 1 2 3 4 5 6 [] [] [] ) 0 1 2 3 4 5 6 [ ] [ ] [ ]
( 0 1 2 3 4 5 [] [] [] [] ) 0 1 2 3 4 5 [ ] [ ] [ ] [ ]
( 0 1 2 3 4 [] [] [] [] [] ) 0 1 2 3 4 [ ] [ ] [ ] [ ] [ ]
( 0 1 2 3 [] [] [] [] [] [] ) 0 1 2 3 [ ] [ ] [ ] [ ] [ ] [ ]
( 0 1 2 [] [] [] [] [] [] [] ) 0 1 2 [ ] [ ] [ ] [ ] [ ] [ ] [ ]
( 0 1 [] [] [] [] [] [] [] [] ) 0 [ 1 ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
( 0 [] [] [] [] [] [] [] [] [] ) 0 [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
( [] [] [] [] [] [] [] [] [] [] ) ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] ]



Basic Programming Examples基本的なプログラミング例




Here is one straightforward way to write a "Hello world!"ここで1つの簡単な方法を書くためには" Hello World ! " program in the Funk2 language:プログラムが収録されfunk2言語:


in--> [print 'Hello world!'] で-"印刷'こんにちは世界! ' ]
read> [ print 'Hello world!' ] 読み取り> [ 印刷 ]ハローワールド! ' ]
'Hello world!' 'こんにちは世界! '
out-> 'Hello world!' アウト- > "ハローワールド! '


Here is another more advanced way to holla your planet:ここでは他の上級者向けの方法を連絡して別の惑星:


in--> [let [[planet 'Earth']] [format stdout 'Hello ' planet '!']] で-" l et[ [惑星'地球' ] ] [書式s tdoutに'こんにちは'惑星' !']]
read> [ let [ [ planet 'Earth' ] ] [ format stdout 'Hello ' planet '!' ] ] Hello Earth! 読み取り> [ let [ [ 惑星 '地球' ] ] [ 書式stdoutに 'こんにちは' 惑星 ' ! ' ] ] もしもし地球!
out-> [] アウト- > [ ]


Here is how to define and subsequently call a funktion:ここではどのように定義し、その後コールするファンクション:


in--> [defunk say-hi [x] [format stdout 'Why, hello there ' x '. で-" d efunk言ってやる-ハワイ[ x ]を[書式s tdoutに'なぜ、こんにちは[ x ]をします。 It is really great to see you.']] あなたに会うことは本当に素晴らしいです。 ' ] ]
read> [ defunk say-hi [ x ] [ format stdout 'Why, hello there ' x '.  It is really great to see you.' ] ] 読み取り> [ defunk言ってやる-ハワイ [ x ]を[ 書式stdoutに 'なぜ、こんにちは[ x ]をします。これは本当に素晴らしいを表示します。 ' ] ]
defunk say-hi [ x ] defunk 言ってやる-ハワイ [ x ]を
out-> [] アウト- > [ ]
in--> [say-hi 'Marvin'] が-"言ってやる-ハワイ'マービン' ]
read> [ say-hi 'Marvin' ] 読み取り> [ 言ってやる-ハワイ 'マービン' ]
Why, hello there Marvin. なぜ、マービンこんにちは。 It is really great to see you. あなたに会うことは本当に素晴らしいです。
out-> [] アウト- > [ ]


Here is how to loop over a list of values:ここでは、どうやってループ以上の値のリストを表示:


in--> [mapc [funk [x] [print x]] [list 1 2 3 #xFF 'dog' `[2 3]]] で-" m apc[ファンク[ x ]を[プリントx ] ] [リスト1 2 3 # x ff'犬' ` [ 2 3 ] ] ]
read> [ mapc [ funk [ x ] [ print x ] ] [ list 1 2 3 #xff 'dog' ` [ 2 3 ] ] ] 読み取り> [ mapc [ ファンク [ x ]を[ プリントx ] ] [ リスト1 2 3 # xff '犬' ` [ 2 3 ] ] ]
1 1
2 2
3 3
#xff # xff
'dog' '犬'
[ 2 3 ] [ 2 3 ]
out-> [] アウト- > [ ]


Here is how to call our funktion above in a parallel thread:ここで私たちファンクションを呼び出すにはどのように上で並列スレッド:


in--> [prog [thread &say-hi [list 'Gerry']] nil] で-"プログラミング[スレッド&言ってやる-ハワイ[リスト'ジェリー' ] ] n ilに]
read> [ prog [ thread &say &say-hi [ list 'Gerry' ] ] [] ] 読み取り> [ プログラム [ スレッド &言ってやる と言ってやる-ハワイ [ リスト 'ジェリー' ] ] [ ] ]
Why, hello there なぜ、こんにちは
out-> Gerry. アウト- >ゲリーです。 It is really great to see you. [] あなたに会うことは本当に素晴らしいです。 [ ]


Here is how to serially filter every element in a list:ここでの全ての要素がどのようにシリアルフィルタリストを表示:


in--> [mapcar [funk [x] [+ x 10]] [list 1 2 3 4 5]] で-" m apcar[ファンク[ x ]を[ + × 1 0] ] [リスト1 2 3 4 5 ] ]
read> [ mapcar [ funk [ x ] [ + x 10 ] ] [ list 1 2 3 4 5 ] ] 読み取り> [ mapcar [ ファンク [ x ]を[ + × 10 ] ] [ リスト1 2 3 4 5 ] ]
out-> [ 11 12 13 14 15 ] アウト- > [ 11 12 13 14 15 ]


Here is how to concurrently filter every element in a list:ここでの全ての要素がどのようにフィルタを同時に表示価格:


in--> [parcar [funk [x] [+ x 10]] [list 1 2 3 4 5]] で-" p arcar[ファンク[ x ]を[ + × 1 0] ] [リスト1 2 3 4 5 ] ]
read> [ parcar [ funk [ x ] [ + x 10 ] ] [ list 1 2 3 4 5 ] ] 読み取り> [ parcar [ ファンク [ x ]を[ + × 10 ] ] [ リスト1 2 3 4 5 ] ]
out-> [ 11 12 13 14 15 ] アウト- > [ 11 12 13 14 15 ]


The scheduler:global_scheduler variable in the global environment can be used as a reference to the global funk2 scheduler for the local machine. スケジューラ:地球環境変数をglobal_schedulerとして使うことができますグローバルfunk2スケジューラへの参照をして、ローカルマシンです。 Processor information available from "/dev/proc" during funk2 initial bootstrap compile is available for all machines currently logged into the grid.プロセッサから利用可能な情報" / devより/ procの"初期ブートストラップfunk2コンパイル時にすべてのマシンがご利用いただけますが、現在ログインして、グリッドのです。 Grid support is in development, this only shows this information for the local machine.グリッドの開発サポートは、これだけを示し、この情報を、ローカルマシンのです。 Once support for multiple machines is available, this variable will change into a funktion that takes a machine-id as an argument and returns that machine's scheduler object.一度は利用可能な複数のマシンのサポートを、この変数が変更さをファンクション番号を機械では、戻り値を引数として、そのマシンのスケジューラオブジェクトを作成します。


in--> scheduler:global_scheduler の作品->スケジューラ: g lobal_scheduler
read> scheduler:global_scheduler 読む> スケジューラ: global_scheduler
out-> [ scheduler アウト- > [ スケジューラ
:processors ( [ processor :プロセッサ ( [ プロセッサ
:mutation_mutex [ mutex] : mutation_mutex [ ミューテックス]
:scheduler [ scheduler :processors * ] :スケジューラ [ スケジューラ :プロセッサ * ]
:pthread #x40a00960 : pthread # x40a00960
:threads [ [ thread :スレッド [ [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env * :環境 *
:args * : args *
:return * :リターン *
:value * :値 *
:trace * :トレース *
:critics * :批評家 *
:cause_reg * : cause_reg *
:keep_undead * : keep_undead *
:parent_thread * : parent_thread *
:parent_env * : parent_env *
:execute_mutex * : execute_mutex *
:last_executed_time * ] : last_executed_time * ]
[ thread [ スレッド
:program_counter * : program_counter *
:stack * :スタック *
:iter * : ITERの *
:env