/// <summary> /// Pulls the data sources from the provided variable state, and merges them with each variable slot. /// </summary> /// <param name="self">The state to modify.</param> /// <param name="other">A snapshot of variable states to pull the data sources from.</param> /// <returns><c>True</c> if the variables state has changed, <c>false</c> otherwise.</returns> public static bool MergeWith <T>(this IVariableState <SymbolicValue <T> > self, IVariableState <SymbolicValue <T> > other) { bool changed = false; foreach (var variable in other.GetAllRecordedVariables()) { changed |= self[variable].MergeWith(other[variable]); } return(changed); }
/// <summary> /// Creates a new symbolic program state. /// </summary> /// <param name="programCounter">The value of the current program counter.</param> /// <param name="stack">A snapshot of the current state of the stack.</param> /// <param name="variables">A snapshot of the state of all variables.</param> public SymbolicProgramState(long programCounter, IStackState <SymbolicValue <TInstruction> > stack, IVariableState <SymbolicValue <TInstruction> > variables) { ProgramCounter = programCounter; Stack = stack ?? throw new ArgumentNullException(nameof(stack)); Variables = variables ?? throw new ArgumentNullException(nameof(variables)); }