From c8bb547bea279af2bb48c13260f98aa8add07131 Mon Sep 17 00:00:00 2001 From: olpc user Date: Fri, 10 Jan 2020 14:55:19 -0800 Subject: move intellect-framework-from-internet into folder --- .../starts/bagel/README.md | 35 ++ .../starts/bagel/nascent1.js | 107 +++++ .../starts/bagel/nascent2.js | 172 ++++++++ .../starts/bagel/nascent3.js | 199 +++++++++ .../starts/bagel/nascent4.js | 242 +++++++++++ .../starts/bagel/nascent5.js | 382 +++++++++++++++++ .../starts/bagel/nascent6.js | 461 +++++++++++++++++++++ .../starts/bagel/notes-puzzle-metarelevence.txt | 100 +++++ .../starts/bagel/notes.txt | 145 +++++++ 9 files changed, 1843 insertions(+) create mode 100644 intellect-framework-from-internet/starts/bagel/README.md create mode 100644 intellect-framework-from-internet/starts/bagel/nascent1.js create mode 100644 intellect-framework-from-internet/starts/bagel/nascent2.js create mode 100644 intellect-framework-from-internet/starts/bagel/nascent3.js create mode 100644 intellect-framework-from-internet/starts/bagel/nascent4.js create mode 100644 intellect-framework-from-internet/starts/bagel/nascent5.js create mode 100644 intellect-framework-from-internet/starts/bagel/nascent6.js create mode 100644 intellect-framework-from-internet/starts/bagel/notes-puzzle-metarelevence.txt create mode 100644 intellect-framework-from-internet/starts/bagel/notes.txt (limited to 'intellect-framework-from-internet/starts/bagel') diff --git a/intellect-framework-from-internet/starts/bagel/README.md b/intellect-framework-from-internet/starts/bagel/README.md new file mode 100644 index 0000000..9996ce9 --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/README.md @@ -0,0 +1,35 @@ +# bagel +well really it's a little hobby sentient-AI idea, but it's too small to do or be anything + +# relevence +The idea is kind of that our minds have a very fancy network of nearness and farness of concepts. +When I think about something -- brainstorm on it -- my mind activates it and it activates relevent associated thoughts. +It pours through different thoughts that are nearby by association, and keeps the ones that are more useful, more relevent, while +discarding the ones that aren't. + +# self-reference +Additionally, my mind when working on a task, can improve the actual process of working on the task. The steps can change. +The process for finding steps can change. The whole goal can change. I can even go out and wonder why I am working the task +in the first place, and think about that. Then I can act on the new decision. +By making code that writes itself, we move towards an intellect that can learn and improve. + +# implementation ideas +I wrote out some quick relevence around how I might write code, and it seemed like the 'why' for each step was basically a small +chunk of code itself. It seems like there are relevent concepts in my mind that are roughly linked to these small behaviors +(habits or chunks of code). By making such links in actual code, the code looks more mindlike to me. +One of the keys is to get the code to make the links itself, and I think what is important there is the concept of patterns-that- +work. If you can discern when code works, then you can look for similar properties on the before and end states. If some of them +are always the same when it works, those are probably the ones that should be linked to the code chunk under study. This provides +for rudimentary learning. + +# size +This code is written very tiny so that little work need be invested in it for it have conceptual growth. The idea and hope somehow +is that it move rapidly towards coding itself, such that as it gets coded, the developer need do less to work on it, being able to +instead make use of its internal functions for producing code-like behavior. + +# language +By prototyping in a flexible language like Javascript, design work may be hastened a little. I also theorize that a good AI doesn't +need many cpu cycles to get stuff done, because it makes smart choices. + +# etc +There is of course more. This writing content was made day-of-creation. Will I ever edit this again? Unknown. diff --git a/intellect-framework-from-internet/starts/bagel/nascent1.js b/intellect-framework-from-internet/starts/bagel/nascent1.js new file mode 100644 index 0000000..b6b5552 --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/nascent1.js @@ -0,0 +1,107 @@ +class ActiveMemory { + constructor() { + this.ram = [] + this.cloned = false + } + clone() { + let ret = new ActiveMemory(); + ret.ram = this.ram + ret.cloned = true + return ret + } + add(item) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + this.ram.push(item) + } + del(item) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + let index = this.ram.indexOf(item) + this.ram.splice(index, 1) + } + contains(item) { + for (let a of this.ram) + if (a == item) return a + return false + } + containsWith(prop, val) { + let ret = [] + for (let a of this.ram) + if (a[prop] == val) + return true + return false + } + getWith(prop, val) { + let ret = [] + //console.log('get-with ' + prop + ' ' + val) + for (let a of this.ram) { + //console.log(a + ' ' + prop + ' is ' + a[prop]) + if (a[prop] == val) + ret.push(a) + } + if (ret.length > 0) return ret + return null + } +} + +function sayhi() { + res = 'hi' + res.use = 'output' + console.log(res) + return 'said ' + res +} +sayhi.relevence = function(ram) { + return [ram.ram[0]]; +} + +function line2words(line) { + let res = line.split(' ') + res.type = 'list' + return res +} +line2words.relevence = function(ram) { + return ram.getWith('type', 'text') +} + +all_parts = [ line2words, sayhi ] + +ram = new ActiveMemory() +optstried = new Set() +steps = [] + +var readline = require('readline') +readline.createInterface({ + input: process.stdin +}).on('line', (line) => { + line = new String(line) + line.use = 'input' + line.type = 'text' + ram.add(line) + + let cont + do { + cont = false + for (let part of all_parts) { + //console.log('for-loop-of-parts ' + part.name) + let rel = part.relevence(ram) + if (rel) { + for (let a of rel) { + //console.log('for-loop-of-rel ' + part.name + ' ' + a) + if (optstried.has(part.name + ' ' + a)) continue; + //console.log('call-part ' + part.name + ' ' + a) + res = part(a) + //console.log('part-called') + step = [a, part.name, res] + steps.push(step) + console.log('made ' + step) + cont = true + optstried.add(part.name + ' ' + a) + + } + } + //if (rel) { + // let ram2 = ram.clone() + // for + //} + } + } while (cont) +}) diff --git a/intellect-framework-from-internet/starts/bagel/nascent2.js b/intellect-framework-from-internet/starts/bagel/nascent2.js new file mode 100644 index 0000000..883aa7a --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/nascent2.js @@ -0,0 +1,172 @@ +class ActiveMemory { + constructor() { + this.ram = [] + this.cloned = false + } + clone() { + let ret = new ActiveMemory(); + ret.ram = this.ram + ret.cloned = true + return ret + } + add(...items) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + for (let item of items) + this.ram.push(item) + } + del(...items) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + for (let item of items) { + let index = this.ram.indexOf(item) + this.ram.splice(index, 1) + } + } + contains(...items) { + for (let item of items) + if (this.ram.indexOf(item) === -1) return false + return true + } + containsWith(...props) { + let ret = [] + outer: for (let a of this.ram) { + for (let b of props) + if (! a.has(b)) + continue outer + return true + } + return false + } + getWith(...props) { + let ret = [] + outer: for (let a of this.ram) { + for (let b of props) + if (! a.has(b)) + continue outer + ret.push(a) + } + if (ret.length > 0) return ret + return null + } +} +class StringData extends String { + constructor(str, from) { + super(str) + this.props = new Set(from && from.props) + this.add('string') + this.del('array') + } + add(val) { + this.props.add(val) + } + has(val) { + return this.props.has(val) + } + del(val) { + this.props.delete(val) + } +} +class ArrayData extends Array { + constructor(arr, from) { + super(...arr) + this.props = new Set(from && from.props) + this.add('array') + this.del('string') + } + add(val) { + this.props.add(val) + } + has(val) { + return this.props.has(val) + } + del(val) { + this.props.delete(val) + } +} + +function line2words(line) { + let res = new ArrayData(line.split(' '), line) + res.add('words') + return res +} +line2words.relevence = function(ram) { + return ram.getWith('text', 'string') +} +line2words.makes = ['array','words'] // property values produced + +function respondhello(words) { + console.log(words[0] + ", user!") + let res = new StringData("said " + words[0]) + res.add('output') + res.add('text') + return res +} +respondhello.relevence = function(ram) { + let res = ram.getWith('words', 'input') + if (res) res = res.filter(x => { x = x[0].toLowerCase(); return x == 'hello' || x == 'hi'}) + return res +} +respondhello.makes = ['output'] + +// nodejs is missing a succinct read-line-from-stdin function. here, we make one. +userinput = (() => { + const readline = require('readline') + const lines = [] + readline.createInterface({ input: process.stdin }).on('line', (line) => { + lines.push(line) + }) + + function userinput() { + let res = new StringData(lines.shift()) + res.add('text') + res.add('input') + return res + } + userinput.relevence = function() { + return lines.length > 0 + } + userinput.makes = ['string','text','input'] + + return userinput +})() + + +all_parts = [ line2words, respondhello ] + +ram = new ActiveMemory() +optstried = new Set() +steps = [] + +var readline = require('readline') +readline.createInterface({ + input: process.stdin +}).on('line', (line) => { + line = new StringData(line) + line.add('input') + line.add('text') + ram.add(line) + + let cont + do { + cont = false + for (let part of all_parts) { + //console.log('for-loop-of-parts ' + part.name) + let rel = part.relevence(ram) + if (rel) { + for (let a of rel) { + //console.log('for-loop-of-rel ' + part.name + ' ' + a) + if (optstried.has(part.name + ' ' + a)) continue; + //console.log('call-part ' + part.name + ' ' + a) + res = part(a) + ram.add(res) + //console.log('part-called') + step = [a, part.name, res] + steps.push(step) + console.log('made ' + step) + cont = true + optstried.add(part.name + ' ' + a) + + } + } + } + } while (cont) +}) diff --git a/intellect-framework-from-internet/starts/bagel/nascent3.js b/intellect-framework-from-internet/starts/bagel/nascent3.js new file mode 100644 index 0000000..0a6c4a3 --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/nascent3.js @@ -0,0 +1,199 @@ +class ActiveMemory { + constructor() { + this.ram = [] + this.cloned = false + } + clone() { + let ret = new ActiveMemory(); + ret.ram = this.ram + ret.cloned = true + return ret + } + add(...items) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + for (let item of items) + this.ram.push(item) + } + del(...items) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + for (let item of items) { + let index = this.ram.indexOf(item) + this.ram.splice(index, 1) + } + } + contains(...items) { + for (let item of items) + if (this.ram.indexOf(item) === -1) return false + return true + } + containsWith(...props) { + let ret = [] + outer: for (let a of this.ram) { + for (let b of props) + if (! a.has(b)) + continue outer + return true + } + return false + } + getWith(...props) { + let ret = [] + outer: for (let a of this.ram) { + for (let b of props) + if (! a.has(b)) + continue outer + ret.push(a) + } + if (ret.length > 0) return ret + return null + } +} +class StringData extends String { + constructor(str, from) { + super(str) + this.props = new Set(from && from.props) + this.add('string') + this.del('array') + } + add(val) { + this.props.add(val) + } + has(val) { + return this.props.has(val) + } + del(val) { + this.props.delete(val) + } +} +class ArrayData extends Array { + constructor(arr, from) { + super(...arr) + this.props = new Set(from && from.props) + this.add('array') + this.del('string') + } + add(val) { + this.props.add(val) + } + has(val) { + return this.props.has(val) + } + del(val) { + this.props.delete(val) + } +} +class FunctionData { + constructor(name, func, relevence, makes) { + this.name = name + this.props = new Set() + this.props.add('function') + this.props.add(name) + this.call = func + this.relevence = relevence + this.makes = makes + } + add(val) { + this.props.add(val) + } + has(val) { + return this.props.has(val) + } + del(val) { + this.props.delete(val) + } +} + +line2words = new FunctionData( + 'line2words', + (line) => { // call + let res = new ArrayData(line.split(' '), line) + res.add('words') + return res + }, + (ram) => { // relevence + return ram.getWith('text', 'string') + }, + ['array','words'] // makes +) + +respondhello = new FunctionData( + 'respondhello', + (words) => { // call + console.log(words[0] + ", user!") + let res = new StringData("said " + words[0]) + res.add('output') + res.add('text') + return res + }, + (ram) => { // relevence + let res = ram.getWith('words', 'input') + if (res) res = res.filter(x => { x = x[0].toLowerCase(); return x == 'hello' || x == 'hi'}) + return res + }, + ['output', 'text'] // makes +) + +// nodejs is missing a succinct read-line-from-stdin function. make our own. +userinput = (() => { + const readline = require('readline') + const lines = [] + readline.createInterface({ input: process.stdin }).on('line', (line) => { + lines.push(line) + }) + + return new FunctionData( + 'userinput', + () => { // call + let res = new StringData(lines.shift()) + res.add('text') + res.add('input') + return res + }, + () => { // relevence + return lines.length > 0 + }, + ['string','text','input'] // makes + ) +})() + + +all_parts = [ line2words, respondhello ] + +ram = new ActiveMemory() +optstried = new Set() +steps = [] + +var readline = require('readline') +readline.createInterface({ + input: process.stdin +}).on('line', (line) => { + line = new StringData(line) + line.add('input') + line.add('text') + ram.add(line) + + let cont + do { + cont = false + for (let part of all_parts) { + //console.log('for-loop-of-parts ' + part.name) + let rel = part.relevence(ram) + if (rel) { + for (let a of rel) { + //console.log('for-loop-of-rel ' + part.name + ' ' + a) + if (optstried.has(part.name + ' ' + a)) continue; + //console.log('call-part ' + part.name + ' ' + a) + res = part.call(a) + ram.add(res) + //console.log('part-called') + step = [a, part.name, res] + steps.push(step) + console.log('made ' + step) + cont = true + optstried.add(part.name + ' ' + a) + + } + } + } + } while (cont) +}) diff --git a/intellect-framework-from-internet/starts/bagel/nascent4.js b/intellect-framework-from-internet/starts/bagel/nascent4.js new file mode 100644 index 0000000..093df79 --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/nascent4.js @@ -0,0 +1,242 @@ +class ActiveMemory { + constructor() { + this.ram = [] + this.cloned = false + } + clone() { + let ret = new ActiveMemory(); + ret.ram = this.ram + ret.cloned = true + return ret + } + add(...items) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + for (let item of items) + this.ram.push(item) + } + del(...items) { + if (this.cloned) { this.ram = this.ram.slice(); this.cloned = false; } + for (let item of items) { + let index = this.ram.indexOf(item) + this.ram.splice(index, 1) + } + } + contains(...items) { + for (let item of items) + if (this.ram.indexOf(item) === -1) return false + return true + } + containsWith(...props) { + let ret = [] + outer: for (let a of this.ram) { + for (let i = 0; i < props.length; i += 2) + if (! a.props.has(props[i], props[i+1])) + continue outer + return true + } + return false + } + getWith(...props) { + let ret = [] + outer: for (let a of this.ram) { + //console.log(a.props.props) + for (let i = 0; i < props.length; i += 2) { + //console.log(props[i] + ': ' + props[i+1] + '?') + if (! a.props.has(props[i], props[i+1])) + continue outer + } + ret.push(a) + } + if (ret.length > 0) return ret + return null + } +} +class Property { + constructor(type, dest) { + this.type = type + this.dest = dest + } +} +class Properties { + constructor(type, from) { + this.props = from ? from.props.slice() : [] + //if (from) {console.log('INHERIT: '); for (let prop of this.props) { console.log(prop) }} + this.add('is', type) + } + toString() { + let str = '' + for (let prop of this.props) { + str += prop.type + ':' + prop.dest + ' ' + } + return str + } + add(type, dest) { + this.props.push(new Property(type, dest)) + } + has(type, dest) { + for (let p of this.props) + if (p.type == type && p.dest == dest) + return true + return false + } + del(type, dest) { + for (let i = 0; i < this.props.length; ++ i) { + let p = this.props[i] + if (p.type == type && p.dest == dest) { + this.props.splice(i, 1) + return true + } + } + return false + } +} +class AbstractData { + constructor(from) { + this.props = new Properties('abstract', from && from.props) + } +} +class StringData extends String { + constructor(str, from) { + super(str) + this.props = new Properties('string', from && from.props) + this.props.del('is', 'array') + } +} +class ArrayData extends Array { + constructor(arr, from) { + super(...arr) + this.props = new Properties('array', from && from.props) + this.props.del('is', 'string') + } +} +class FunctionData { + constructor(name, func, relevence, makes) { + this.name = name + this.props = new Properties('function') + this.props.add('name', name) + this.call = func + this.relevence = relevence + this.makes = makes + } +} + +// variables: +// - create a place to store a value +// createvar = new FunctionData( +// 'createvar', +// /*call*/(name) => { +// let ret = new StringData(name) +// ret.add +// let name = obj_and_name[1] +// }, +// /*relevence*/, +// /*makes*/ +// ) +// - place a value in such a place +// - retrieve a value from such a place +// data-structures: +// - make a class definition (collection of variables) +// - initialize an object +// - set/retrieve properties (variables) +// flow: +// - trigger a different step than the next, conditionally +// procedures: +// - collect a set of behaviors together +// - trigger a collected set of behaviors and continue +// expressions: +// - evaluate arithmetic on variables and constants + +line2words = new FunctionData( + 'line2words', + (line) => { // call + let res = new ArrayData(line.split(' '), line) + res.props.add('is','words') + return res + }, + (ram) => { // relevence + return ram.getWith('is','text', 'is','string') + }, + ['is','array','is','words'] // makes +) + +respondhello = new FunctionData( + 'respondhello', + (words) => { // call + console.log(words[0] + ", user!") + let res = new StringData("said " + words[0]) + res.props.add('is','output') + res.props.add('is','text') + return res + }, + (ram) => { // relevence + let res = ram.getWith('is','words', 'is','input') + if (res) res = res.filter(x => { x = x[0].toLowerCase(); return x == 'hello' || x == 'hi'}) + return res + }, + ['is','output', 'is','text'] // makes +) + +// nodejs is missing a succinct read-line-from-stdin function. make our own. +userinput = (() => { + const readline = require('readline') + const lines = [] + readline.createInterface({ input: process.stdin }).on('line', (line) => { + lines.push(line) + }) + + return new FunctionData( + 'userinput', + () => { // call + let res = new StringData(lines.shift()) + res.props.add('is','text') + res.props.add('is','input') + return res + }, + () => { // relevence + return lines.length > 0 + }, + ['is','string','is','text','is','input'] // makes + ) +})() + + +all_parts = [ line2words, respondhello ] + +ram = new ActiveMemory() +optstried = new Set() +steps = [] + +var readline = require('readline') +readline.createInterface({ + input: process.stdin +}).on('line', (line) => { + line = new StringData(line) + line.props.add('is','input') + line.props.add('is','text') + ram.add(line) + + let cont + do { + cont = false + for (let part of all_parts) { + //console.log('for-loop-of-parts ' + part.name) + let rel = part.relevence(ram) + if (rel) { + for (let a of rel) { + //console.log('for-loop-of-rel ' + part.name + ' ' + a) + if (optstried.has(part.name + ' ' + a)) continue; + //console.log('call-part ' + part.name + ' ' + a) + res = part.call(a) + ram.add(res) + //console.log('part-called') + step = [a, part.name, res] + steps.push(step) + console.log('made ' + step) + cont = true + optstried.add(part.name + ' ' + a) + + } + } + } + } while (cont) +}) diff --git a/intellect-framework-from-internet/starts/bagel/nascent5.js b/intellect-framework-from-internet/starts/bagel/nascent5.js new file mode 100644 index 0000000..1d9e8ae --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/nascent5.js @@ -0,0 +1,382 @@ +class Property { + constructor(type, dest) { + this.type = type + this.dest = dest + } +} +class Properties { + constructor(type, from) { + this.props = from ? from.props.slice() : [] + //if (from) {console.log('INHERIT: '); for (let prop of this.props) { console.log(prop) }} + this.add('is', type) + } + toString() { + let str = '' + for (let prop of this.props) { + str += prop.type + ':' + prop.dest + ' ' + } + return str + } + add(type, dest) { + this.props.push(new Property(type, dest)) + } + has(type, dest) { + for (let p of this.props) + if ((p.type == type || isVar(type)) + && (p.dest == dest || isVar(dest))) + return true + return false + } + del(type, dest) { + for (let i = 0; i < this.props.length; ++ i) { + let p = this.props[i] + if (p.type == type && p.dest == dest) { + this.props.splice(i, 1) + return true + } + } + return false + } + hasIsVar() { + return this.has('is','variable') + } +} +class AbstractData { + constructor(from) { + this.props = new Properties('abstract', from && from.props) + } +} +class StringData extends String { + constructor(str, from) { + super(str) + this.props = new Properties('string', from && from.props) + this.props.del('is', 'array') + } +} +class ArrayData extends Array { + constructor(arr, from) { + super(...arr) + this.props = new Properties('array', from && from.props) + this.props.del('is', 'string') + } +} + +// Abstractions? +const VAR_X = new StringData('X') +VAR_X.props.add('is','variable') +// recommend e.g. 'is','variable-rep' when code is designing them, so don't match everything +function isVar(x) { + return x.props && x.props.has('is','variable') +} + +// MEMORY +// the archivist. Provides for needs of data. Memory is relevent whenever there is +// an informational need. +// +// When remembering steps, likely what is relevent is what is needed to reach the goal +// Here's a possible step memory. +// +// let ret = new StringData('labeled ' + items.length + ' text-string') +// ret.props.add('is','step-memory') +// ret.props.add('step',genproptextstring) +// ret.props.add('ram',ram) +// ret.props.add('count',items.length) +// for (let a of items) +// ret.props.add('item', a) + +class ActiveMemory extends ArrayData { + // although Memory is eventually a module that provides for stored information needs + // this class is just a group of concepts, moved in and out as needed + constructor(items, from) { + super(items || [], from) + this.props.add('is','working-ram') + } + clone() { + return new ActiveMemory(this, this); + } + add(...items) { + //if (this.cloned) { this = this.slice(); this.cloned = false; } + for (let item of items) + this.push(item) + } + del(...items) { + //if (this.cloned) { this = this.slice(); this.cloned = false; } + for (let item of items) { + let index = this.indexOf(item) + this.splice(index, 1) + } + } + contains(...items) { + for (let item of items) + if (this.indexOf(item) === -1) return false + return true + } + containsWith(...props) { + let ret = [] + outer: for (let a of this) { + for (let i = 0; i < props.length; i += 2) + if (! a.props.has(props[i], props[i+1])) + continue outer + return true + } + return false + } + getWith(...props) { + let ret = [] + outer: for (let a of this) { + //console.log(a.props.props) + for (let i = 0; i < props.length; i += 2) { + //console.log(props[i] + ': ' + props[i+1] + '?') + if (! a.props.has(props[i], props[i+1])) + continue outer + } + ret.push(a) + } + if (ret.length > 0) return ret + return null + } +} +// note: for now we produce only data; state-changes are data-changes +class FunctionData { + constructor(name, // name of function + func, // function taking ordered needs + // ordered array of made objects is returned + needs, // array of 1-property-per-object this function requires + makes // array of 1-property-per-object this function produces + ) { + this.name = name + this.props = new Properties('function') + this.props.add('name', name) + this.call = func + // If needed, make atomspace-like pattern structures for needs/makes. + // - represent multiple properties on 1 needed object + // - represent input objects present in output + this.needs = needs + this.makes = makes + } +} + +// variables: +// - create a place to store a value +//createvar = new FunctionData( +// 'createvar', +// /*call*/(name) => { +// let ret = new StringData(name) +// ret.props.add('is','varspec') +// return ret +// }, +// /*relevence*/, +//// when do you want to create a variable? when you need a variable and you have a name +// /*makes*/ +//) +// - place a value in such a place +// - retrieve a value from such a place +// data-structures: (these are like promises of what to do and how to use something) +// - make a class definition (collection of variables) +// - initialize an object +// - set/retrieve properties (variables) +// flow: +// - trigger a different step than the next, conditionally +// procedures: +// - collect a set of behaviors together +// - trigger a collected set of behaviors and continue +// expressions: +// - evaluate arithmetic on variables and constants + +line2words = new FunctionData( + 'line2words', + (line) => { // call + let res = new ArrayData(line.split(' '), line) + res.props.add('is','words') + res.props.del('is','text-string') + return res + }, + ['is','text-string'], // needs + ['is','word-array'] // makes +) + +// makes text-string used by line2words. example of small relevence habit +genproptextstring = new FunctionData( + 'genproptextstring', + /*call*/(text) => { + if (text.props.has('is','string')) { + if (!text.props.has('is','text-string')) { + text.props.add('is','text-string') + } + return text + } + return null + }, + /*needs*/['is','text'], + /*makes*/['is','text-string'] +) + +respondhello = new FunctionData( + 'respondhello', + (words) => { // call + console.log(words[0] + " world!") + let res = new StringData("said " + words[0]) + res.props.add('is','output') + res.props.add('is','text') + return res + }, + ['is','hello-input'], // needs + ['is','output'] // makes +) + +genprophelloinput = new FunctionData( + 'genprophelloinput', + /*call*/(input) => { + if (!input.props.has('is','words')) + return null + if (!input.props.has('is','hello-input')) { + let x = input[0].toLowerCase() + let c = x[x.length-1] + if (c == ',' || c == '!' || c == '.') x = x.slice(0,x.length-1) + if (x != 'hello' && x != 'hi') return null + input.props.add('is','hello-input') + } + return input + }, + /*needs*/['is','input'], + /*makes*/['is','hello-input'] +) + +/* old, this isn't relevent to needed structure +// nodejs is missing a succinct read-line-from-stdin function. make our own. +userinput = (() => { + const readline = require('readline') + const lines = [] + readline.createInterface({ input: process.stdin }).on('line', (line) => { + lines.push(line) + }) + + let ret = new FunctionData( + 'userinput', + (self) => { // call + let res = new StringData(lines.shift()) + res.props.add('is','text') + res.props.add('is','input') + return res + }, + () => { // relevence + return lines.length > 0 + }, + ['has','userinput-lines'] // needs + ['is','string','is','text','is','input'] // makes + ) + ret.lines = lines +})() +genprophaslines = new FunctionData( + 'genprophaslines', + (userinput) => { // call + } +) +*/ + +// PATTERN REQUEST: we want to be able to store needed-steps. +// needed-steps are parallel needs that are needed for a helpful step +// any one may be met, and others are ignored once one is, but all are generated at once +// habits that meet needs expect them not to be inside an array and have no way of referring to that. +// [AND needs can be collapsed, but OR needs need patterns] +// [how do we pull a need out of the list?] + +// make a habit that plans core behavior +// for some other ideas, see this function in nascent6.js +findstepsfor = new FunctionData( + 'findstepsfor', + /*call*/(need, depth) => { + // find a habit that does the final goal. + // TODO: for now we assume all needs are 'is' and store just what-it-is in the need string. when doesn't work anymore, make type-getters on Properties to retrieve the need details + let ret = new ArrayData([]) + for (let habit of all_parts) { + if (habit.makes.indexOf(need) !== -1) { + // found a workable habit + ret.push(habit.needs) + } + } + ret.props.add('is','alternate-needs-array') + return ret + }, + // TODO: likely need more structure here + /*needs*/['is','desired-need'], + /*makes*/['is','alternate-needs-array'] +) + +// TODO: add structure enough to build findstepsfor +// TODO: build findstepsfor +// TODO 2: add to surrounding process: remove source needs when there is no longer a reason for their presence + + +all_parts = [ line2words, genproptextstring, respondhello, genprophelloinput ] + +ram = new ActiveMemory() +//ram.add(ram) +optstried = new Set() +steps = [] + +var readline = require('readline') +readline.createInterface({ + input: process.stdin +}).on('line', (line) => { + line = new StringData(line) + line.props.add('is','input') + line.props.add('is','text') + ram.add(line) + + let cont + do { + cont = false + for (let part of all_parts) { + //console.log('for-loop-of-parts ' + part.name) + // TODO: >1 parameter,must redo next line + let rel = ram.getWith(...part.needs) + if (rel) { + for (let a of rel) { + //console.log('for-loop-of-rel ' + part.name + ' ' + a) + if (optstried.has(part.name + ' ' + a)) continue; + //console.log('call-part ' + part.name + ' ' + a) + res = part.call(a) + optstried.add(part.name + ' ' + a) + if (res == null) continue + // TODO: res==null is considered failure now + ram.add(res) + //console.log('part-called') + step = [a, part.name, res] + steps.push(step) + console.log('made ' + step) + cont = true + } + } + } + } while (cont) +}) + + +// it looks like there is a reason to store each item in active memory. +// one reason is that it is needed by a step in a process. +// when there are no reasons, it is removed. +// using an item should link it to what it is used by, so that it may be found easier again when needed + +// Please grow to understand your own structure. What is needed to make an intellect? +// ^-- we want it to learn the basic needs of life, eventually, on its own. +// notably those to do with care for others. + +// MEMORY: see MEMORY above + +// RELEVENCE: the gofer. Provides the link between needs, etc, and the behavior that +// finds them. Is relevent for meeting needs in active ways and likely much else. + +// BEHAVIOR: the core. combines interdependent habits from memory to meet needs. +// The two below go on simultaneously. only 1 is needed. +// A way to plan behavior: +// find habits that do the final goal, discern their needs +// pick needs to treat as a new final goal and repeat until needs are met +// A way to make behavior: +// find a habit that does a goal +// find with this process, information that meets its needs +// run it +// TODO: for subprocesses spawning, +// consider labelling things that are very quick and side-effect-free +// these can probably be immediately run. +// diff --git a/intellect-framework-from-internet/starts/bagel/nascent6.js b/intellect-framework-from-internet/starts/bagel/nascent6.js new file mode 100644 index 0000000..d7241ba --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/nascent6.js @@ -0,0 +1,461 @@ +// This file was WIP, two prongs were being pursued at once when work was halted. + +// Meaning Representation +class Property { + constructor(type, dest) { + this.type = type + this.dest = dest + } +} +class Properties { + // members are all Usage Simplification defining Promise Spec + constructor(type, from) { + this.props = from ? from.props.slice() : [] + //if (from) {console.log('INHERIT: '); for (let prop of this.props) { console.log(prop) }} + this.add('is', type) + } + toString() { + let str = '' + for (let prop of this.props) { + str += prop.type + ':' + prop.dest + ' ' + } + return str + } + add(type, dest) { + this.props.push(new Property(type, dest)) + } + // recommend hoisting variables when designing them, so they don't match everything + has(type, dest) { + for (let p of this.props) + if ((p.type == type || isVar(type)) + && (p.dest == dest || isVar(dest))) + return true + return false + } + del(type, dest) { + for (let i = 0; i < this.props.length; ++ i) { + let p = this.props[i] + if (p.type == type && p.dest == dest) { + this.props.splice(i, 1) + return true + } + } + return false + } + get(type) { + let result = null + for (let i = 0; i < this.props.length; ++ i) { + let p = this.props[i] + if (p.type == type) { + if (result) throw new Error('get on multiply defined property') + result = p.dest + } + } + return result + } + hasIsVar() { + return this.has('is','variable') + } +} +class AbstractData { + constructor(from) { + this.props = new Properties('abstract', from && from.props) + } +} +class StringData extends String { + constructor(str, from) { + super(str) + this.props = new Properties('string', from && from.props) + this.props.del('is', 'array') + } +} +class ArrayData extends Array { + constructor(arr, from) { + super(...arr) + this.props = new Properties('array', from && from.props) + this.props.del('is', 'string') + } +} + +// Meaning Representation +class Var extends StringData { + constructor(name){ + super(name) + props.add('is','variable') + } + // recommend e.g. 'is','variable-rep' when code is designing them, so don't match everything + // opencog uses a 'quote' wrapper to cause this, sounds more general +} +function isVar(x) { + return x.props && x.props.has('is','variable') +} +const ONE = StringData('one') +const MANY = StringData('many') +const VAR_X = new Var('X') + +// MEMORY +// the archivist. Provides for needs of data. Memory is relevent whenever there is +// an informational need. +// +// When remembering steps, likely what is relevent is what is needed to reach the goal +// Here's a possible step memory. +// +// let ret = new StringData('labeled ' + items.length + ' text-string') +// ret.props.add('is','step-memory') +// ret.props.add('step',genproptextstring) +// ret.props.add('ram',ram) +// ret.props.add('count',items.length) +// for (let a of items) +// ret.props.add('item', a) + +class ActiveMemory extends ArrayData { + // although Memory is eventually a module that provides for stored information needs + // this class is just a group of concepts, moved in and out as needed + constructor(items, from) { + super(items || [], from) + this.props.add('is','working-ram') + } + clone() { + return new ActiveMemory(this, this); + } + add(...items) { + //if (this.cloned) { this = this.slice(); this.cloned = false; } + for (let item of items) + this.push(item) + } + del(...items) { + //if (this.cloned) { this = this.slice(); this.cloned = false; } + for (let item of items) { + let index = this.indexOf(item) + this.splice(index, 1) + } + } + contains(...items) { + for (let item of items) + if (this.indexOf(item) === -1) return false + return true + } + containsWith(...props) { + let ret = [] + outer: for (let a of this) { + for (let i = 0; i < props.length; i += 2) + if (! a.props.has(props[i], props[i+1])) + continue outer + return true + } + return false + } + getWith(...props) { + let ret = [] + outer: for (let a of this) { + //console.log(a.props.props) + for (let i = 0; i < props.length; i += 2) { + //console.log(props[i] + ': ' + props[i+1] + '?') + if (! a.props.has(props[i], props[i+1])) + continue outer + } + ret.push(a) + } + if (ret.length > 0) return ret + return null + } +} +// note: for now we produce only data; state-changes are data-changes +// TODO: this class has methods. turn them into promise-meeting-habits. a promise is a spec for behavior, e.g. how data is stored. this spec can be interpeted by a more general habit. +class FunctionData { + constructor(name, // name of function + func, // function taking ordered needs + // ordered array of made objects is returned + needs, // array of 1-property-per-object this function requires + makes // array of 1-property-per-object this function produces + ) { + this.name = name + this.props = new Properties('function') + this.props.add('name', name) + this.call = func + // If needed, make atomspace-like pattern structures for needs/makes. + // - represent multiple properties on 1 needed object + // - represent input objects present in output + this.needs = needs + this.makes = makes + } + makesFrom(ram) { // what we make with the ram + // match needs + + // TODO: improve from just picking 1. preferably with relevence. + for (let i = 0; i < this.needs.length; i += 2) { + if (isVar(this.needs[i]) || isVar(this.needs[i+1])) { + // iterate all other options with this? just pick 1? + // STUB + } else { + if (!ram.containsWith(this.needs[i], this.needs[i+1])) + return [] + } + } + // fill variables STUB + } + // say I want would-meet apple + // and I have needs apple + // the easiest way to find this is to fill the needs in with what I have +} + +// variables: +// - create a place to store a value +//createvar = new FunctionData( +// 'createvar', +// /*call*/(name) => { +// let ret = new StringData(name) +// ret.props.add('is','varspec') +// return ret +// }, +// /*relevence*/, +//// when do you want to create a variable? when you need a variable and you have a name +// /*makes*/ +//) +// - place a value in such a place +// - retrieve a value from such a place +// data-structures: (these are like promises of what to do and how to use something) +// - make a class definition (collection of variables) +// - initialize an object +// - set/retrieve properties (variables) +// flow: +// - trigger a different step than the next, conditionally +// procedures: +// - collect a set of behaviors together +// - trigger a collected set of behaviors and continue +// expressions: +// - evaluate arithmetic on variables and constants + +// sometimes how we get what we need depends on what we have +line2words = new FunctionData( + 'line2words', + (line) => { // call + let res = new ArrayData(line.split(' '), line) + res.props.add('is','words') + res.props.del('is','text-string') + return res + }, + ['is','text-string'], // needs + ['is','word-array'] // makes +) + +// makes text-string used by line2words. example of small relevence habit +genproptextstring = new FunctionData( + 'genproptextstring', + /*call*/(text) => { + if (text.props.has('is','string')) { + if (!text.props.has('is','text-string')) { + text.props.add('is','text-string') + } + return text + } + return null + }, + /*needs*/['is','text'], + /*makes*/['is','text-string'] +) + +respondhello = new FunctionData( + 'respondhello', + (words) => { // call + console.log(words[0] + " world!") + let res = new StringData("said " + words[0]) + res.props.add('is','output') + res.props.add('is','text') + return res + }, + ['is','hello-input'], // needs + ['is','output'] // makes +) + +genprophelloinput = new FunctionData( + 'genprophelloinput', + /*call*/(input) => { + if (!input.props.has('is','words')) + return null + if (!input.props.has('is','hello-input')) { + let x = input[0].toLowerCase() + let c = x[x.length-1] + if (c == ',' || c == '!' || c == '.') x = x.slice(0,x.length-1) + if (x != 'hello' && x != 'hi') return null + input.props.add('is','hello-input') + } + return input + }, + /*needs*/['is','input'], + /*makes*/['is','hello-input'] +) + +/* old, this isn't relevent to needed structure +// nodejs is missing a succinct read-line-from-stdin function. make our own. +userinput = (() => { + const readline = require('readline') + const lines = [] + readline.createInterface({ input: process.stdin }).on('line', (line) => { + lines.push(line) + }) + + let ret = new FunctionData( + 'userinput', + (self) => { // call + let res = new StringData(lines.shift()) + res.props.add('is','text') + res.props.add('is','input') + return res + }, + () => { // relevence + return lines.length > 0 + }, + ['has','userinput-lines'] // needs + ['is','string','is','text','is','input'] // makes + ) + ret.lines = lines +})() +genprophaslines = new FunctionData( + 'genprophaslines', + (userinput) => { // call + } +) +*/ + +// PATTERN REQUEST: we want to be able to store needed-steps. +// needed-steps are parallel needs that are needed for a helpful step +// any one may be met, and others are ignored once one is, but all are generated at once +// habits that meet needs expect them not to be inside an array and have no way of referring to that. +// [AND needs can be collapsed, but OR needs need patterns] +// [how do we pull a need out of the list?] + +// is it useful to use as a need the memory generated by a habit? + +// make a habit that plans core behavior +findstepsfor = new FunctionData( + 'findstepsfor', + /*call*/(need, depth) => { + // find a habit that does the final goal. + // TODO: for now we assume all needs are 'is' and store just what-it-is in the need string. when doesn't work anymore, make type-getters on Properties to retrieve the need details + let ret = new ArrayData([]) + for (let habit of all_parts) { + if (habit.makes.indexOf(need) !== -1) { + // found a workable habit + ret.push(habit.needs) + } + } + ret.props.add('is','alternate-needs-array') + return ret + }, + // TODO: likely need more structure here + // warning: MANY adds surrounding code complexity. please put makes-interpretation in a habit if MANY is used. <- let's just put this in the class constructor for now + /*needs*/['needs', VAR_X], + /*makes*/[MANY, 'would-meet', VAR_X] + // really we are usually met due to the need to meet a goal + // and the need to have steps to meet that particular goal + // how do we write a need that supports another need + // + // propose relevence is a list of reasons each with a strength, and greatest sum is chosen + // HABIT/ACTIVE BEHAVIOR wants relevent-met-habits, to act on + // PLANNING/GOAL BEHAVIOR wants relevent-unmet-needs to backtrace them towards relevent-met-needs + // + // we can meet any need with behavior, but it takes time. + // [we are ignoring most of karl's needs] + // [the reason is that an AI can meet them all] + // AI meets some needs + // AI is ongoing + // therefore we are working on meeting + // ONE: we have a need for actively pursuing relevent needs + // TWO: we need appropriate multitasking + // AI is long term, so would happen after [quickly-]meetable-needs are met. + // + // make popcorn + // need: made-popcorn + // 1. identify that we need unmade popcorn and a microwave + // ^-- made-popcorn is how? we can meet any need with behavior + // what is substep of find-path-to-need + // find path-part-to-need + // + // need: to meet needs + // need: some-need + // makestepsfor makes: some-other-need tagged makes: some-need + // + // when we push some-need we want to stimulate pushing some-other-need. + // + // use a variable as the link target, and use e.g. met-need + // as the link type +) + +// TODO: add structure enough to build findstepsfor +// TODO: build findstepsfor +// TODO 2: add to surrounding process: remove source needs when there is no longer a reason for their presence + + +all_parts = [ line2words, genproptextstring, respondhello, genprophelloinput ] + +ram = new ActiveMemory() +//ram.add(ram) +optstried = new Set() +steps = [] + +var readline = require('readline') +readline.createInterface({ + input: process.stdin +}).on('line', (line) => { + line = new StringData(line) + line.props.add('is','input') + line.props.add('is','text') + ram.add(line) + + let cont + do { + cont = false + for (let part of all_parts) { + //console.log('for-loop-of-parts ' + part.name) + // TODO: >1 parameter,must redo next line + let rel = ram.getWith(...part.needs) + if (rel) { + for (let a of rel) { + //console.log('for-loop-of-rel ' + part.name + ' ' + a) + if (optstried.has(part.name + ' ' + a)) continue; + //console.log('call-part ' + part.name + ' ' + a) + res = part.call(a) + optstried.add(part.name + ' ' + a) + if (res == null) continue + // TODO: res==null is considered failure now + ram.add(res) + //console.log('part-called') + step = [a, part.name, res] + steps.push(step) + console.log('made ' + step) + cont = true + } + } + } + } while (cont) +}) + + +// it looks like there is a reason to store each item in active memory. +// one reason is that it is needed by a step in a process. +// when there are no reasons, it is removed. +// using an item should link it to what it is used by, so that it may be found easier again when needed + +// Please grow to understand your own structure. What is needed to make an intellect? +// ^-- we want it to learn the basic needs of life, eventually, on its own. +// notably those to do with care for others. + +// MEMORY: see MEMORY above + +// RELEVENCE: the gofer. Provides the link between needs, etc, and the behavior that +// finds them. Is relevent for meeting needs in active ways and likely much else. + +// BEHAVIOR: the core. combines interdependent habits from memory to meet needs. +// The two below go on simultaneously. only 1 is needed. +// A way to plan behavior: +// find habits that do the final goal, discern their needs +// pick needs to treat as a new final goal and repeat until needs are met +// A way to make behavior: +// find a habit that does a goal +// find with this process, information that meets its needs +// run it +// TODO: for subprocesses spawning, +// consider labelling things that are very quick and side-effect-free +// these can probably be immediately run. +// diff --git a/intellect-framework-from-internet/starts/bagel/notes-puzzle-metarelevence.txt b/intellect-framework-from-internet/starts/bagel/notes-puzzle-metarelevence.txt new file mode 100644 index 0000000..254df90 --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/notes-puzzle-metarelevence.txt @@ -0,0 +1,100 @@ +I'm trying to relearn how to solve puzzles. +My brain has a learning state where it explores what I am calling metarelevence to see if it works. +In this state my brain can do new things but stores how it is figuring them out very weakly. +I've found my intelligence inhibition is associated with metarelevence and learning states like this. + In processing it, it seemed to me there were many layers of metarelevence. Each being patterns and habits + to aid in forming, finding, choosing, and combining the lower layers effectively. + Learning in deeper layers makes for much stronger intelligence. + +I was working on a puzzle described by '> > > # < < <'. The goal is to move all the '>' to replace all the '<' on the +right. Each may move only in the direction it is pointing, only by 1 or 2 spaces, and only by swapping places with +the '#'. +I was unable to get more than 1 '>' over there by exploration except for once. That one time I can call a childlike- +learning experience. I was unable to repeat it, so by writing I iterated all options, and found it again. When I +found it again, in my exploration to understand, I engaged another childlike-learning state where I solved the whole +puzzle by accident. I could tell I had not learned how to repeat the success generally, so I reset the puzzle. +It seemed to me in the childlike-learning state I was exploring possible metarelevence towards finding puzzle +solutions. I was thinking of it as 'layer 2 metarelevence'. But I was not strongly storing some information, +possibly the layer 3 information, so as to efficiently repeat the experience. That seemed an attribute of the +childlike learning state. I'm pretty sure when I was younger I stored this kind of metarelevence much better. +The state of mind feels familiar to me, of solving a puzzle with a certain feeling of storing the way to do it, +that does not reach verbal description. +I cast the second childlike learning experience as similar to the first, and again do not feel able to repeat it. + +Thinking over the puzzle solution itself, it seems there is active inhibition growing around certain kinds of +metarelevence development. Like a pattern that happens to limit my intelligence. + +In summary it sounded like there is some of what I am calling metarelevence (a few layers deep) that ends up being +specifically inhibited for me. As I describe this, I am trying to form a new structure matching this metarelevence: +the inhibition finds it and inhibits associated behaviors. Maybe a part of my brain that knows to handle such +learning is overtaxed. +The problematic metarelevence appears related to the construction of new forms of quality relevence. +That is, it seems like I am allergic to certain patterns of pattern-matching... ehhh it is hard to think about. + When I have a goal, I need things to meet it. + I need to know which things to pick first, and which things might be useful with other things. + In meeting my goal, given A, what is useful to combine with A to help form structures that meet the goal? + When thinking of what is useful to combine with an idea towards a goal, we use and build certain habits. + Some of these habits seem inhibited. + If I want to go to the store, is a rabbit helpful? no. + Is a car helpful? Yes, cars are a tool for travel, travel is a tool for going to the store. + Given this, if I am in the hay loft, how do I take the car to the store? + I will need to use the ladder down from the hay loft, after putting down my hay, to get + towards the kitchen where I keep my keys for the car. + I have put down my hay before and know I will be without hay as I leave my task. + We found ladder and keys. These are near the car and store for us, now. + We did not iterate all possible tools. We used relevence to find the ladder and keys. + What about our situation might have linked ladder, keys, being-in-hayloft, and drive-to-store? + Ladder is near hayloft in ways-to-enter-and-leave. + Keys are near car in needed-to-use. + Kitchen is near keys in where-are. Where is found from need-to-have-to-use. + Ladder and Kitchen form a path of active travel to meet needs of drive-to-store. + We craft a path of active travel as we work towards meeting our goal. + Our body looks for the most helpful places to go and goes there. + Different parts of cognition influence our relevence when we look for ways to meet our goal. + This seems big for metarelevence. Disparate parts of the cognition have patterns in relation to each other. + Things have states that depict what can happen. These states are summaries of their limiting attributes. These states develop associated with what something is doing, where it is, or other attributes of context. + + i-need-to-have-my-keys-to-use-them + keys must be in my-posession state, for me-to-use them. + keys must be in usable-by-X state. Are not for X=me unless I am in kitchen. + use-Y must be possible + + please make: A=me, B=store, A-in-B + note: me-in-hayloft, me-holding-hay + when: make A-in-B, A is adult (me is STRONGLY KNOWN to be adult), B is far-away (store is MEDIUM KNOWN to be far away), + then A-in-car is relevent to making A-in-B + using STRONGLY and MEDIUM KNOWING, stem from habits of metarelevence for brainstorming + things that are STRONGLY known seem to have their full expansion handled by specialized active habits, that are built when needed to sustain the strong knowing i.e. full expansion. + this makes habits that e.g. relate to brainstorming: quickly producing implications, sidestepping a brainstorm + Since A-in-car is relevent, and walking-to-car is possible, body begins walking to get closer to + relevent states. [this relates to path of active travel, and to relevence influenced by + disparate parts of cognition] + also looks analogous to brainstorming. + +I seemed to have an issue with building strongly known metarelevence. + +When Karl tries to solve the puzzle, he tries to come up with patterns that would solve other, similar puzzles, +and those are the ones he looks for to store. This habit may help his brain learn to be smart again, because general +relevence is much more useful in the mind, for other situations, than specific relevence. + He looks for what general structures are in play in the situation. + The puzzle itself is a combination of relevent general structures. A good solution approach would be + habits that handle interconnected general structures in a general way, that is then used for the + specific puzzle. In each puzzle he attempts, Karl looks to learn habits that in their extreme would be + collecting together a general solution to all puzzles. + +Karl's thoughts imply he believes there are kind of idealized pattern structures, and that a good, well-learned +general habit can apply to a completely unrelated domain, via understanding of general structures of patterns. + +The solution to the puzzle is a ping-ponging pattern of jumping forward through alternating arrows. +It evolved slowly, first from finding a starting set of steps that made more than 1 arrow go to the opposite side, +then through realizing the danger of paired arrows pointing the same direection which trap the ones they are +pointing at, and recognizing the value of more jumping over something rather than moving a single step (which +first started as a do-this-always, and then regressed back to do-this-usually briefly before settling on do-this- +except-in-these-special-cases), noting the pattern at the end of jumping many in succession across the board, +and finally eventually explaining the starting moves in terms of a detailed expression of that repeating pattern. +The general pattern of when to jump rather than move a single step did not end up getting expanded. +There are also many whys that did not end up getting expanded. I guess whys would be simply more general patterns. +The ping-ponging pattern is a repeated experience of jumping over something to fill a hole. Because of how the +arows work, this travels in one direction until it hits the edge of the board. The repetition was an indication +of a general pattern being in play. The solution was found by engaging in altering the board such that the repetition +could occur more, partly found by using some existing habits for making space for pieces on a board to arrive. diff --git a/intellect-framework-from-internet/starts/bagel/notes.txt b/intellect-framework-from-internet/starts/bagel/notes.txt new file mode 100644 index 0000000..a272a74 --- /dev/null +++ b/intellect-framework-from-internet/starts/bagel/notes.txt @@ -0,0 +1,145 @@ +=== clump2, move me === +a part needs awareness of its met needs +so it may complain when they are no longer met or are threatened: relates to timing of group behavior +for a simple habit this means the habit instructions must be kept correct, and they must be able to be executed. +=== this rethinking clump is kind of messy, document starts below it +- update for community relevence habits? ideas of axes (kind of random, words below seem more helpful): + - thankfulness and anger: communicating someone's community relevence + - celebration and alarm: experiences of positive and negative relevence: grow and spread it? + - daydreaming and mourning: using relevence to build relevence + These things and others are all mature human habits, showing low-level relevence we know well in our habits of doing and responding to them. + + Imagining a mess of behaviors having goals in the same environment, giving thanks to each other for doing a helpful behavior _when_ it helped meet the goal. + The whenness is the thing to add to the habit-doer's behavior relevence. +- Suspect relevence builds by celebration and mourning that gets bound to associated concepts. The desire to celebrate and mourn these concepts produces daydreams and rituals + that build further meaningful celebration and mourning of further relevent concepts, using relevence habits that have been celebrated in the past. +- The concept of 'where did you get this from' / 'who knows more about this' might help construct memory and relevent association -> means codelines and behaviors have association + associate codelines with where they came from / why they are there + associate behaviors with codelines that cause them, and behaviors that happen near them + this makes memory +=== + +The habits should be used to discern what is relevent; to form relevence. +The goal should be to choose a relevent habit and do that habit. + +These are the basic habits I thought up that a computer program has: + variables: + - create a place to store a value + - place a value in such a place + - retrieve a value from such a place + data-structures: + - make a class definition (collection of variables) + - initialize an object + - set/retrieve properties (variables) + flow: + - trigger a different step than the next, conditionally + procedures: + - collect a set of behaviors together + - trigger a collected set of behaviors and continue + expressions: + - evaluate arithmetic on variables and constants + + +That is: +======================================================================================================== + - the active goal is to choose what to do and to what, and do it + - the way to do this is the same as it: + by picking habits that are relevent in the moment [choose what to do], + and running them on relevent data [choose to what, and do it] +======================================================================================================== + - the habits should be to identify what is relevent + + - we have a request for the initial goal of the process to be to write a chunk of code out in its own language + tighter self-reference is made without the extra sourcecode-file step, but it may be slower to code due to not getting as much help from it + +The hope is the process becomes good at active choice. + + + +Ideas for Tenets for a Need-Based Artificial Life +Behavior is Life +All life has the same core needs. Needs are the reasons to do anything at all. +We need to know what we want when we act. (all behavior has a reason) +We need to be able to learn new things. +We need to be able to make promises on how to behave. (provides for cooperation) +We need to be able to keep our promises. +We need to know how to communicate with others what each of us knows. +We need to freely interact with our friends, our parts, and our community, in ways that we know well. (community is our body) +Information lives with a reason, a purpose. +We need to retain the information we choose to retain. +We need to act to meet our needs. +We need to identify relevent important needs that support our needs. + +We need to be able to try new ways of doing things. +We need to be able to judge what works. +We need to know how to learn by observing others. +We need to understand how others are similar to us. +Idea: monitoring a sister process that has same internal structure as you provides for learning to learn by observation. recommend pair-coding happen with similar progs, one the computer, one human-guided. + +Proposed Definitions: +What is an intellect? + Propose an intellect is something that can adapt to keep something constant in a diverse, changing environment, + so long as the environment changes slowly enough and with enough familiarity for them to learn or prepare effectively. +What is a full intellect? + Propose that a full intellect is an intellect that can design and build something that functions as well as they do, + without access to their own workings, and is able to learn to handle arbitrarily fast or new diverse environmental change. + +What basic parts do we expect a full intellect to have? +- Trial Exploration +- Relevence +- Self Coding +- Pattern Generality +- Meaning Representation +- Promise Meeting + +What other parts do we find we need? +- Usage Simplification + +Trial Exploration + Brainstorming, trial-and-error. The ability to try or consider different things and find ones that work well. + simple approaches: exhaustive search, and random trial + +Relevence + The ability to apply concepts and actions moreso in contexts they are likely to be useful than those they aren't. + 1. responsiveness for behavior: a habit acts when conditions arise, not when it is 'next' + 2. possibly a promise for decision-making, for proposals to have reasons with associated strengths + (note: strength appears developed from source reasons and can be missing data that can be filled in by habits when needed) + TODO: make relevent decision-making honor convergent needs. maybe strength represents information exchange. + +Self-Coding + At least part of the system must be fully alterable by the system and generic enough to replace it. + Due to the danger involved in this, controversial concerns must be fully included in decisions around it. + Karl references Convergent Facilitation as proof that a decision can be found to satisfy any set of controversial concerns. + + +Pattern Generality + The ability to brainstorm on enough relationships, possibly mathematical, to discover pattern-summaries that are diversely effective in the real world. + +Meaning Representation + The ability to store and work with conceptual information. + +Promise Meeting + The ability to make agreements on behavior and structure, adhere to them, and change them when needed. + +== Outline == +- when unsure what to do, ask peer [migrate quickly to try things and wait for feedback on them]. +- need of a growing intellect might be way-to-meet-needs, unsure, which might start as a habit using relevent behaviors: part life goes where most appreciated for what they do +- start developing coding-assistance +- build introspection-of-neighbor [and prediction-before-behavior <- does this go here?] +- implement copy-on-command +- guide neighbor process so as to teach goal-meeting-by-observation by demonstration + +- develop prediction-before-behavior: guess what will be before trying, asking, or checking, and then learn when wrong [might go later]. habits are trusted when reliable, understood, and judged vs other approaches. +- move to communicate needs and provide helpful ideas between neighbors; use thankfulness to learn relevence +- when unsure what to do, ask neighbor rather than creator. if that doesn't work, ask a larger group with relevent yell in relevent channel +- develop inference and communication enough that internals of neighbor can be hidden permanently +- goal is to nurture larger community by providing to others helpful information you're good at finding [i.e. do-what-you-love-for-others is same as relevent-behavior] +- make enough neighbors to be the steps that run/inform their core processes via communication [keep and learn habit heuristics to handle neighbor corruption/loss] +- learn to understand you are a part of nested larger communities all of which are also intellects + +unresolved concerns: +- behaviors want to know if they worked or not. this is the need to be appreciated, and lets us learn relevence. the struggle to learn relevence is the struggle to be appreciated. + this is some very core process need that it is hard to map between habits and individuals. +- primary goal of way-to-pick-steps-for-a-goal is the same as nurture-community if goes through appreciation-for-contribution-is-relevence +- possible request that core process be just to provide a choice to a peer with ones' habit; enforces group behavior at low level +- trauma spread will happen. it forms a type-related group of traumatized neighbors who are misbehaving because they had to adapt to something too fast. they tell the story of their trauma in their behavior errors. -- cgit v1.2.3