Friday, 10 March 2023

cgpt

 we are working on a computer graphics and debugging system that involves capturing moments in time when certain properties occurred on sets of objects

The A will capture moments of time that sets of C had properties that occurred. The A will talk of C. The A.c.ip always positions A amongst a pile of A(.y.up=Aabove or .sc.z=[Abelow]) with various properties to recurse into, each coming from some other A.

you should be able to build a robust and reliable system.

A has four properties: t, y, c, sc. so does C. A.t is the name of a kind of object class to apply to the A. A.t is looked up in the mind, finding a thing to be like. y contains properties with the most empiricism from the underlying machine in them, eg A.y.up links to the A this A was sprouted from, A.y.cv is a fraction of 1 where the A is, etc. c contains properties still of quite machiney disposition, eg A.c.pi (unrelated to Math.pi or A.c.ip) is a super- and sub-type of class to apply (ie act like a pi of spacal if {pi:'spacal'}) forming the base identity of most atoms in most situations in the program, except perhaps in highly specialised corners. A.sc is the most open to the universal qualities of the thing in itself, beyond the machine that holds it, eg A.sc.colour is a pure essence from the thing we are modelling (on the machine)

the C (capital C) are artifacts (usually) independent of time (but sometimes modified over time as part of the process (whatever the mind says)), and the mind would be made of these. the mind is $mind/C**/D**, the ** there meaning that step may repeat infinitely. all that is C nested within each other, but the C are things and the D are steps|aspects within that thing.

the same way y,c,sc slopes towards the essential, A,C does also. A may hold many C in them (unless pressure to resolve micro-manipulations via A compels an A per C to take some linguistic and structural load) and tally various properties across the lot of them, usually grouping like C-things, so that the expression of many C on the screen can be a stack of individuals bulging around and|or into the items of identity that can be nested in space (ie a small 2d tiling problem, trying to express efficiently the composition of a bunch of information)

lets use this|that and outside/in notation. ie, house/room/person/dialectic is the situation around me now. the A also experiences time being the mind (of A.t, or overridden by A.c.mind_t), which can be measured out into A.y.cv (the A moves up to where mind/bit was) or A.y.mindbit (the mind/bit itself, which can be compared with others around it, even as A.y.cv if the bits are in different minds). so the A pick up minds and progress matter with them. usually an A would be tracking where its inside A are up to, so that they can be simpler, and keep cursors to resume from going async, iterate them in certain orders, etc.

"A.c.ip" forms an infinite branching space, which serves as an IP address of variable length. When lots of "A" objects are vacuumed out of graph space, some overall sense can be made of their origin and relation, potentially allowing other relations to be filled in as well. This suggests that the "A.c.ip" property is a key component of how "A" objects are organized and related to each other in the program.

# chatgpt finds it easy to make these
const i = (C, z) => {
  if (!C.sc) C.sc = {};
  if (!C.sc[z]) C.sc[z] = [];
  C.sc[z].push(C);
};

lets make typescript for A and C forming. the A class should let us A.A_(...). A should extend C. the C_(t,y,c,sc) function that makes a C from a list, and we use inside A.A_(t,y,c,sc) to make new A (with subdividing|serial-numbered A.c.ip). C dont usually have an ip, but A always do. C_('Bev') should return an empty C except for C.t='Bev' with the C.y|c|sc empty hashes|objects.

use A1 = C_('toplevel') to make the first A (whose A.c.ip = 1),

use A11 = A1.A_('someprocess') to create A:1.1 (A11.c.ip=[1,1]), begins serial A1.c.ips=1 (number of children had), does i_(A1, A11) to add A:1.1 to A:1 (into A1.sc.z=[...])

then give all A:1.* some C, with i_(). i_() must C.sc.z ||= [] to hold C, or C.sc.etc if qua='etc'. C.sc.z tends to mean "inside of". by default A have their children in A.sc.z, but they might move out...

if given no t argument in C_() or A_(), C.t can be set to '', A.t usu inherit from above.

the y,c,sc are each empty objects until properties are defined (eg C.sc.z), and all C should be created by C_() (and A by A.A_(), except the toplevel that is made by C_() and mutated into an A as above)

you shouldn't have to specify any y|c|sc in C_ or A_ you dont want to. C.t may be ''. C.c.ip generally dont happen whereas A.c.ip always does, just as C may not be in anything but A always are. all the A.c.ip looks good, but the counter needs to be on the A itself (not as static) and appear only when the A becomes a parent. A.c.ip should really be an array of numbers, so we can sort it well.


(paste St.ts (4de7140) from 35f75ce1bd3daa2a04cef44e01f500ea3d3b60c2 here)
export function realisme () {
let A1 = C_('toplevel')
A1.c.ip = [1]

let A11 = A_(A,'glamphor')

// create some Cs for authors
let Joyce = C_('Joyce', {}, {born: '1882', died: '1941'}, {author: true})
let Faulkner = C_('Faulkner', {}, {born: '1897', died: '1962'}, {author: true})
let Woolf = C_('Woolf', {}, {born: '1882', died: '1941'}, {author: true})

// create some As with authors
let A1 = A_(C_('toplevel', {}, {}, {author: false}))
let A11 = A_(A1, 'glamphor')
i_(A1, A11)

let A111 = A_(A11, 'Dublin')
C_(A111, {}, {author: Joyce})


return [A1, A11]
}
// the baskets of properties that are C.y|c|sc
interface gc {
[key: string]: any
}
interface C {
t: string; // name of object class to apply to C
y: gc; // properties derived from the underlying machine
c: gc; // properties defining the base identity of C
sc: gc; // properties representing the essential qualities of C
}
interface A extends C {
y: {
up?: A; // A this A was sprouted from
}
c: {
ip: number[]; // IP address of variable length
ips?: number; // how many children it has had
}
}

// make new C, specifying innards
function C_(t: string|Array|C, y?:number|gc, c?:gc, sc?:gc):C {
if (isar(t)) {
[t,y,c,sc] = t
}
if (!isst(t)) {
// t must be C, from C_(C)
throw "TODO clone = C_(C)"
}
if (isnum(y)) {
if (y <= 0)
throw "y <= 0"
while (y > 1)
y /= 10
y = {cv:y}
}
t ||= ''
y ||= {}
c ||= {}
sc ||= {}
return {t,y,c,sc}
}
function A_(A:A, t?:string):A {
t ||= A.t
let A2 = C_(t)
// ip address (infinite position)
A.c.ips ||= 0
A.c.ips++
A2.c.ip = [...A.c.ip,A.c.ips]
// parent
A2.y.up = A
i_(A,A2)
return A2
}
function i_(C1: C, C2: C, qua: string = 'z') {
let N = C1.sc[qua] ||= []
N.push(C2)
}

// type checking, ported from Fividy
function isst(s) {
return typeof s == 'string'
}
function isnu(s) {
return typeof s == 'number'
}
function isnum(s) {
return (isnu(s) || s && s.length && !isspace(s)) && s*1 == s
}
function isar(s) {
return s && s.constructor == Array
}
let spacechars = {" ":1,"\n":1,"\t":1}
function isspace(s) {
return hak(s) && !havs(s).some(s => !spacechars[s])
}
// and further back
function hak(s,d) {
if (!s)
return 0
return d == null ? Object.keys(s).length : s.hasOwnProperty(d)
}
function havs(s,d) {
return haks(s).map(k => s [k])
}
function haks(s,d) {
let N = [];
if (!s) {
return N
}
for (let k in s) {
let v = s[k]
if (d == 'kv') { N.push(k,v) }
else
if (d == 's') { N.push(v) }
else {
N.push(k);
}
}
return N
} 

can you alter the typescript to be more like the spec? eg the A.A_() birthing method

(see 87722792ce7d4f8d3a0d947c34106d73a325d3f3 for some good stupid catching. nothing major, some clearly bogus additions that when queried evoke "You are correct, those ACon interfaces do not seem to be used in the provided code and do not have any apparent purpose.") 

lets allow i_() to have that third parameter qua, which provides named linkages like C1.sc.$qua.push(C2)

function i_(C1:C, C2:C, qua?: string) {
    if (!C1.sc[qua]) {
        C1.sc[qua] = []
    }
    if (C1.sc[qua].includes(C2)) {
        return
    }
    C1.sc[qua].push(C2)
}

I've gone with function i_(C1: C, C2: C, qua: string = 'z') {
    let N = C1.sc[qua] ||= []
    N.push(C2)
} thanks for your help so far.

I need to give A11 some C, name them after old authors like Joyce. also A111, A112, A113, A12, A121, A1211. they all need at least one C about an author. fill in some C.sc.* about their nature if you like.

It Gets Ugly

export function realisme() {
  let A1 = C_("toplevel");
  A1.c.ip = [1];

  let A11 = A_(A1, "glamphor");
  let A111 = A_(A11, "Joyce");
  i_(A11, A111, "authors");
  C_(A111, undefined, undefined, { nationality: "Irish", genre: "Modernism" });

  let A112 = A_(A11, "Woolf");
  i_(A11, A112, "authors");
  C_(A112, undefined, undefined, { nationality: "British", genre: "Modernism" });

  let A113 = A_(A11, "Faulkner");
  i_(A11, A113, "authors");
  C_(A113, undefined, undefined, { nationality: "American", genre: "Modernism" });

  let A12 = A_(A1, "Mamet");
  i_(A1, A12, "authors");
  C_(A12, undefined, undefined, { nationality: "American", genre: "Realism" });

(On an on, messing up the args to C_)

Rewind 1

in realisme(), lets give A11 some C named after old authors like Joyce. make some A111, A112, A113, A12, A121, A1211 all named after places like 'glamphor'. give them all at least one C about an author. the C.t should be the authors name, they may have %author (which means C.sc.author=1).
lets also call C_('the name',,,{etc:1}) for empty y,c

No comments:

Post a Comment