File tree 12 files changed +33
-33
lines changed
kani-compiler/src/codegen_cprover_gotoc/codegen 12 files changed +33
-33
lines changed Original file line number Diff line number Diff line change @@ -469,7 +469,7 @@ impl<'tcx> GotocCtx<'tcx> {
469
469
let invalid_arg_err = |attr : & Attribute | {
470
470
self . tcx . sess . span_err (
471
471
attr. span ,
472
- format ! ( "invalid argument for `{ATTRIBUTE}` attribute, expected one of the supported solvers (e.g. `kissat`) or a SAT solver binary (e.g. `custom =\" <SAT_SOLVER_BINARY>\" `)" )
472
+ format ! ( "invalid argument for `{ATTRIBUTE}` attribute, expected one of the supported solvers (e.g. `kissat`) or a SAT solver binary (e.g. `bin =\" <SAT_SOLVER_BINARY>\" `)" )
473
473
)
474
474
} ;
475
475
@@ -504,8 +504,8 @@ impl<'tcx> GotocCtx<'tcx> {
504
504
}
505
505
}
506
506
}
507
- MetaItemKind :: NameValue ( lit) if ident_str == "custom " && lit. kind . is_str ( ) => {
508
- Some ( CbmcSolver :: Custom ( lit. token_lit . symbol . to_string ( ) ) )
507
+ MetaItemKind :: NameValue ( lit) if ident_str == "bin " && lit. kind . is_str ( ) => {
508
+ Some ( CbmcSolver :: Binary ( lit. token_lit . symbol . to_string ( ) ) )
509
509
}
510
510
_ => {
511
511
invalid_arg_err ( attr) ;
Original file line number Diff line number Diff line change @@ -579,18 +579,18 @@ impl TypedValueParser for CbmcSolverValueParser {
579
579
value : & std:: ffi:: OsStr ,
580
580
) -> Result < Self :: Value , clap:: error:: Error > {
581
581
let value = value. to_str ( ) . unwrap ( ) ;
582
- // `value` is one of the possible `CbmcSolver` values or `custom =<binary>`
582
+ // `value` is one of the possible `CbmcSolver` values or `bin =<binary>`
583
583
let segments: Vec < & str > = value. split ( '=' ) . collect ( ) ;
584
584
585
585
let mut err = clap:: Error :: new ( ErrorKind :: InvalidValue ) . with_cmd ( cmd) ;
586
586
err. insert ( ContextKind :: InvalidArg , ContextValue :: String ( arg. unwrap ( ) . to_string ( ) ) ) ;
587
587
err. insert ( ContextKind :: InvalidValue , ContextValue :: String ( value. to_string ( ) ) ) ;
588
588
589
589
if segments. len ( ) == 2 {
590
- if segments[ 0 ] != "custom " {
590
+ if segments[ 0 ] != "bin " {
591
591
return Err ( err) ;
592
592
}
593
- return Ok ( CbmcSolver :: Custom ( segments[ 1 ] . into ( ) ) ) ;
593
+ return Ok ( CbmcSolver :: Binary ( segments[ 1 ] . into ( ) ) ) ;
594
594
} else if segments. len ( ) == 1 {
595
595
let solver = CbmcSolver :: from_str ( value) ;
596
596
return solver. map_err ( |_| err) ;
Original file line number Diff line number Diff line change @@ -213,13 +213,13 @@ impl KaniSession {
213
213
// Minisat is currently CBMC's default solver, so no need to
214
214
// pass any arguments
215
215
}
216
- CbmcSolver :: Custom ( custom_solver ) => {
216
+ CbmcSolver :: Binary ( solver_binary ) => {
217
217
// Check if the specified binary exists in path
218
- if which:: which ( custom_solver ) . is_err ( ) {
219
- bail ! ( "the specified solver \" {custom_solver }\" was not found in path" )
218
+ if which:: which ( solver_binary ) . is_err ( ) {
219
+ bail ! ( "the specified solver \" {solver_binary }\" was not found in path" )
220
220
}
221
221
args. push ( "--external-sat-solver" . into ( ) ) ;
222
- args. push ( custom_solver . into ( ) ) ;
222
+ args. push ( solver_binary . into ( ) ) ;
223
223
}
224
224
}
225
225
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
5
5
use strum_macros:: { AsRefStr , EnumString , EnumVariantNames } ;
6
6
7
7
/// An enum for CBMC solver options. All variants are handled by Kani, except for
8
- /// the `Custom ` one, which it passes as is to CBMC's `--external-sat-solver`
8
+ /// the `Binary ` one, which it passes as is to CBMC's `--external-sat-solver`
9
9
/// option.
10
10
#[ derive(
11
11
Debug ,
@@ -26,8 +26,8 @@ pub enum CbmcSolver {
26
26
/// MiniSAT (CBMC's default solver)
27
27
Minisat ,
28
28
29
- /// A custom solver variant whose argument gets passed to
29
+ /// A solver binary variant whose argument gets passed to
30
30
/// `--external-sat-solver`. The specified binary must exist in path.
31
- #[ strum( disabled, serialize = "custom =<SAT_SOLVER_BINARY>" ) ]
32
- Custom ( String ) ,
31
+ #[ strum( disabled, serialize = "bin =<SAT_SOLVER_BINARY>" ) ]
32
+ Binary ( String ) ,
33
33
}
Original file line number Diff line number Diff line change 1
- error: invalid argument for `#[kani::solver]` attribute, expected one of the supported solvers (e.g. `kissat`) or a SAT solver binary (e.g. `custom ="<SAT_SOLVER_BINARY>"`)\
1
+ error: invalid argument for `#[kani::solver]` attribute, expected one of the supported solvers (e.g. `kissat`) or a SAT solver binary (e.g. `bin ="<SAT_SOLVER_BINARY>"`)\
2
2
test.rs:\
3
- |\
4
- 5 | #[kani::solver(123)]\
5
- | ^^^^^^^^^^^^^^^^^^^^
3
+ |\
4
+ | #[kani::solver(123)]\
5
+ | ^^^^^^^^^^^^^^^^^^^^
6
6
error: aborting due to previous error
Original file line number Diff line number Diff line change 1
1
error: the `#[kani::solver]` attribute expects a single argument. Got 2 arguments.\
2
2
test.rs:\
3
- |\
4
- 5 | #[kani::solver(kissat, minisat)]\
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3
+ |\
4
+ | #[kani::solver(kissat, minisat)]\
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
error: aborting due to previous error
Original file line number Diff line number Diff line change 1
1
error: only one '#[kani::solver]' attribute is allowed per harness\
2
2
test.rs:\
3
- |\
4
- 5 | #[kani::solver(kissat)]\
5
- | ^^^^^^^^^^^^^^^^^^^^^^^
3
+ |\
4
+ | #[kani::solver(kissat)]\
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^
6
6
error: aborting due to previous error
Original file line number Diff line number Diff line change 1
1
error: the `#[kani::solver]` attribute expects a single argument. Got 0 arguments.\
2
2
test.rs:\
3
- |\
4
- 5 | #[kani::solver]\
5
- | ^^^^^^^^^^^^^^^
3
+ |\
4
+ | #[kani::solver]\
5
+ | ^^^^^^^^^^^^^^^
6
6
error: aborting due to previous error
Original file line number Diff line number Diff line change 4
4
//! Checks that Kani errors out if specified solver binary is not found
5
5
6
6
#[ kani:: proof]
7
- #[ kani:: solver( custom = "non_existing_solver" ) ]
7
+ #[ kani:: solver( bin = "non_existing_solver" ) ]
8
8
fn check ( ) { }
Original file line number Diff line number Diff line change 1
1
error: unknown solver `foo`\
2
2
test.rs:\
3
- |\
4
- 5 | #[kani::solver(foo)]\
5
- | ^^^^^^^^^^^^^^^^^^^^
3
+ |\
4
+ | #[kani::solver(foo)]\
5
+ | ^^^^^^^^^^^^^^^^^^^^
6
6
error: aborting due to previous error
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
// Copyright Kani Contributors
2
2
// SPDX-License-Identifier: Apache-2.0 OR MIT
3
- // kani-flags: --solver custom =kissat
3
+ // kani-flags: --solver bin =kissat
4
4
5
- //! Checks that `--solver` accepts `custom =<binary>`
5
+ //! Checks that `--solver` accepts `bin =<binary>`
6
6
7
7
#[ kani:: proof]
8
8
fn check_solver_option ( ) {
You can’t perform that action at this time.
0 commit comments