Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. module FRIST-SYNTAX
  2.  
  3. imports BOOL
  4.  
  5. syntax Expr ::= Expr "+" Expr [left, strict]
  6. | "(" Expr ")" [bracket]
  7. | Ident
  8.  
  9. syntax Ident ::= "x" | "y" | "z"
  10.  
  11. endmodule
  12.  
  13. module FRIST
  14.  
  15. imports FRIST-SYNTAX
  16.  
  17. rule X + Y => Y + X [anywhere]
  18.  
  19. rule X + (Y + Z) => (X + Y) + Z [anywhere]
  20.  
  21. rule (X + Y) + Z => X + (Y + Z) [anywhere]
  22.  
  23. endmodule
  24.  
  25.  
  26.  
  27. # kompile frist.k
  28. [WARNING] Running as root is not recommended
  29. File "realdef.ml", line 629, characters 289-296:
  30. Error: This variant expression is expected to have type bool
  31. The constructor KApply1 does not belong to type bool
  32. [Error] Critical: ocamlopt returned nonzero exit code: 2
  33. Examine output to see errors.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement