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/c4af06070a794396567681fad954aa87 to your computer and use it in GitHub Desktop.
Save eric-corumdigital/c4af06070a794396567681fad954aa87 to your computer and use it in GitHub Desktop.
module SIMPLE-SYNTAX
endmodule
module SIMPLE
imports BOOL
imports INT
syntax S ::= "mul(" S "," S ")"
| "i(" Int ")"
rule mul( X:Int , Y:Int ) => X *Int Y
endmodule
@eric-corumdigital
Copy link
Author

eric-corumdigital commented Oct 25, 2019

# kompile --backend haskell simple.k
[WARNING] Running as root is not recommended
[Error] Compiler: Had 1 parsing errors.
[Error] Inner Parser: Parse error: unexpected token ':Int'.
        Source(/mnt/c/Users/Bryan/Documents/kframework/frist/./simple.k)
        Location(13,14,13,18)

@ehildenb
Copy link

mul(_, _) takes two S, but you've given it two Int. Did you mean to subsort syntax S ::= Int?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment