Skip to content

first arg is missing in beta-normalization of Natural/build#1244

Merged
Gabriella439 merged 2 commits intodhall-lang:masterfrom
hagl:beta-normalization_NaturalBuild
Dec 10, 2021
Merged

first arg is missing in beta-normalization of Natural/build#1244
Gabriella439 merged 2 commits intodhall-lang:masterfrom
hagl:beta-normalization_NaturalBuild

Conversation

@hagl
Copy link
Copy Markdown
Contributor

@hagl hagl commented Dec 1, 2021

I think, I found a small bug in the specification of the beta-normalization.

The beta-normalization of Natural/build should apply g to Natural, succ and zero.
The first of these arguments is currently not provided. Compare with the dhall-haskell implementation: https://github.com/dhall-lang/dhall-haskell/blob/235f38c8048c9a9fee7379d77fc55d179e0d107e/dhall/src/Dhall/Normalize.hs#L220

Copy link
Copy Markdown
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

I was initially a bit skeptical, because the type argument seemed pointless on first sight. But the type quite clearly requires it, and the example in the Prelude helps illustrate it for me:

let example0 =
assert
: build
( λ(natural : Type)
λ(succ : natural natural)
λ(zero : natural)
succ (succ (succ zero))
)
3

Good catch! 👍

@Gabriella439
Copy link
Copy Markdown
Contributor

Yeah, this change is definitely correct. The only reason we didn't catch it is because the code in question is not being exercised (yet)

@Gabriella439 Gabriella439 merged commit e8db268 into dhall-lang:master Dec 10, 2021
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