-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// Copyright 2023 The Regents of the University of California | ||
// released under BSD 3-Clause License | ||
// author: Kevin Laeufer <[email protected]> | ||
mod sim; | ||
mod smt; | ||
mod state; | ||
|
||
pub use sim::Simulator; | ||
pub use smt::{ | ||
ModelCheckResult, SmtModelChecker, SmtModelCheckerOptions, SmtSolverCmd, BITWUZLA_CMD, | ||
}; | ||
pub use state::{State, Value, ValueRef, Witness}; | ||
pub use state::{Value, ValueRef, ValueStore, Witness}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2023 The Regents of the University of California | ||
// released under BSD 3-Clause License | ||
// author: Kevin Laeufer <[email protected]> | ||
|
||
use crate::ir::*; | ||
use crate::mc::ValueStore; | ||
|
||
/// Interpreter based simulator for a transition system. | ||
pub struct Simulator<'a> { | ||
ctx: &'a Context, | ||
sys: &'a TransitionSystem, | ||
state: ValueStore, | ||
} | ||
|
||
impl<'a> Simulator<'a> { | ||
pub fn new(ctx: &'a Context, sys: &'a TransitionSystem) -> Self { | ||
let types = sys.states().map(|s| s.symbol.get_type(ctx)); | ||
let state = ValueStore::new(types); | ||
Self { ctx, sys, state } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters