frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: A small reasoning engine that learns rewrite rules from two examples

3•heavymemory•51m ago
I have been experimenting with structural reasoning and built a small engine that learns rewrite rules from only two examples. You provide a pair of before and after expressions and it works out the transformation and applies it to new inputs. There is no LLM, no regex and no hard coded logic.

The demo includes:

TEACH (learn a rule from two examples)

COMPOSE (several learned rules used together) TRANSFER (a rule learned in algebra also works in logic and sets)

SIMPLIFY (multi step deterministic rewriting with a visible trace)

CODEMOD (teaching a codemod from two examples)

It runs on a CPU and produces a reasoning trace for every step. I would be interested to know what people think or where it breaks.

Demo: https://re.heavyweather.io

Comments

RossBencina•36m ago
Interesting. Are there more examples somewhere? I'm curious about cases where multiple examples are required. The associativity "example" corresponds directly to the rewrite rule definition, so it doesn't really illuminate the distinction between specifying a rewrite rule and inferring a rule from multiple examples.
heavymemory•24m ago
Right, associativity is the simplest case because the structure is visible directly in one example.

The system needs multiple examples when there is more than one varying part and a single example is ambiguous. A simple example is wrapping a function call. With:

    doThing(x) → log(doThing(x))
    process(y) → log(process(y))
the system learns that: the function name varies the argument varies he outer log(…) is constant

From that it infers the general rule and applies it to new inputs. A single example would not be enough to disambiguate that pattern.

James Cameron on AI in Hollywood

https://www.readtrung.com/p/james-cameron-on-ai-in-hollywood
1•sarego•1m ago•0 comments

Show HN: A New Language Compiler: Quark

https://github.com/quark-programming/quark
1•ephf•6m ago•0 comments

President Donald J. Trump Awarded "FIFA Peace Prize – Football Unites the World"

https://inside.fifa.com/campaigns/football-unites-the-world/news/president-trump-peace-prize-foot...
1•treetalker•7m ago•1 comments

How Kit Kat Was Killed: Video Shows What a Robot Taxi Couldn’t See

https://www.nytimes.com/2025/12/05/us/waymo-kit-kat-san-francisco.html
1•rl3•20m ago•0 comments

Quick Reminder: ADHD-Friendly

https://apps.apple.com/us/app/quick-reminder-adhd-friendly/id6756063126?mt=12
2•mraduldeodhiya•20m ago•1 comments

'We've been eating stink bugs for over 100 years'

https://www.theguardian.com/environment/2025/nov/21/turning-stink-bug-infestations-into-lunch-ind...
2•bookofjoe•23m ago•0 comments

Linux kernel source tree – with OpenPaX patch (rebased onto Linux-6.18.y)

https://github.com/quinndiggity/linux-openpax
1•openpax•26m ago•0 comments

Nook Browser

https://browsewithnook.com
3•ray__•30m ago•0 comments

Understanding Hytale Player Count: How to Find Active Servers

https://hytaletop100.com/blog/understanding-hytale-player-count-how-to-find-active-servers
1•doobie12•38m ago•0 comments

Visual Neuroscience: How Do Moths See to Fly at Night?

https://www.sciencedirect.com/science/article/pii/S0960982216000701#
2•andsoitis•41m ago•0 comments

Albert Michelson's Harmonic Analyzer (2014) [pdf]

https://engineerguy.com/fourier/pdfs/albert-michelsons-harmonic-analyzer.pdf
6•o4c•41m ago•2 comments

PalmOS on FisherPrice Pixter Toy

https://dmitry.gr/?r=05.Projects&proj=27.%20rePalm#pixter
2•dmitrygr•45m ago•1 comments

Have I Been Flocked? – Check If Your License Plate Is Being Watched

https://haveibeenflocked.com/
7•pkaeding•46m ago•0 comments

Show HN: Flexy – We Built a Faster Way to Get Small Dev Tasks Done

https://www.flexytasks.dev/
1•plakhlani2•47m ago•1 comments

Angel

https://en.wikipedia.org/wiki/Angel
1•marysminefnuf•47m ago•0 comments

Show HN: A small reasoning engine that learns rewrite rules from two examples

3•heavymemory•51m ago•2 comments

Jolla Launches Community-Funded Linux Phone

https://linuxiac.com/jolla-launches-community-funded-linux-phone/
5•embedding-shape•1h ago•1 comments

Building PagerDuty's SRE Agent

https://www.pagerduty.com/eng/context-over-cleverness-building-pagerdutys-sre-agent/
1•dadbod80•1h ago•0 comments

Nice overview of ESP32 devkits and ecosystems [video]

https://www.youtube.com/watch?v=sM34IYTIPyQ
3•NoxiousPluK•1h ago•3 comments

Supreme Court Agrees to Review Trump Order Restricting Birthright Citizenship

https://www.nytimes.com/2025/12/05/us/politics/supreme-court-trump-birthright-citizenship.html
4•treetalker•1h ago•2 comments

Show HN: Radioactive Pooping Knights

https://minichessgames.com/#/play/pooping-knights
3•patrickdavey•1h ago•1 comments

Mock Roles, not Objects (2004) [pdf]

https://jmock.org/oopsla2004.pdf
1•n3t•1h ago•0 comments

I cracked a $200 software protection with xcopy

https://www.ud2.rip/blog/enigma-protector/
24•vmfunc•1h ago•9 comments

New Study Investigates How Diet May Slow Normal Brain Aging

https://www.bumc.bu.edu/camed/news-events/articles/2025/new-study-investigates-how-diet-may-slow-...
2•gslin•1h ago•0 comments

EU hits X with €120M fine for breaching the Digital Services Act

https://www.dw.com/en/eu-imposes-120-million-fine-on-elon-musks-x-for-breaking-digital-rules/a-75...
27•vincvinc•1h ago•9 comments

Windows Telemetry

https://sizeof.cat/post/windows-telemetry/
3•DustinEchoes•1h ago•0 comments

India backs off from requiring government-made security app

https://www.scworld.com/news/india-backs-off-from-requiring-government-made-security-app
2•Bender•1h ago•1 comments

Sandvik gets €500M from European Investment Bank for new, smart EVs

https://electrek.co/2025/12/05/sandvik-gets-e500m-from-european-investment-bank-for-new-smart-evs/
1•Bender•1h ago•0 comments

Ultrablack wool textiles inspired by hierarchical avian structure

https://www.nature.com/articles/s41467-025-65649-4
4•defrost•1h ago•2 comments

State of decay in self-hosted commenting (code review)

https://bykozy.me/blog/state-of-decay-in-self-hosted-commenting/
1•byko3y•1h ago•0 comments