pub trait Contract<S: Symbolic>: Clone + IndexMut<usize, Output = Instruction<S>> + Include<Instruction<S>> + Insert<usize, Instruction<S>> {
    // Required methods
    fn alphabet(&self) -> Box<dyn Alphabet<S>>;
    fn final_state(&self) -> State;
    fn instructions(&self) -> &Vec<Instruction<S>>;
    fn instructions_mut(&mut self) -> &mut Vec<Instruction<S>>;

    // Provided methods
    fn get(&self, head: Head<S>) -> Option<&Instruction<S>> { ... }
    fn insert(&mut self, inst: Instruction<S>) -> Option<Instruction<S>> { ... }
}

Required Methods§

source

fn alphabet(&self) -> Box<dyn Alphabet<S>>

source

fn final_state(&self) -> State

source

fn instructions(&self) -> &Vec<Instruction<S>>

source

fn instructions_mut(&mut self) -> &mut Vec<Instruction<S>>

Provided Methods§

source

fn get(&self, head: Head<S>) -> Option<&Instruction<S>>

Given some Head, find the coresponding Instruction

source

fn insert(&mut self, inst: Instruction<S>) -> Option<Instruction<S>>

Try to insert a new Instruction into the program; if the instruction is invalid, return None Otherwise, return the previous instruction at the same Head if it exists

Implementors§