Skip to content

Commit ec3026d

Browse files
authored
refactor: rename exe_trace to concrete_playback and det_vals to concrete_vals (rust-lang#1548)
* rename a bunch of stuff * rename JustPrint to Print
1 parent ab0f2ad commit ec3026d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+348
-331
lines changed

kani-driver/src/args.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,17 @@ pub struct KaniArgs {
4343
/// Generate visualizer report to <target-dir>/report/html/index.html
4444
#[structopt(long)]
4545
pub visualize: bool,
46-
/// Generate executable trace test case and print it to stdout.
46+
/// Generate concrete playback unit test and either 1) just print it to stdout or 2) add it in-place to the source code.
4747
/// This option does not work with `--output-format old`.
4848
#[structopt(
4949
long,
5050
requires("enable-unstable"),
5151
requires("harness"),
5252
conflicts_with_all(&["visualize", "dry-run"]),
53+
possible_values = &ConcretePlaybackMode::variants(),
54+
case_insensitive = true,
5355
)]
54-
pub gen_exe_trace: bool,
55-
/// Additionally add executable trace test case to the source code
56-
#[structopt(long, requires("gen-exe-trace"))]
57-
pub add_exe_trace_to_src: bool,
56+
pub concrete_playback: Option<ConcretePlaybackMode>,
5857
/// Keep temporary files generated throughout Kani process
5958
#[structopt(long, hidden_short_help(true))]
6059
pub keep_temps: bool,
@@ -206,6 +205,14 @@ impl KaniArgs {
206205
}
207206
}
208207

208+
arg_enum! {
209+
#[derive(Debug, PartialEq, Eq)]
210+
pub enum ConcretePlaybackMode {
211+
Print,
212+
InPlace,
213+
}
214+
}
215+
209216
arg_enum! {
210217
#[derive(Debug, PartialEq, Eq)]
211218
pub enum OutputFormat {

kani-driver/src/call_cbmc.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl KaniSession {
5252
// The introduction of reachability checks forces us to decide
5353
// the verification result based on the postprocessing of CBMC results.
5454
let output_filename_opt: Option<&Path> =
55-
if self.args.gen_exe_trace { Some(&output_filename) } else { None };
55+
self.args.concrete_playback.as_ref().map(|_| output_filename.as_path());
5656
let processed_result = process_cbmc_output(
5757
cbmc_process,
5858
self.args.extra_pointer_checks,
@@ -71,7 +71,7 @@ impl KaniSession {
7171
}
7272

7373
if let Ok(VerificationStatus::Failure) = verification_result {
74-
self.gen_and_add_exe_trace(&output_filename, harness);
74+
self.gen_and_add_concrete_playback(&output_filename, harness);
7575
}
7676

7777
verification_result
@@ -117,11 +117,14 @@ impl KaniSession {
117117
args.push("--validate-ssa-equation".into());
118118
}
119119

120-
if !self.args.visualize && !self.args.gen_exe_trace && !self.args.no_slice_formula {
120+
if !self.args.visualize
121+
&& self.args.concrete_playback.is_none()
122+
&& !self.args.no_slice_formula
123+
{
121124
args.push("--slice-formula".into());
122125
}
123126

124-
if self.args.gen_exe_trace {
127+
if self.args.concrete_playback.is_some() {
125128
args.push("--trace".into());
126129
}
127130

kani-driver/src/cbmc_output_parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ struct Parser<'a, 'b> {
354354
pub input_so_far: String,
355355
pub buffer: &'a mut BufReader<&'b mut ChildStdout>,
356356
/// Buffered writer over the CBMC output file.
357-
/// This is needed for old parsers (e.g., like the one in the executable trace code) that require the actual CBMC output file.
358-
/// TODO: This can be removed once we overhaul the executable trace parser.
357+
/// This is needed for old parsers (e.g., like the one in the concrete playback code) that require the actual CBMC output file.
358+
/// TODO: This can be removed once we overhaul the concrete playback parser.
359359
/// See this tracking issue: <https://github.com/model-checking/kani/issues/1477>.
360360
cbmc_out_buf_writer: Option<BufWriter<File>>,
361361
}

0 commit comments

Comments
 (0)