internal override BranchingRule <TERM> ReplaceAllStates1(int q, TERM r) { var cases1 = Array.ConvertAll(cases, c => new KeyValuePair <TERM, BranchingRule <TERM> >(c.Key, c.Value.ReplaceAllStates1(q, r))); var defaultcase1 = defaultcase.ReplaceAllStates1(q, r); var rule = new SwitchRule <TERM>(input, defaultcase1, cases1); return(rule); }
internal override BranchingRule <TERM> Subst1(TERM path, IContextCore <TERM> solver, Dictionary <TERM, TERM> subst) { TERM defaultcond = solver.True; var cases1 = new KeyValuePair <TERM, BranchingRule <TERM> > [cases.Length]; for (int i = 0; i < cases.Length; i++) { var cond = solver.MkEq(input, cases[i].Key); defaultcond = And(solver, defaultcond, solver.MkNot(cond)); cases1[i] = new KeyValuePair <TERM, BranchingRule <TERM> >(cases[i].Key, cases[i].Value.Subst1(And(solver, path, cond), solver, subst)); } var defaultcase1 = defaultcase.Subst1(And(solver, path, defaultcond), solver, subst); var rule = new SwitchRule <TERM>(input, defaultcase1, cases1); return(rule); }
internal override BranchingRule <TERM> Concretize1(TERM path, IContextCore <TERM> solver, Func <TERM, TERM> fBP, Func <TERM, TERM> fNBP, Func <int, TERM, int> stateMap, TERM newReg, TERM inputVar) { TERM defaultcond = solver.True; var cases1 = new KeyValuePair <TERM, BranchingRule <TERM> > [cases.Length]; for (int i = 0; i < cases.Length; i++) { var cond = solver.MkEq(input, cases[i].Key); defaultcond = And(solver, defaultcond, solver.MkNot(cond)); cases1[i] = new KeyValuePair <TERM, BranchingRule <TERM> >(cases[i].Key, cases[i].Value.Concretize1(And(solver, path, cond), solver, fBP, fNBP, stateMap, newReg, inputVar)); } var defaultcase1 = defaultcase.Concretize1(And(solver, path, defaultcond), solver, fBP, fNBP, stateMap, newReg, inputVar); var rule = new SwitchRule <TERM>(input, defaultcase1, cases1); return(rule); }