@@ -110,6 +110,8 @@ Note that quantifier variable domains (<- <Domain>) are available in both syntax
110110false - The char type represents any UTF-16 code unit.
111111true - The char type represents any Unicode scalar value." . TrimStart ( ) ) ;
112112
113+ public static readonly Option < string > SolverPath = new ( "--solver-path" ,
114+ "Can be used to specify a custom SMT solver to use for verifying Dafny proofs." ) ;
113115 public static readonly Option < bool > VerifyIncludedFiles = new ( "--verify-included-files" ,
114116 "Verify code in included files." ) ;
115117 public static readonly Option < bool > WarningAsErrors = new ( "--warn-as-errors" ,
@@ -123,50 +125,40 @@ Note that quantifier variable domains (<- <Domain>) are available in both syntax
123125 "Include the Dafny runtime as source in the target language." ) ;
124126
125127 static CommonOptionBag ( ) {
128+ DafnyOptions . RegisterLegacyBinding ( SolverPath , ( options , value ) => {
129+ if ( ! string . IsNullOrEmpty ( value ) ) {
130+ options . ProverOptions . Add ( $ "PROVER_PATH={ value } ") ;
131+ }
132+ } ) ;
133+
126134 DafnyOptions . RegisterLegacyBinding ( ManualLemmaInduction , ( options , value ) => {
127135 if ( value ) {
128136 options . Induction = 1 ;
129137 }
130138 } ) ;
131- DafnyOptions . RegisterLegacyBinding ( IncludeRuntime , ( options , value ) => {
132- options . UseRuntimeLib = ! value ;
133- } ) ;
134- DafnyOptions . RegisterLegacyBinding ( WarnShadowing , ( options , value ) => {
135- options . WarnShadowing = value ;
136- } ) ;
137- DafnyOptions . RegisterLegacyBinding ( WarnMissingConstructorParenthesis , ( options , value ) => {
138- options . DisallowConstructorCaseWithoutParentheses = value ;
139- } ) ;
140- DafnyOptions . RegisterLegacyBinding ( WarningAsErrors , ( options , value ) => {
141- options . WarningsAsErrors = value ;
142- } ) ;
143- DafnyOptions . RegisterLegacyBinding ( VerifyIncludedFiles , ( options , value ) => {
144- options . VerifyAllModules = value ;
145- } ) ;
139+ DafnyOptions . RegisterLegacyBinding ( IncludeRuntime , ( options , value ) => { options . UseRuntimeLib = ! value ; } ) ;
140+ DafnyOptions . RegisterLegacyBinding ( WarnShadowing , ( options , value ) => { options . WarnShadowing = value ; } ) ;
141+ DafnyOptions . RegisterLegacyBinding ( WarnMissingConstructorParenthesis ,
142+ ( options , value ) => { options . DisallowConstructorCaseWithoutParentheses = value ; } ) ;
143+ DafnyOptions . RegisterLegacyBinding ( WarningAsErrors , ( options , value ) => { options . WarningsAsErrors = value ; } ) ;
144+ DafnyOptions . RegisterLegacyBinding ( VerifyIncludedFiles ,
145+ ( options , value ) => { options . VerifyAllModules = value ; } ) ;
146146
147- DafnyOptions . RegisterLegacyBinding ( Target , ( options , value ) => {
148- options . CompilerName = value ;
149- } ) ;
147+ DafnyOptions . RegisterLegacyBinding ( Target , ( options , value ) => { options . CompilerName = value ; } ) ;
150148
151149
152- DafnyOptions . RegisterLegacyBinding ( QuantifierSyntax , ( options , value ) => {
153- options . QuantifierSyntax = value ;
154- } ) ;
150+ DafnyOptions . RegisterLegacyBinding ( QuantifierSyntax , ( options , value ) => { options . QuantifierSyntax = value ; } ) ;
155151
156- DafnyOptions . RegisterLegacyBinding ( Plugin , ( options , value ) => {
157- options . AdditionalPluginArguments = value ;
158- } ) ;
152+ DafnyOptions . RegisterLegacyBinding ( Plugin , ( options , value ) => { options . AdditionalPluginArguments = value ; } ) ;
159153
160154 DafnyOptions . RegisterLegacyBinding ( Prelude , ( options , value ) => {
161155 options . DafnyPrelude = value ;
162- options . ExpandFilename ( options . DafnyPrelude , x => options . DafnyPrelude = x , options . LogPrefix , options . FileTimestamp ) ;
163- } ) ;
164- DafnyOptions . RegisterLegacyBinding ( Libraries , ( options , value ) => {
165- options . LibraryFiles = value . ToHashSet ( ) ;
166- } ) ;
167- DafnyOptions . RegisterLegacyBinding ( Output , ( options , value ) => {
168- options . DafnyPrintCompiledFile = value ;
156+ options . ExpandFilename ( options . DafnyPrelude , x => options . DafnyPrelude = x , options . LogPrefix ,
157+ options . FileTimestamp ) ;
169158 } ) ;
159+ DafnyOptions . RegisterLegacyBinding ( Libraries ,
160+ ( options , value ) => { options . LibraryFiles = value . ToHashSet ( ) ; } ) ;
161+ DafnyOptions . RegisterLegacyBinding ( Output , ( options , value ) => { options . DafnyPrintCompiledFile = value ; } ) ;
170162
171163 DafnyOptions . RegisterLegacyBinding ( CompileVerbose , ( o , v ) => o . CompileVerbose = v ) ;
172164 DafnyOptions . RegisterLegacyBinding ( DisableNonLinearArithmetic , ( o , v ) => o . DisableNLarith = v ) ;
@@ -177,12 +169,13 @@ static CommonOptionBag() {
177169 RelaxDefiniteAssignment . AddValidator ( optionResult => {
178170 var enforceDeterminismResult = optionResult . FindResultFor ( EnforceDeterminism ) ;
179171 if ( enforceDeterminismResult is not null && enforceDeterminismResult . GetValueOrDefault < bool > ( ) ) {
180- optionResult . ErrorMessage = $ "The option { RelaxDefiniteAssignment . Name } can not be used in conjunction with { EnforceDeterminism . Name } .";
172+ optionResult . ErrorMessage =
173+ $ "The option { RelaxDefiniteAssignment . Name } can not be used in conjunction with { EnforceDeterminism . Name } .";
181174 }
182175 } ) ;
183- DafnyOptions . RegisterLegacyBinding ( RelaxDefiniteAssignment , ( options , value ) => {
184- options . DefiniteAssignmentLevel = value ? 1 : 2 ;
185- } ) ;
176+ DafnyOptions . RegisterLegacyBinding ( RelaxDefiniteAssignment ,
177+ ( options , value ) => { options . DefiniteAssignmentLevel = value ? 1 : 2 ; } ) ;
186178
187179 }
188180}
181+
0 commit comments