-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1749 from informalsystems/th/typecheck-exitcode
Introduce dedicated exit codes
- Loading branch information
Showing
24 changed files
with
202 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
mod-infra/src/main/scala/at/forsyte/apalache/infra/ExitCodes.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package at.forsyte.apalache.infra | ||
|
||
import tlc2.output.EC | ||
|
||
/** | ||
* Exit codes that are reported by `Tool`. | ||
* | ||
* We maintain compatibility with TLC on a small subset of its exit codes, believing that exit codes should not replace | ||
* richer error explanations. | ||
* | ||
* TLC currently specifies exit codes | ||
* - 0 for success, | ||
* - 10–14 for (various kinds of) property violations, | ||
* - 75–77 for "failures" (e.g., properties that are tautologies, or primed variables in invariants), and | ||
* - 150–153 and 255 for syntax errors and system-level errors, respectively. | ||
* | ||
* Apalache uses exit codes | ||
* - 0 for success, | ||
* - 12 for all kinds of property violations, | ||
* - 75 for semantic failures to evaluate a specification, | ||
* - 120 for type-checking errors, | ||
* - 150 for syntactic errors, and | ||
* - 255 for general system-level errors. | ||
* | ||
* @author | ||
* Igor Konnov, Thomas Pani | ||
*/ | ||
object ExitCodes { | ||
type TExitCode = Int | ||
|
||
/** | ||
* No error in the specification. | ||
*/ | ||
val OK: TExitCode = EC.ExitStatus.SUCCESS // = 0 | ||
|
||
/** | ||
* The model checker has found a counterexample. We do not distinguish between different kinds of counterexamples and | ||
* always report VIOLATION_SAFETY. | ||
*/ | ||
val ERROR_COUNTEREXAMPLE: TExitCode = EC.ExitStatus.VIOLATION_SAFETY // = 12 | ||
|
||
/** | ||
* Semantic failure to evaluate a specification, e.g. due to unsupported language constructs and operators, or those | ||
* that introduce infinite structures. | ||
*/ | ||
val FAILURE_SPEC_EVAL: TExitCode = EC.ExitStatus.FAILURE_SPEC_EVAL // = 75 | ||
|
||
/** | ||
* Type-checking error. | ||
*/ | ||
val ERROR_TYPECHECK: TExitCode = 120 | ||
|
||
/** | ||
* Syntactic error when parsing the spec. | ||
*/ | ||
val ERROR_SPEC_PARSE: TExitCode = EC.ExitStatus.ERROR_SPEC_PARSE // = 150 | ||
|
||
/** | ||
* All other kinds of errors, e.g., runtime errors. | ||
*/ | ||
val ERROR: TExitCode = EC.ExitStatus.ERROR // 255 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
mod-tool/src/main/scala/at/forsyte/apalache/tla/tooling/ExitCodes.scala
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.