Skip to content

Add uplc executable user guide#7745

Merged
zliu41 merged 7 commits into
masterfrom
zliu41/doc-uplc
Apr 29, 2026
Merged

Add uplc executable user guide#7745
zliu41 merged 7 commits into
masterfrom
zliu41/doc-uplc

Conversation

@zliu41
Copy link
Copy Markdown
Member

@zliu41 zliu41 commented Apr 28, 2026

No description provided.

@zliu41 zliu41 requested review from a team, ana-pantilie and basetunnel April 28, 2026 01:31
@zliu41 zliu41 added the No Changelog Required Add this to skip the Changelog Check label Apr 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

PR Preview Action v1.6.3

🚀 View preview at
https://IntersectMBO.github.io/plutus/pr-preview/docs/pr-7745/

Built to branch gh-pages at 2026-04-28 21:10 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown
Contributor

@Unisay Unisay left a comment

Choose a reason for hiding this comment

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

Nice doc!

Here are my few nits ;)

loadArgsFromDir baseDir title argKind = do
let dir = baseDir </> title
paths <- collectArgFiles dir 1
paths <- collectArgFiles dir 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please update the haddock above correspondingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMO worth adding a changelog entry since this is a user facing behavior change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ideally I'd want to see this function unit tested too

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will add some functionality tests at the uplc executable level separately.

Comment thread doc/docusaurus/docs/uplc-cli-tool.md Outdated
Comment thread doc/docusaurus/docs/uplc-cli-tool.md Outdated
Comment thread doc/docusaurus/docs/uplc-cli-tool.md Outdated
Comment thread doc/docusaurus/docs/uplc-cli-tool.md Outdated
Comment thread doc/docusaurus/docs/uplc-cli-tool.md Outdated
Co-authored-by: Yura <1009751+Unisay@users.noreply.github.com>
Co-authored-by: Yura <1009751+Unisay@users.noreply.github.com>
Co-authored-by: Yura <1009751+Unisay@users.noreply.github.com>
Co-authored-by: Yura <1009751+Unisay@users.noreply.github.com>
Comment thread doc/docusaurus/docs/uplc-cli-tool.md Outdated
uplc optimize -i MyValidator.uplc -o MyValidator-opt.uplc --certify MyProof
```

This produces an Agda project (the default output mode) that encodes a correctness proof of the transformation, named after the `MyProof`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did you mean:

Suggested change
This produces an Agda project (the default output mode) that encodes a correctness proof of the transformation, named after the `MyProof`.
This produces an Agda project (the default output mode) that encodes a correctness proof of the transformation, named after the argument given to `--certify` (in this example, `MyProof`).

?

```

This produces an Agda project (the default output mode) that encodes a correctness proof of the transformation, named after the `MyProof`.
You can then run the Agda type checker on the generated project to verify the certificate.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we explain how to do this?

The nix develop shell comes with the agda-with-stdlib-and-metatheory executable. You must cd into the MyProof-.../src directory and run agda-with-stdlib-and-metatheory MyProof.agda, where MyProof.agda is the main module of the Agda project.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I suppose the Agda project contains instructions on how to type check it. If not, we should add it there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It doesn't. We could add README.md with the instructions and bundle it with each certificate. I'll add an issue for that.


For blueprints, the certifier runs once per validator.
Report filenames and project directories have the validator's title appended automatically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would also mention the --certified-opts-only option. If someone is interested in using the uplc executable for certification, they most likely want a certificate which reflects the correctness of all of the optimizations which were run on the program.

{-| Load args from a dir.

It tries to load the first arg from the file named "1", second from "2", and so on,
It tries to load the first arg from the file named "0", second from "1", and so on,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like Phil convinced you to change this! 😄

@zliu41 zliu41 merged commit e3eb4c7 into master Apr 29, 2026
10 checks passed
@zliu41 zliu41 deleted the zliu41/doc-uplc branch April 29, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Changelog Required Add this to skip the Changelog Check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants