Nock.Jets (Anoma v0.29.0)

Jets for the Nock interpreter, taking a gate core. Not fully general.

Summary

Functions

@spec abs(Noun.t()) :: :error | {:ok, Noun.t()}
Link to this function

action_delta(core)

@spec action_delta(Noun.t()) :: :error | {:ok, Noun.t()}
@spec add(Noun.t()) :: :error | {:ok, Noun.t()}
@spec bex(Noun.t()) :: :error | {:ok, Noun.t()}
Link to this function

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()}
Link to this function

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 itself

  • parent_layer - the layer of the standard library. This should be the same as the layer numbers found in anoma.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
Link to this function

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 in anoma.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

Link to this function

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

Link to this function

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

@spec cmp(Noun.t()) :: :error | {:ok, Noun.t()}
@spec cue(Noun.t()) :: :error | {:ok, Noun.t()}
@spec dec(Noun.t()) :: :error | {:ok, Noun.t()}
Link to this function

delta_add(core)

@spec delta_add(Noun.t()) :: :error | {:ok, Noun.t()}
Link to this function

delta_sub(core)

@spec delta_sub(Noun.t()) :: :error | {:ok, Noun.t()}
@spec dif(Noun.t()) :: :error | {:ok, Noun.t()}
@spec div(Noun.t()) :: :error | {:ok, Noun.t()}
@spec dul(Noun.t()) :: :error | {:ok, Noun.t()}
@spec fra(Noun.t()) :: :error | {:ok, Noun.t()}
@spec gte(Noun.t()) :: :error | {:ok, Noun.t()}
@spec gth(Noun.t()) :: :error | {:ok, Noun.t()}
@spec jam(Noun.t()) :: :error | {:ok, Noun.t()}
@spec lsh(Noun.t()) :: :error | {:ok, Noun.t()}
@spec lte(Noun.t()) :: :error | {:ok, Noun.t()}
@spec lth(Noun.t()) :: :error | {:ok, Noun.t()}
Link to this function

make_delta(core)

@spec make_delta(Noun.t()) :: :error | {:ok, Noun.t()}
@spec met(Noun.t()) :: :error | {:ok, Noun.t()}
@spec mix(Noun.t()) :: :error | {:ok, Noun.t()}
@spec mod(Noun.t()) :: :error | {:ok, Noun.t()}
@spec mul(Noun.t()) :: :error | {:ok, Noun.t()}
@spec nend(Noun.t()) :: :error | {:ok, Noun.t()}
@spec pro(Noun.t()) :: :error | {:ok, Noun.t()}
@spec rem(Noun.t()) :: :error | {:ok, Noun.t()}
@spec rsh(Noun.t()) :: :error | {:ok, Noun.t()}
@spec sample(Noun.t()) :: :error | {:ok, Noun.t()}
@spec shax(Noun.t()) :: :error | {:ok, Noun.t()}
@spec sign(Noun.t()) :: :error | {:ok, binary()}
Link to this function

sign_detatched(core)

@spec sign_detatched(Noun.t()) :: :error | {:ok, binary()}
@spec sub(Noun.t()) :: :error | {:ok, Noun.t()}
@spec sum(Noun.t()) :: :error | {:ok, Noun.t()}
@spec sun(Noun.t()) :: :error | {:ok, Noun.t()}
@spec syn(Noun.t()) :: :error | {:ok, Noun.t()}
@spec verify(Noun.t()) :: :error | {:ok, binary()}
Link to this function

verify_detatched(core)

@spec verify_detatched(Noun.t()) :: :error | {:ok, 0 | 1}