Feat/PRINTF and FAIL instructions + make instruction set expansion easier #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add PRINTF and FAIL instructions. PRINTF is used for debugging and will cause
generate_program_execution
to print out the field element at addressa
in address spaced
; the trace generated will not be verifiable. FAIL will causegenerate_program_execution
to fail (returnErr
). Neither affects the AIR constraints as they can never appear in a verifiable execution (in this way, a program that fails cannot be verified, which seems desirable).The eDSL instructions PrintV and PrintF are compiled to PRINTF. The eDSL instruction Trap is compiled to FAIL. Additionally, FAIL is used in the program AIR to pad the trace.
Change
generate_program_execution
to return aResult
and introduce theExecutionError
enum to capture the possible failure modes.Overhaul how enabling/disabling instruction sets is handled to make (near) future expansion easier.