Skip to content

Commit

Permalink
more renames
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiwi committed Nov 17, 2023
1 parent c7f6091 commit 97d7a5d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/ir/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Copyright 2023 The Regents of the University of California
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>
mod expr;
mod serialize;
mod smt;
mod transition_system;
mod type_check;

pub use serialize::SerializableIrNode;
pub use smt::{
pub use expr::{
bv_value_fits_width, AddNode, ArrayType, BVLiteralInt, Context, Expr, ExprNodeConstruction,
ExprRef, GetNode, StringRef, Type, WidthInt,
};
pub use serialize::SerializableIrNode;
pub use transition_system::{SignalInfo, SignalKind, State, StateRef, TransitionSystem};
pub use type_check::{TypeCheck, TypeCheckError};
6 changes: 1 addition & 5 deletions src/mc/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright 2023 The Regents of the University of California
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>
mod sim;
mod smt;

pub use sim::Simulator;
pub use crate::sim::interpreter::Simulator;
pub use smt::{
ModelCheckResult, SmtModelChecker, SmtModelCheckerOptions, SmtSolverCmd, BITWUZLA_CMD,
};
15 changes: 13 additions & 2 deletions src/mc/sim.rs → src/sim/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,28 @@
use crate::ir::*;
use crate::sim::ValueStore;

pub trait Simulator {
/// Advance the state.
fn step(&mut self);
}

/// Interpreter based simulator for a transition system.
pub struct Simulator<'a> {
pub struct Interpreter<'a> {
ctx: &'a Context,
sys: &'a TransitionSystem,
state: ValueStore,
}

impl<'a> Simulator<'a> {
impl<'a> Interpreter<'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 }
}
}

impl<'a> Simulator for Interpreter<'a> {
fn step(&mut self) {
todo!()
}
}
4 changes: 4 additions & 0 deletions src/sim/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>
mod values;
// Copyright 2023 The Regents of the University of California
// released under BSD 3-Clause License
// author: Kevin Laeufer <[email protected]>
pub mod interpreter;

pub use values::{Value, ValueRef, ValueStore, Witness};

0 comments on commit 97d7a5d

Please sign in to comment.