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

Display expression #216

Merged
merged 1 commit into from
May 10, 2024
Merged

Conversation

uncomputable
Copy link
Collaborator

Display Simplicity expressions as linear strings, like in the tech report. Include some simple transformations like infix pair and comp, and true or false, and the {O,I,H} notation. This will make debugging much easier.

Display Simplicity expression as a linear string. The linear string
is potentially exponentially larger than the originally shared
expression. Therefore, I add a constructor that the user has to
explicitly call. Similar to bitcoin::key::KeyPair::display_secret().

Do some simple transformations to increase readability.
I do these transformations on-the-fly as I am iterating over the
tree. There is minimal redundancy because `iden` and `unit` nodes
need to check their parents to know their serialization. This
should be neglible in the face of the exponential blowup which might
occur due to lack of sharing.

We _could_ introduce a new node type that adds new leaves for `false`,
`true`, `oih`, etc., but I don't feel like doing that work right now.
@uncomputable uncomputable changed the title Node: Add DisplayExpr Display expression May 8, 2024
Copy link
Collaborator

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 4aa2fc5

@apoelstra apoelstra merged commit 8f25e8e into BlockstreamResearch:master May 10, 2024
16 checks passed
@uncomputable uncomputable deleted the display branch August 24, 2024 13:39
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.

2 participants