Nock.Jets (Anoma v0.29.0)
Jets for the Nock interpreter, taking a gate core. Not fully general.
Summary
Functions
We calculate the mug of a given core at a given gate.
We calculate the mug of a given layer at any given gate.
Like calculate_mug_of_core/2
except we work over a parameterized core.
Like calculate_mug_of_layer/1
except we work over a parameterized core.
Functions
abs(core)
action_delta(core)
add(core)
bex(core)
calculate_core_param(core_index, gate_index, parent_layer)
@spec calculate_core_param( non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: :error | {:ok, Noun.t()}
calculate_mug_of_core(index_in_core, parent_layer)
@spec calculate_mug_of_core(non_neg_integer(), non_neg_integer()) :: non_neg_integer()
We calculate the mug of a given core at a given gate.
Parameters
index_in_core
- the index of the gate itselfparent_layer
- the layer of the standard library. This should be the same as the layer numbers found inanoma.hoon
Example
In the Hoon repl one should write
dojo> |commit %anoma
>=
dojo> =anoma -build-file /=anoma=/lib/anoma/hoon
dojo> => anoma !=(sub)
[9 47 0 31]
Now in IEX
> Nock.Jets.calculate_mug_of_core(47, 1)
14801825384048474882
calculate_mug_of_layer(layer)
@spec calculate_mug_of_layer(non_neg_integer()) :: non_neg_integer()
We calculate the mug of a given layer at any given gate.
Parameters
parent_layer
- the layer of the standard library. This should be the same as the layer numbers found inanoma.hoon
Example
In the Hoon repl one should write
dojo> |commit %anoma
>=
dojo> =anoma -build-file /=anoma=/lib/anoma/hoon
dojo> => anoma !=(sub)
[9 47 0 31]
Now in IEX
> Nock.Jets.calculate_mug_of_layer(1)
17654928022549292273
This value should match Nock.@layer_1_contex_mug
calculate_mug_of_param_core(index_in_core, core_index, parent_layer)
@spec calculate_mug_of_param_core( non_neg_integer(), non_neg_integer(), non_neg_integer() ) :: non_neg_integer()
Like calculate_mug_of_core/2
except we work over a parameterized core.
Example
> Nock.Jets.calculate_mug_of_param_core(767, 10, 4)
12605872635346981159
For our standard library, so far only layer 4 is parameterized
calculate_mug_of_param_layer(core_index, parent_layer)
@spec calculate_mug_of_param_layer(non_neg_integer(), non_neg_integer()) :: non_neg_integer()
Like calculate_mug_of_layer/1
except we work over a parameterized core.
Example
> Nock.Jets.calculate_mug_of_param_layer(10, 4)
11284470320276584209
For our standard library, so far only layer 4 is parameterized
cmp(core)
cue(core)
dec(core)
delta_add(core)
delta_sub(core)
dif(core)
div(core)
dul(core)
fra(core)
gte(core)
gth(core)
jam(core)
lsh(core)
lte(core)
lth(core)
make_delta(core)
met(core)
mix(core)
mod(core)
mul(core)
nend(core)
pro(core)
rem(core)
rsh(core)
sample(arg1)
shax(core)
sign(core)
sign_detatched(core)
sub(core)
sum(core)
sun(core)
syn(core)
verify(core)
verify_detatched(core)
@spec verify_detatched(Noun.t()) :: :error | {:ok, 0 | 1}