Elektrine
Log in Register
Paige Chat Timeline Gallery Friends Email Drive DNS Private DNS Domains VPN Kairo Nerve
Remote

Daniël Otten

@DDOtten@mathstodon.xyz
mastodon 4.7.2
  • Open on mathstodon.xyz
48 Followers
75 Following
2 Posts
Joined April 24, 2026
Website:
https://www.otten.co/
Open post
Daniël Otten @DDOtten@mathstodon.xyz
· 5mo ago
Replying to
@zyang That makes a lot of sense and further explains the motivation for the steps in nf7 for me. Thank you for your quick reply!
1
0
0
0
Open post
Daniël Otten @DDOtten@mathstodon.xyz
· 5mo ago
Replying to

@zyang (cc, @AndrasKovacs) Thank you for the interesting blog post! It really helped me to understand the optimizations that NbE applies.

After reading the original blog post I also tried thinking about ways to simplify nf7 and I worked out one alternative (https://github.com/DDOtten/NbE-cached/blob/main/NbE.hs)

I implemented a further variation (nf8 at the end of the file) that avoids the need for the forceShifts function. This change is based on storing the number of shifts at the root of the cached normal forms: instead of storing a ~TmS with lazy weakenings we store a ~Tm and the number of shifts that need to be applied to the normal form for this specific occurrence.

I hope the computational complexity of nf8 is the same as nf7, since both have to traverse every cached normal form once per occurrence to apply the needed shifts (which depend on the number of additional binders encountered before substituting this occurrence), but I have not worked this out in detail yet.

I did compare the output and performance of (both the original and newly updated) nf7 and nf8 on the original adversarial example and two new large adversarial examples, and they match, with nf8 being slightly faster on my computer. However, a more detailed analysis of computational behavior is needed, so please let me know if I made any mistakes!

GitHub

NbE-cached/NbE.hs at main · DDOtten/NbE-cached

This is an iteration on a blogpost by Zhixuan Yang (https://yangzhixuan.github.io/NbE.html) discussing an efficient implementation of normalisation by evaluation (NbE) for untyped lambda calculus. ...

0
2
0
0
Back
313k7r1n3
Elektrine

Tor hidden service

elekhj7afj4qnrr4yd3bkzslsyo5jgfxw3orgjkhlcxifueodybyiiad.onion

I2P eepsite

j6b6cyk6gjmepjih7jjadxgxvvf3lzzujljuu2v4biemzpg3naya.b32.i2p

Platform

  • Email
  • Chat
  • Timeline
  • VPN
  • DNS

Company

  • About
  • Contact
  • FAQ
  • Lite (no JS)

Legal

  • Terms of Service
  • Privacy Policy
  • Transparency Report
  • Report Abuse
  • Warrant Canary
  • VPN Policy

Support

  • support@elektrine.com
  • Report Security Issue
Mail client setup IMAP mail.elektrine.com:993 POP3 mail.elektrine.com:995 SMTP mail.elektrine.com:465
© 2026 Elektrine. All rights reserved. Server: 23:03:03 UTC