question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while compiling lambda.k

See original GitHub issue

When using kompile, it fails to compile the lambda.k(a very simple example).

cat lambda.k

[root@localhost hello]# cat lambda.k 
// Copyright (c) 2012-2016 K Team. All Rights Reserved.
module LAMBDA-SYNTAX
  syntax Val ::= Id
               | "lambda" Id "." Exp
  syntax Exp ::= Val
               | Exp Exp      [left]
               | "(" Exp ")"  [bracket]
endmodule

(1) kompile --no-prelude lambda.k. Output:

[root@localhost hello]# kompile --no-prelude lambda.k 
[Error] Compiler: Could not find sorts: [Id]
	Source(/root/src/c-semantics/hello/./lambda.k)
	Location(4,18,4,19)

(2) kompile lambda.k. Output:

[root@localhost hello]# kompile lambda.k
[Error] Compiler: Could not find main module with name LAMBDA in definition.
Use --main-module to specify one.

I don’t know what the reason is. Who has the latest K manual? Thank you.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
dwightguthcommented, Jan 2, 2019

Long story short we have reintegrated the two parts of K again and it should work with the version of K you are using, but K has changed to no longer implicitly import any modules, so you need to add imports ID to your definition of lambda calculus. Alternately, you can just use the versions of the tutorial found in the repository itself, which should be maintained and up to date.

0reactions
suhabecommented, Jan 2, 2019

If you want to use the tutorial, we recommend using the version of K developed by UIUC.

Where can I find the version of K developed by UIUC? I want to go through the tutorial.

I tired the latest version from this repo, but couldn’t get past the error:

$ kompile --version
RV-K version 1.0-SNAPSHOT
Git revision: 6bc147f
Git branch: master
Build date: Tue Jan 01 11:57:44 PST 2019
$ kompile lambda.k 
[Error] Compiler: Could not find sorts: [Id]
	Source(lambda.k)
	Location(3,18,3,36)
$ cat lambda.k 
module LAMBDA
  syntax Val ::= Id
               | "lambda" Id "." Exp
  syntax Exp ::= Val
               | Exp Exp      [left]
               | "(" Exp ")"  [bracket]
endmodule
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while compiling lambda.k · Issue #22 - GitHub
When using kompile, it fails to compile the lambda.k(a very simple example). ... (2) kompile lambda.k. Output: [root@localhost hello]# kompile ...
Read more >
Compile error when using lambda functions in the header file
I've seen a (weird) compile error in my code when trying to learn and use lambda functions. I've spent some time debugging it...
Read more >
k-user - Re: [[K-user] ] Error while compiling lambda.k//still fail - arc
Subject: Re: [[K-user] ] Error while compiling lambda.k > You defined the lambda-syntax module but not the lambda module. > > On Jul...
Read more >
Compilation failure lambda expressions are not supported
SYMPTOM. When adding a lambda expression in a java code maven throws the following error: [ERROR] Failed to execute goal org.apache. · CAUSE....
Read more >
Troubleshoot execution issues in Lambda - AWS Documentation
Function execution errors can be caused by issues with your code, function configuration, downstream resources, or permissions. If you invoke your function ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found