Prep to switch from Def to CExp for backend passes.

This commit is contained in:
2025-03-15 15:46:56 -07:00
parent 5c7d065a88
commit 5ab2a28bcf
13 changed files with 650 additions and 338 deletions

51
tests/Neighbors.newt Normal file
View File

@@ -0,0 +1,51 @@
-- https://www.youtube.com/watch?v=pNBPCnZEdSs
module Neighbors
-- Prf ?
import Prelude
data Void : U where
data Prf : U U where
Pf : a. {{_ : a}} Prf a
tryThis : A B. Prf A Prf B Prf A
-- this needs help in newt
tryThis (Pf {{x}}) b = Pf {_} {{x}}
P : U
data Bnd : U where
bot : Bnd
val : P Bnd
top : Bnd
Rel : U U
Rel a = a × a U
L : P × P U
-- FIXME Rel Bnd needs to be expanded
-- LH LB : Rel Bnd → U
LH LB : Bnd × Bnd U
LH (bot, _) = Unit
LH (val x, val y) = L (x, y)
LH _ = Void
LB xy = Prf (LH xy)
data Set : U where
SR SP : Set -- recursive / param
S0 S1 : Set -- empty, unit
_:+_ _:*_ : (S T : Set) Set
infixl 5 _:+_ _:*_
SetF : Set U U
SetF sr r = r
SetF sr p = p
SetF (s :+ t) r = SetF s r + SetF t r
SetF (s :* t) r = SetF s r * SetF t r
infixl 5 <_>
data MuSet : Set U where
<_> : t. SetF t (MuSet t) MuSet t
-- 9:30