Hi!
I'm having the following problem. Suppose I have the knowledge base from below:
mom(13, bla, bli).
dad(15, foo).
grandma(18, a, b, c, d, e).
grandpa(19, x, y, z).
Each predicate has some parameters of which only the first is important to identify it. Identifiers are unique (or not, I don't think non-uniqueness will do any harm)
What's the best way to implement a predicate get_term that works like this?
?- get_term(13, X).
X = mom(13, bla, bli)
?- get_term(19, Y).
Y = grandpa(19, x, y, z)
Help will be greatly appreciated, thanks in advance
I'm having the following problem. Suppose I have the knowledge base from below:
mom(13, bla, bli).
dad(15, foo).
grandma(18, a, b, c, d, e).
grandpa(19, x, y, z).
Each predicate has some parameters of which only the first is important to identify it. Identifiers are unique (or not, I don't think non-uniqueness will do any harm)
What's the best way to implement a predicate get_term that works like this?
?- get_term(13, X).
X = mom(13, bla, bli)
?- get_term(19, Y).
Y = grandpa(19, x, y, z)
Help will be greatly appreciated, thanks in advance