Skip to content

Fix various issues in Dijkstra CddlSpec to make all the tests pass#5779

Open
Soupstraw wants to merge 9 commits into
masterfrom
jj/constr-fix
Open

Fix various issues in Dijkstra CddlSpec to make all the tests pass#5779
Soupstraw wants to merge 9 commits into
masterfrom
jj/constr-fix

Conversation

@Soupstraw
Copy link
Copy Markdown
Contributor

@Soupstraw Soupstraw commented Apr 29, 2026

Description

This PR fixes various issues in Dijkstra's CddlSpec to make the tests pass. The PR is intended to be reviewed commit-by-commit.

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@Soupstraw Soupstraw force-pushed the jj/constr-fix branch 9 times, most recently from bb16935 to 18abd91 Compare May 6, 2026 14:19
@Soupstraw Soupstraw force-pushed the jj/constr-fix branch 3 times, most recently from 43eca9a to 2b2085f Compare May 11, 2026 11:19
@Soupstraw Soupstraw force-pushed the jj/constr-fix branch 18 times, most recently from 251f6bc to 21f3437 Compare May 19, 2026 13:23
@Soupstraw Soupstraw force-pushed the jj/constr-fix branch 10 times, most recently from 98ebbfa to 8fe7ccd Compare May 20, 2026 14:44
@Soupstraw Soupstraw changed the title Add custom generator and validator to constr Fix various issues in Dijkstra CddlSpec to make all the tests pass May 20, 2026
@Soupstraw Soupstraw marked this pull request as ready for review May 20, 2026 14:46
@Soupstraw Soupstraw requested a review from a team as a code owner May 20, 2026 14:46
Comment thread libs/cardano-ledger-core/cddl/Cardano/Ledger/Huddle/Gen.hs Outdated
Comment thread eras/alonzo/impl/cddl/lib/Cardano/Ledger/Alonzo/HuddleSpec.hs
Comment thread eras/dijkstra/impl/cddl/lib/Cardano/Ledger/Dijkstra/HuddleSpec.hs
@Soupstraw Soupstraw force-pushed the jj/constr-fix branch 2 times, most recently from bd0e8a1 to d7b4f58 Compare May 25, 2026 09:20
Comment thread eras/conway/impl/cddl/lib/Cardano/Ledger/Conway/HuddleSpec.hs
Comment on lines +738 to +740
forall name a.
(KnownSymbol name, IsType0 a) => Proxy name -> Int -> (Term -> Term -> Bool) -> a -> GRuleCall
mkMaybeTaggedSet pname n eq = binding $ \x ->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(As discussed on a call) Term has an Ord instance, so the natural questions comes to mind:

  • why do we need to pass custom eq function as an argument, which is always set to (==)?
  • Why do we use O(n^2) complexity function nubOrd, when we could just use the Ord and stick those in a Set?
Suggested change
forall name a.
(KnownSymbol name, IsType0 a) => Proxy name -> Int -> (Term -> Term -> Bool) -> a -> GRuleCall
mkMaybeTaggedSet pname n eq = binding $ \x ->
forall name a.
(KnownSymbol name, IsType0 a) => Proxy name -> Int -> a -> GRuleCall
mkMaybeTaggedSet pname n = binding $ \x ->

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.

3 participants