I'm running into an error in code that, as far as I can tell, should work.
(define-cons thing 0)
(define-cons nil 0)
(define-cons cons 2)
(define-elim double 1)
(define-rule (nil double) nil)
(define-rule (cons double) (let head) double head cons head cons)
(define-net doubled-list
nil thing cons thing cons thing cons thing cons double)
I'm trying to write code to double the length of a list.
Is there some kind of linear typing at work here, where you can't use a let binding more than once in the rewritten graph? Or is this a compiler error?