public HSPPredicate GroundToConstant(Dictionary <string, string> subst) { List <HSPTerm> args = new List <HSPTerm>(); foreach (HSPTerm arg in _args) { if (subst.ContainsKey(arg.GetValue())) { string value = subst[arg.GetValue()]; if (arg.IsTyped()) { string type = subst[arg.GetTermType()]; HSPTerm _const = arg.constant(type, value); args.Add(_const); } else { HSPTerm _const = arg.constant(null, value); args.Add(_const); } } } return(new HSPPredicate(_name, args)); }
private List <HSPTerm> ParseParameters(JsonNode node) { List <HSPTerm> items = new List <HSPTerm>(); foreach (var obj in node.Members) { foreach (var param in obj.Value.Members) { HSPTerm item = new HSPTerm(obj.Key, param.Key, null); items.Add(item); } } return(items); }
public List <HSPTerm> DeriveArgs(IDictionary <string, JsonNode> nodes) { List <HSPTerm> args = new List <HSPTerm>(); foreach (var item in nodes) { if (item.Value.Members.Count > 0) { foreach (var member in item.Value.Members) { HSPTerm newarg = new HSPTerm(null, member.Key, item.Key); args.Add(newarg); } } else { HSPTerm newarg = new HSPTerm(null, null, item.Key); args.Add(newarg); } } return(args); }
public List <HSPTerm> DeriveArgs(IDictionary <string, JsonNode> nodes) { List <HSPTerm> args = new List <HSPTerm>(); foreach (var item in nodes) { /*if (item.Value.Members.Count > 0) { * foreach (var member in item.Value.Members) { * HSPTerm newarg = new HSPTerm(item.Key, member.Key, null); * args.Add(newarg); * } * } * else { * HSPTerm newarg = new HSPTerm(item.Key, null, null); * args.Add(newarg); * }*/ HSPTerm newarg = new HSPTerm(item.Key, null, null); args.Add(newarg); } return(args); }
public bool isEqualTo(HSPTerm other) { return(true); }