Comments (4)
Thank you for the report! This should be an easy fix :)
from apalache.
@shonfeder in case you won't have time/will, I can take it, the fix is ralteively easy but looks a bit dirty for me
Index: tla-io/src/main/scala/at/forsyte/apalache/tla/imp/SanyImporter.scala
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/SanyImporter.scala b/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/SanyImporter.scala
--- a/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/SanyImporter.scala (revision e8c3b166309fe0c7200db26db3225b02fe252c74)
+++ b/tla-io/src/main/scala/at/forsyte/apalache/tla/imp/SanyImporter.scala (date 1705864071162)
@@ -114,7 +114,10 @@
ModuleTranslator(sourceStore, annotationStore).translate(node))
}
- (specObj.getName, modmap)
+ specObj.getName match {
+ case null => throw new SanyImporterException("No root module defined in file")
+ case name => (name, modmap)
+ }
}
/**
Output for empty file
23:12:07.880 [main] INFO at.forsyte.apalache.tla.tooling.opt.ParseCmd -- Loading configuration
# Usage statistics is OFF. We care about your privacy.
# If you want to help our project, consider enabling statistics with config --enable-stats=true.
Output directory: /Users/alexey/dev/private/tlaplus/apalache/_apalache-out/current.tla/2024-01-21T23-12-08_17552644758555314631
# APALACHE version: v0.44.2-42-g45bdbc6b8 | build: v0.44.2-42-g45bdbc6b8 I@23:12:08.393
Parse current.tla I@23:12:08.407
PASS #0: SanyParser I@23:12:08.666
Not running from fat JAR and APALACHE_HOME is not set; W@23:12:08.670
will not be able to find the Apalache standard library. W@23:12:08.670
Parsing file /Users/alexey/dev/private/tlaplus/apalache/current.tla
Parsing error: No root module defined in file E@23:12:08.799
Parser has failed I@23:12:08.844
It took me 0 days 0 hours 0 min 0 sec I@23:12:08.844
Total time: 0.449 sec I@23:12:08.844
EXITCODE: ERROR (255)
from apalache.
That looks right. I'd be very grateful if you picked this up! Thanks, @fan-tom. Let me know how I can help :)
from apalache.
That seems like a nice fix to me. Looking at https://github.com/tlaplus/tlaplus/blob/238ff3c95a1db3f92eb5daee8800520e0170fc6c/tlatools/org.lamport.tlatools/src/tla2sany/modanalyzer/SpecObj.java I dont see any methods that would obviously be less dirty :)
from apalache.
Related Issues (20)
- Unexpected exception HOT 2
- Document Apalache config format + options
- A set filter over PowSet[FinSet[Int]] is not implemented
- Wrong function sets counterexample? HOT 6
- Add warning for misplaced occurrence of `oneOf` when parsing from quint
- Raise error when an unexpanded type constant is found in quint IR output
- `parse` command adds superfluous `EXTENDS` statement HOT 2
- Use `parse` to format modules. HOT 2
- Crash with `funArrays` encoding HOT 2
- Typechecking crashes with `IllegalArgumentException: Unsupported expression` on unbounded quantification (e.g., `\A x: P`). HOT 8
- Operator overriding in annotations
- Include constant value assignments in ITF
- Allow specifying types in separate files
- Name clash leads to operator being incorrectly marked as recursive HOT 3
- Extend the server to be able to reply with formatted TLA+ generated from the IR HOT 1
- Pretty printing the apalache IR into TLA+ does not sanitize identifiers
- Assignments in quint `init` operators need to be unprimed HOT 2
- TLA+ pretty printer produces `[]` on empty tuples, which is invalid syntax
- Add support for Quint's `allListsUpTo`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apalache.