Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eric-corumdigital/436408b23a7d2de92bfb59602423cd75 to your computer and use it in GitHub Desktop.
Save eric-corumdigital/436408b23a7d2de92bfb59602423cd75 to your computer and use it in GitHub Desktop.
module FRIST-SYNTAX
imports BOOL
syntax Expr ::= Expr "+" Expr [left, strict]
| "(" Expr ")" [bracket]
| Ident
syntax Ident ::= "x" | "y" | "z"
endmodule
module FRIST
imports FRIST-SYNTAX
rule X + Y => Y + X [anywhere]
rule X + (Y + Z) => (X + Y) + Z [anywhere]
rule (X + Y) + Z => X + (Y + Z) [anywhere]
endmodule
# kompile frist.k
[WARNING] Running as root is not recommended
File "realdef.ml", line 629, characters 289-296:
Error: This variant expression is expected to have type bool
The constructor KApply1 does not belong to type bool
[Error] Critical: ocamlopt returned nonzero exit code: 2
Examine output to see errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment