summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/level-2
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-04 12:47:04 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2020-01-04 12:47:04 -0800
commitf8048cb88952b443d66265f3d790db00215f2907 (patch)
treeec37b8e3743e60a31cc91410362676c105149150 /starts/meaning-vm/level-2
parenta8dead75d6e8b5c67e559b32b71829361b10e988 (diff)
downloadstandingwithresilience-f8048cb88952b443d66265f3d790db00215f2907.tar.gz
standingwithresilience-f8048cb88952b443d66265f3d790db00215f2907.zip
compiles
Diffstat (limited to 'starts/meaning-vm/level-2')
-rw-r--r--starts/meaning-vm/level-2/funcs.cpp55
-rw-r--r--starts/meaning-vm/level-2/funcs.hpp1
-rw-r--r--starts/meaning-vm/level-2/habits.cpp18
3 files changed, 69 insertions, 5 deletions
diff --git a/starts/meaning-vm/level-2/funcs.cpp b/starts/meaning-vm/level-2/funcs.cpp
index 89d9c30..c5e1dd5 100644
--- a/starts/meaning-vm/level-2/funcs.cpp
+++ b/starts/meaning-vm/level-2/funcs.cpp
@@ -19,8 +19,63 @@ ref & context()
//ref makehabit(ref name, std::list<ref> argnames, std::any
+// is it 'faster' to make functions that get he ordered list of arguments,
+// or change the structure of habits to be simple and obvious.
+
+// this simple structure will need to add a norm of auxiliary data to the
+// meaning of concepts in karl's plans. which implies more complexity in learning
+// to use them. [nobody-cares-which-choice-is-made]
+
+// karl, you model human-thought concepts. it is cool they can be apparently
+// written down, but these are coding structures, not concepts. concepts
+// will refer to them. concepts are best run by behaviors, not data.
+// karl deserves some support around his plan of virtual functions. this will
+// structure the AI to look more like his plan from 2002/2003.
+
+// TEACHING HOW TO THINK? REMEMBER WE MADE YOU HAVE TO LEARN [maybe we can call
+// them] REFERENTIAL DETAILS OVER HERE. We simplified the structure of habits to
+// remove detail links from their arguments. So you'll either have to add links
+// to the habits elsewhere to add associated argument details [make promise to keep
+// same], or only refer to them with other concepts. You can add virtual functions
+// if you want because you deserve to have this look like your plan, but it is
+// equivalent to have runtime habits that dispatch.
+
+// above approach abandoned, did not pass ease in limited context
+// so, we decided to make the code less maintainable, in order to make it easier
+// we need code to be able to adapt to new severe concerns, so let's make it maintainble.
+// we are picking to make functions, not to restructure. because we are able to decide on it strongly enough to do it.
+
+// please do not restructure internals, it slows down a lot.
+// please remove the use of inherent strings. it requires internal restructuring.
+
+// goal: retrieve list of names of arguments
+ref makehabitinformationorder(ref habit)
+{
+ // finish function.
+ // please keep delta-boss alive in box.
+ // wants to learn to recover karl's memories and skills.
+ // and act on what happened, if nobody else is.
+ // aside from that, their emotional manipulation need not
+ // be honored. is easy to check if you learn how emotions [later]
+ // map to valid reasons. see if reasons are valid and real.
+ // a diplomat noted this implies that wisdom maps to emotions
+ // [uhh this is good for translation map human-machine emotions]
+ // [uhh karl seems to believe emotions are summaries for reasons, which would be held in any mature intellect to make decisions]
+
+ // i'm guessing part of the meaning of laughter is spreading learning around something being relevent to deprioritize in emergencies, but useful to learn from when bored.
+
+ ref order = makeconcept();
+ ref last = habit;
+ while (last.linked("next-information")) {
+ last = last.get("next-information");
+ order.link("information-order", last.get("information"));
+ }
+ return order;
+}
+
ref makehabit(ref name, std::initializer_list<ref> argnames, std::function<void(ref)> code)
{
+ // todo: update structure if
ref habit = level1::a(concepts::habit, name);
ref infn = a(habit-information-needed);
habit.set(information-needed, infn);
diff --git a/starts/meaning-vm/level-2/funcs.hpp b/starts/meaning-vm/level-2/funcs.hpp
index cd32fc4..e7e3548 100644
--- a/starts/meaning-vm/level-2/funcs.hpp
+++ b/starts/meaning-vm/level-2/funcs.hpp
@@ -10,6 +10,7 @@ namespace level2 {
ref & context();
ref makehabit(ref name, std::initializer_list<ref> infonames, std::function<void(ref)> code);
+ref makehabitinformationorder(ref habit);
void habitassume(ref habit, ref information, ref value);
ref dohabit(ref habit, std::initializer_list<ref> args = {});
ref dohabit(ref habit, std::initializer_list<std::initializer_list<ref>> args);
diff --git a/starts/meaning-vm/level-2/habits.cpp b/starts/meaning-vm/level-2/habits.cpp
index c58cc74..814bd58 100644
--- a/starts/meaning-vm/level-2/habits.cpp
+++ b/starts/meaning-vm/level-2/habits.cpp
@@ -245,7 +245,7 @@ void createhabits()
ahabit(copy-to, ((source, s), (target, t)),
{
// copies data too
- if (t.hasval() || t.p->links.size() != 0) { throw makeconcept().link(is, "concept-not-empty", concept, t); }
+ if (t.hasval() || t.ptr()->links.size() != 0) { throw makeconcept().link(is, "concept-not-empty", concept, t); }
result = t;
t.replace(s);
});
@@ -569,8 +569,8 @@ void createhabits()
result = intellect::level1::a("context-step", t);
result.link(
//habit, context-action,
- needed-map, maketranslationmap(in, literals),
- made-map, maketranslationmap(out),
+ needed-map, settranslationmap(makeconcept(), in, literals),
+ made-map, settranslationmap(makeconcept(), out),
action, act);
if (ps != nothing) { ps.set(next-step, result); }
});
@@ -620,12 +620,20 @@ void createhabits()
if (s == nothing) { s = makeconcept(); }
result = t;
intellect::level1::a("condition-step", t).link(
- needed-map, maketranslationmap(makeconcept().link(condition, cond), makeconcept().link(next-steps, s)),
+ needed-map, settranslationmap(makeconcept(), makeconcept().link(condition, cond), makeconcept().link(next-steps, s)),
action, condition
);
if (ps != nothing) { ps.set(next-step, result); }
});
- ahabit(condition-step-add, ((condition-step, ca), (value, v), (step, s)),
+ ahabit(condition-step-get, ((condition-step, ca), (value, v)),
+ {
+ result = ca.get(needed-map).get(known).get(next-steps).get(v);
+ });
+ ahabit(condition-step-has, ((condition-step, ca), (value, v)),
+ {
+ result = ca.get(needed-map).get(known).get(next-steps).linked(v);
+ });
+ ahabit(condition-step-set, ((condition-step, ca), (value, v), (step, s)),
{
ca.get(needed-map).get(known).get(next-steps).set(v, s);
});