-
-
Save Casteran/06343a071d0a874d9200d0fe79939870 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From elpi Require Import elpi. | |
Elpi Program parenthesis lp:{{ | |
kind paren type. | |
type a, b paren. | |
kind nat type. | |
type z nat. | |
type s nat -> nat. | |
pred fill o:list paren, o: nat. | |
fill nil z. | |
fill [a|L] P:- fill L (s P). | |
fill [b|L] (s P) :- fill L P. | |
}}. | |
Elpi Query lp:{{ | |
fill [a,X,a,Y] z, | |
fill [a,X1,X2,b] z, not( X1 = a). | |
}}. | |
Elpi Query lp:{{ fill [a,X,Y,Z,T,b] z, not( X = Y) }}. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment