/ example \d .k.q a:100 i:{[x]r:0;do[1000000;r+:g x];r} g:{[x]a+x} h:(3;{x+y}) m:,.+(`b`c`d`i;(10;{x*y};20;{z+y-x})) f..i:{x*y} z:.() \d .k / path from symbol ps:{[s] a:{[f;p;v]:[f[p;v]&7=t:4:v;p;(t=6)|~t _in 0 5;();p,/:,/'_f[f]'[:[0=t;!#:;!:]v;v[]]_dv()]} d:{[f;p;v]if[(v~.())|~5=4:v;:a[f;p]v];m:. v;p,/:,/(_f[f]'[m[;0];m[;1]]),_f[f]'[~m[;0];m[;2]]} d[{[s;p;v]s~*|p}[s];()]@.`} / path from object po:{[o] a:{[o;p;v]:[o~v;p;(t=6)|~(t:4:v)_in 0 5;();p,/:,/'_f[o]'[:[0=t;!#:;!:]v;v[]]_dv()]} d:{[o;p;v]if[(v~.())|~5=4:v;:a[o;p]v];m:. v;p,/:,/(_f[o]'[m[;0];m[;1]]),_f[o]'[~m[;0];m[;2]]} d[o;();.`]} / path from k-type(s) pt:{[k] a:{[k;p;v]:[(t:4:v)_in k;p;(t=6)|~t _in 0 5;();p,/:,/'_f[k]'[:[0=t;!#:;!:]v;v[]]_dv()]} d:{[k;p;v]if[(v~.())|~5=4:v;:a[k;p]v];m:. v;p,/:,/(_f[k]'[m[;0];m[;1]]),_f[k]'[~m[;0];m[;2]]} d[(),k;();.`]} \ pt 7 ps`i po(.()) po{x*y} \ ps`i: (`k `q `i (`k;`q;`m;0;`i) `k `q `f. `i) po{x*y}: ((`k;`q;`m;0;`c) `k `q `f. `i) \ the k tree is a set of associations from symbols in a dictionary to objects or indices in a list to objects. it follows that given a symbol it should be possible find all the paths in the k tree which terminate in that symbol. if also follows that given an object (which might be a symbol) it should be possible to find all variables in the k tree which have that object as their value. given a symbol s the function ps returns a list of paths in the k tree which terminate in s. given an object o the function po returns a list of paths in the k tree which have o as their value.