@@ -322,8 +322,7 @@ export async function runRepl(_argv: any) {
322
322
export async function runTests ( prev : TypecheckedStage ) : Promise < CLIProcedure < TestedStage > > {
323
323
const testing = { ...prev , stage : 'testing' as stage }
324
324
const verbosityLevel = deriveVerbosity ( prev . args )
325
- const guessedMainModule = guessMainModule ( prev )
326
- const mainName = prev . args . main || guessedMainModule
325
+ const mainName = guessMainModule ( prev )
327
326
const main = prev . modules . find ( m => m . name === mainName )
328
327
if ( ! main ) {
329
328
const error : QuintError = { code : 'QNT405' , message : `Main module ${ mainName } not found` }
@@ -521,8 +520,7 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
521
520
const startMs = Date . now ( )
522
521
// Force disable output if `--out-itf` is set
523
522
const verbosityLevel = prev . args . outItf ? 0 : deriveVerbosity ( prev . args )
524
- const guessedMainModule = guessMainModule ( prev )
525
- const mainName = prev . args . main || guessedMainModule
523
+ const mainName = guessMainModule ( prev )
526
524
const main = prev . modules . find ( m => m . name === mainName )
527
525
if ( ! main ) {
528
526
const error : QuintError = { code : 'QNT405' , message : `Main module ${ mainName } not found` }
@@ -544,18 +542,18 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
544
542
invariantsList = invariantsList . concat ( prev . args . invariants )
545
543
}
546
544
// If no invariants specified, use the default 'true'
547
- const invariant = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
545
+ const invariantString = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
548
546
// Keep track of individual invariants for reporting
549
547
const individualInvariants = invariantsList . length > 0 ? invariantsList : [ 'true' ]
550
548
551
549
// We use:
552
- // - 'invariant ' as the combined invariant string for the simulator to check
550
+ // - 'invariantString ' as the combined invariant string for the simulator to check
553
551
// - 'individualInvariants' for reporting which specific invariants were violated
554
552
555
553
const options : SimulatorOptions = {
556
554
init : prev . args . init ,
557
555
step : prev . args . step ,
558
- invariant : invariant ,
556
+ invariant : invariantString ,
559
557
individualInvariants : individualInvariants ,
560
558
maxSamples : prev . args . maxSamples ,
561
559
maxSteps : prev . args . maxSteps ,
@@ -597,7 +595,7 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
597
595
}
598
596
599
597
const argsParsingResult = mergeInMany (
600
- [ prev . args . init , prev . args . step , invariant , ...prev . args . witnesses ] . map ( toExpr )
598
+ [ prev . args . init , prev . args . step , invariantString , ...prev . args . witnesses ] . map ( toExpr )
601
599
)
602
600
if ( argsParsingResult . isLeft ( ) ) {
603
601
return cliErr ( 'Argument error' , {
@@ -617,7 +615,7 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
617
615
}
618
616
619
617
// Parse the combined invariant for the Rust backend
620
- const invariantExpr = toExpr ( invariant )
618
+ const invariantExpr = toExpr ( invariantString )
621
619
if ( invariantExpr . isLeft ( ) ) {
622
620
return cliErr ( 'Argument error' , {
623
621
...simulator ,
@@ -782,10 +780,10 @@ export async function compile(typechecked: TypecheckedStage): Promise<CLIProcedu
782
780
invariantsList = invariantsList . concat ( args . invariants )
783
781
}
784
782
// If no invariants specified, use the default 'true'
785
- const invariant = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
783
+ const invariantString = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
786
784
787
785
const extraDefsAsText = [ `action q::init = ${ args . init } ` , `action q::step = ${ args . step } ` ]
788
- extraDefsAsText . push ( `val q::inv = and(${ invariant } )` )
786
+ extraDefsAsText . push ( `val q::inv = and(${ invariantString } )` )
789
787
790
788
if ( args . temporal ) {
791
789
extraDefsAsText . push ( `temporal q::temporalProps = and(${ args . temporal } )` )
0 commit comments