Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completed Operators #26

Merged
merged 33 commits into from
Jan 23, 2024
Merged

Completed Operators #26

merged 33 commits into from
Jan 23, 2024

Conversation

KevinOnFrontEnd
Copy link
Owner

@KevinOnFrontEnd KevinOnFrontEnd commented Jan 18, 2024

Now that the SExp tree is built and has unit tests, the bulk of the logic of applying the operators to the atoms needs to be wired up. While the operators are ported, the method that applies the operators needs to be wired up to apply the different types of op codes to the sexp tree. This PR deals with wiring up the method that applies the different op codes to the tree and returns the result as a SExp tree.

ApplyOperator (opcodes on atoms as ints)

  • OpAdd
  • OpSubtract
  • OpMultiply
  • OpDivide
  • OpDivMod
  • >
  • ash
  • lsh
  • DefaultUnknownOp ( . | a | q)
  • DefaultUnknownOp Tests

ApplyOperator (core opcodes)

  • .
  • q
  • a
  • i
  • c
  • f
  • r
  • l
  • x

ApplyOperator (opcodes on atoms as strings)

  • =
  • >s
  • sha256
  • substr
  • strlen
  • concat

ApplyOperator (opcodes on atoms as vectors of bools)

  • logand
  • logior
  • logxor
  • lognot

ApplyOperator (opcodes for bls 1381)

  • point_add (WIP)
  • pubkey_for_exp

ApplyOperator (bool opcodes)

  • not
  • any
  • all

Misc OpCodes

  • softfork

The Python version of the clvm runs the compile in two phases, first from source to IR replacing op codes, then the second phase by evaluating the tree using op codes. The below cannot be started until the above has been wired up and has tests around them.

clvm

  • run_program

clvmtools

  • run_program_for_search_paths (WIP)
  • run_program (WIP)
  • compile_clvm_text
  • compile_clvm
  • find_files

curry

  • curry
  • uncurry

@KevinOnFrontEnd KevinOnFrontEnd changed the title Run program Completed Operators Jan 23, 2024
@KevinOnFrontEnd KevinOnFrontEnd merged commit 895a161 into main Jan 23, 2024
2 checks passed
@KevinOnFrontEnd KevinOnFrontEnd deleted the run_program branch January 23, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant