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 프로그래밍과 funktions primfunk
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 - 비트 컴파일에 리눅스 운영 체제를합니다. 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): 다음은 창조의 원인을 회수하는 데 어떠한 방법 조각이 메모리 ([], 심볼의 값은 0,이 유일하게 한 조각의 메모리를 참조하지 않습니다) :

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 . 프레임의 원인이 스레드를 env, 이름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]]] 이 - "어디 [원인 [원인 - 12]]] [단점 [원인 - 이름을 원인] [원인 - args 원인]]]
read> [ let [ [ cause [ cause-of 12 ] ] ] [ cons [ cause-name cause ] [ cause-args cause ] ] ] 읽기> [어디 [원인 [원인 - 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]] 이 - "세계화 [배열 - 새로운 10]]
read> [ globalize a [ array-new 10 ] ] 읽기> [세계화 [배열 - 새로운 10]]
out-> [] 아웃 -> []

in--> a 의 다른 작품 -> a
read> a 읽기> a
out-> ( [] [] [] [] [] [] [] [] [] [] ) 아웃 -> ([] [] [] [] [] [] [] [] [] [])

in--> [tracing_on-set at] 이 - "tracing_on - 세트에]
read> [ tracing_on-set a t ] 읽기> [tracing_on - 설정하는 t]
out-> [] 아웃 -> []

in--> [system_date] 이 - "system_date]
read> [ system_date ] 읽기> [system_date]
out-> ( date 1970 0 13983 6 29 7 526235 ) 아웃 -> (날짜 1970 0 13983 6 7월 29일 526235)

in--> [dotimes [i 5] [array-elt-set ai [+ i 10]]] 이 - "dotimes [전 5] [배열 - 영어 교육 관련 - 세트 또는 [+ 나는 10]]]
read> [ dotimes [ i 5 ] [ array-elt-set a i [ + i 10 ] ] ] 읽기> [dotimes [전 5] [배열 - 영어 교육 - 설정하는 전 [+ 나는 10]]]
out-> [] 아웃 -> []

in--> a 의 다른 작품 -> a
read> a 읽기> a
out-> ( 10 11 12 13 14 [] [] [] [] [] ) 아웃 -> (10 11 12 13 14 [] [] [] [] [])

in--> [remember a (date 1970 0 13983 6 28 44 908595)] 이 - "기억이 (날짜 1970 0 13983 6월 28일 44 908595)]
read> [ remember a ( date 1970 0 13983 6 28 44 908595 ) ] 읽기> [기억이 (날짜 1970 0 13983 6월 28일 44 908595)]
out-> ( [] [] [] [] [] [] [] [] [] [] ) 아웃 -> ([] [] [] [] [] [] [] [] [] [])

in--> a 의 다른 작품 -> a
read> a 읽기> 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]] 이 - "세계화 [배열 - 새로운 10]]
read> [ globalize a [ array-new 10 ] ] 읽기> [세계화 [배열 - 새로운 10]]
out-> [] 아웃 -> []

in--> [tracing_on-set at] 이 - "tracing_on - 세트에]
read> [ tracing_on-set a t ] 읽기> [tracing_on - 설정하는 t]
out-> [] 아웃 -> []

in--> [globalize dates [array-new 10]] 이 - "세계화 날짜 [배열 - 새로운 10]]
read> [ globalize dates [ array-new 10 ] ] 읽기> [세계화 날짜 [배열 - 새로운 10]]
out-> [] 아웃 -> []

in--> [dotimes [i 10] [array-elt-set dates i [system_date]] [array-elt-set aii]] 이 - "dotimes [전 10] [배열 - 영어 교육 관련 - 세트 개강일 전 [system_date]] [배열 - 영어 교육 관련 - 세트 모두]
read> [ dotimes [ i 10 ] [ array-elt-set dates i [ system_date ] ] [ array-elt-set a i i ] ] 읽기> [dotimes [전 10] [배열 - 영어 교육 관련 - 세트 개강일 전 [system_date]] [배열 - 영어 교육 - 설정하는 것]
out-> [] 아웃 -> []

in--> a 의 다른 작품 -> a
read> a 읽기> 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 ) 아웃 -> ((1970 0 13983 6 일 12월 19일 283811)
( date 1970 0 13983 6 12 19 561113 ) (날짜 1970 0 13983 6 12월 19일 561113)
( date 1970 0 13983 6 12 19 828195 ) (날짜 1970 0 13983 6 12월 19일 828195)
( date 1970 0 13983 6 12 20 94674 ) (날짜 1970 0 13983 6 12월 20일 94674)
( date 1970 0 13983 6 12 20 361727 ) (날짜 1970 0 13983 6 12월 20일 361727)
( date 1970 0 13983 6 12 20 629388 ) (날짜 1970 0 13983 6 12월 20일 629388)
( date 1970 0 13983 6 12 20 896560 ) (날짜 1970 0 13983 6 12월 20일 896560)
( date 1970 0 13983 6 12 21 163860 ) (날짜 1970 0 13983 6 12월 21일 163860)
( date 1970 0 13983 6 12 21 431032 ) (날짜 1970 0 13983 6 12월 21일 431032)
( date 1970 0 13983 6 12 21 699425 ) ) (날짜 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] 이 - "어디 [[력사, 풍속 0]] [dotimes [전 10] [세트 역사 [단점 [기억이 [배열 - 영어 교육 개강일 전]의 역사]]] 력사, 풍속]
read> [ let [ [ history [] ] ] [ dotimes [ i 10 ] [ set history [ cons [ remember a [ array-elt dates i ] ] history ] ] ] history ] 읽기> [어디 [역사 []]] [dotimes [전 10] [세트 역사 [단점 [기억이 [배열 - 영어 교육 개강일 전]의 역사]]] 력사, 풍속]
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!" 여기서는 하나 간단한 방법을 쓰는 사람이 "여러분, 안녕하세요!" 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 '!']] 이 - "어디 [[행성 '지구']] [포맷 표준 출력 '안녕하세요'행성 '!']]
read> [ let [ [ planet 'Earth' ] ] [ format stdout 'Hello ' planet '!' ] ] Hello Earth! 읽기> [어디 [[행성 '지구']] [포맷 표준 출력 '안녕하세요'행성 '!']] 안녕하세요 어스!
out-> [] 아웃 -> []


Here is how to define and subsequently call a funktion: 다음은 연속적으로 호출하는 방법을 정의하고 funktion :


in--> [defunk say-hi [x] [format stdout 'Why, hello there ' x '. 이 - "defunk 말 - 안녕하세요 [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] [포맷 표준 출력 '왜, 안녕하세요 점령한'합니다. 것은 정말 반갑다. ']]
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]]] 이 - "mapc [펑크 [x] [프린트 x]] [목록 1 2 3 # xff '개'`[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: 다음은 위의를 호출하는 방법을 우리의 병렬 스레드를 funktion :


in--> [prog [thread &say-hi [list 'Gerry']] nil] 이 - "프로그램 가능한 [나사 & 말할 - 안녕하세요 [리스트 '제리']] 0]
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]] 이 - "mapcar [펑크 [x] [+ × 10]] [목록 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]] 이 - "parcar [펑크 [x] [+ × 10]] [목록 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. 한 번 여러 컴퓨터에 대한 지원을 사용할 수로,이 변수가 변경이 필요 funktion - 번호로 기계를 인수하는 시스템의 스케줄러에 개체를 반환합니다.


in--> scheduler:global_scheduler 의 다른 작품 -> 스케줄러 : global_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 * : 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 * : 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 * : 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 * : 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 * : 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 * : 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 * : 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 * : 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 * : 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 * : 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 *