public override GroundedPredicate Ground(Dictionary <string, Constant> dBindings) { GroundedFunctionPredicate gpred = new GroundedFunctionPredicate(Name); gpred.Negation = Negation; foreach (Argument a in Parameters) { if (a is Parameter) { if (!dBindings.ContainsKey(a.Name)) { return(null); } gpred.AddConstant(dBindings[a.Name]); } else if (a is Constant) { gpred.AddConstant((Constant)a); } else if (a is FunctionParameter) { FunctionParameter fp = (FunctionParameter)a; ParameterizedFunctionPredicate pfp = fp.Function; GroundedFunctionPredicate gfp = (GroundedFunctionPredicate)pfp.Ground(dBindings); FunctionConstant fc = new FunctionConstant(gfp); gpred.AddConstant(fc); } } return(gpred); }
public FunctionConstant(GroundedFunctionPredicate f) : base("Function", f.Name) { Function = f; }