Another example, testing rule priorities a bit

This commit is contained in:
Chris Fallin
2021-09-04 20:37:47 -07:00
parent bc91a4e5f6
commit b8e916a0ab
2 changed files with 29 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
(type u32 (primitive u32))
(type A (enum
(A1 (x B) (y B))))
(type B (enum
(B1 (x u32))))
(decl A2B (A) B)
(rule 1
(A2B (A.A1 _ (B.B1 x)))
(B.B1 x))
(rule 1
(A2B (A.A1 (B.B1 x) _))
(B.B1 x))
(rule -1
(A2B (A.A1 _ _))
(B.B1 42))