@@ -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` }
@@ -518,8 +517,7 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
518
517
const startMs = Date . now ( )
519
518
// Force disable output if `--out-itf` is set
520
519
const verbosityLevel = prev . args . outItf ? 0 : deriveVerbosity ( prev . args )
521
- const guessedMainModule = guessMainModule ( prev )
522
- const mainName = prev . args . main || guessedMainModule
520
+ const mainName = guessMainModule ( prev )
523
521
const main = prev . modules . find ( m => m . name === mainName )
524
522
if ( ! main ) {
525
523
const error : QuintError = { code : 'QNT405' , message : `Main module ${ mainName } not found` }
@@ -541,18 +539,18 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
541
539
invariantsList = invariantsList . concat ( prev . args . invariants )
542
540
}
543
541
// If no invariants specified, use the default 'true'
544
- const invariant = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
542
+ const invariantString = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
545
543
// Keep track of individual invariants for reporting
546
544
const individualInvariants = invariantsList . length > 0 ? invariantsList : [ 'true' ]
547
545
548
546
// We use:
549
- // - 'invariant ' as the combined invariant string for the simulator to check
547
+ // - 'invariantString ' as the combined invariant string for the simulator to check
550
548
// - 'individualInvariants' for reporting which specific invariants were violated
551
549
552
550
const options : SimulatorOptions = {
553
551
init : prev . args . init ,
554
552
step : prev . args . step ,
555
- invariant : invariant ,
553
+ invariant : invariantString ,
556
554
individualInvariants : individualInvariants ,
557
555
maxSamples : prev . args . maxSamples ,
558
556
maxSteps : prev . args . maxSteps ,
@@ -594,7 +592,7 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
594
592
}
595
593
596
594
const argsParsingResult = mergeInMany (
597
- [ prev . args . init , prev . args . step , invariant , ...prev . args . witnesses ] . map ( toExpr )
595
+ [ prev . args . init , prev . args . step , invariantString , ...prev . args . witnesses ] . map ( toExpr )
598
596
)
599
597
if ( argsParsingResult . isLeft ( ) ) {
600
598
return cliErr ( 'Argument error' , {
@@ -614,7 +612,7 @@ export async function runSimulator(prev: TypecheckedStage): Promise<CLIProcedure
614
612
}
615
613
616
614
// Parse the combined invariant for the Rust backend
617
- const invariantExpr = toExpr ( invariant )
615
+ const invariantExpr = toExpr ( invariantString )
618
616
if ( invariantExpr . isLeft ( ) ) {
619
617
return cliErr ( 'Argument error' , {
620
618
...simulator ,
@@ -779,10 +777,10 @@ export async function compile(typechecked: TypecheckedStage): Promise<CLIProcedu
779
777
invariantsList = invariantsList . concat ( args . invariants )
780
778
}
781
779
// If no invariants specified, use the default 'true'
782
- const invariant = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
780
+ const invariantString = invariantsList . length > 0 ? invariantsList . join ( ' and ' ) : 'true'
783
781
784
782
const extraDefsAsText = [ `action q::init = ${ args . init } ` , `action q::step = ${ args . step } ` ]
785
- extraDefsAsText . push ( `val q::inv = and(${ invariant } )` )
783
+ extraDefsAsText . push ( `val q::inv = and(${ invariantString } )` )
786
784
787
785
if ( args . temporal ) {
788
786
extraDefsAsText . push ( `temporal q::temporalProps = and(${ args . temporal } )` )
0 commit comments