IntersectMBO / IntersectMBO/formal-ledger-specifications

Refactor `UTXO-inductive`

Open
#813 0 comments 0 reactions 0 assignees View on GitHub
refactor
Dominant language
Agda
Stars
52
Forks
20
Avg merge
6d 14h
Merged PRs (30d)
7

Description

Since I'm thinking about it right now, here are some things that should help readability a bit:
- `UTXO-inductive` should be renamed to `UTXO`. It's not an induction rule, so this name is just misleading. I think this name comes from a very old version of the Shelley spec where it was indeed an induction principle, and nobody bothered renaming it.
- We have 5 checks in there that quantify over outputs. It might be a good idea to introduce some kind of `validOutput` predicate and replace all of those lines with `∀[ (_ , txout) ∈ ∣ txoutsʰ ∣ ] validOutput txout`. The only check that shouldn't go there is the one about the `NetworkId`, because of the next item.
- Finally introduce a `transactionWellFormed` predicate, which checks all the `NetworkId` checks as well as the `txADhash` check from `UTXOW`. For now I think the best place to check this new predicate is as part of `UTXOW`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.