private static Dictionary <CellSymbol, bool> Extend(CellSymbol symbol, bool value, IDictionary <CellSymbol, bool> model) { return(new Dictionary <CellSymbol, bool>(model) { [symbol] = value }); }
public override bool Equals(object obj) { CellSymbol cellSymbol = obj as CellSymbol; if (cellSymbol == null) { return(false); } return(Equals(cellSymbol)); }
private static bool TTCheckAll(ILogicalExpression kb, ILogicalExpression query, IReadOnlyList <CellSymbol> symbols, IDictionary <CellSymbol, bool> model) { if (symbols.Count == 0) { if (PLTrue(kb, model)) { bool res = PLTrue(query, model); return(res); } return(true); } CellSymbol p = symbols[0]; var rest = new List <CellSymbol>(symbols); rest.RemoveAt(0); return(TTCheckAll(kb, query, rest, Extend(p, true, model)) && TTCheckAll(kb, query, rest, Extend(p, false, model))); }
private bool Equals(CellSymbol other) { return(row == other.row && col == other.col && symbol == other.symbol); }