Hello,
How do I turn an atom – that I generate at runtime – and which has the format:
'solve(A):-ask_for_help(A).'
into a clause that I can assert in the knowledge base so that I can use it as part of my program?
I apologize if the answer is blindingly obvious. The extra-logical stuff in Prolog always KOs me.
A bit of background: In my program, and at runtime; I need to generate a constraint-satisfaction problem and solve it. It is not possible to statically generate the CSP as it depends on the problem that the program tries to solve.
Using diverse atom processing built-in predicates, I am able to generate an atom like this:
'solve_csp(A):-clpr:{A=2*B},clpr:{A+B=9}.'
Then, when it comes to asserting it in the knowledge base using assert/1, it gets asserted as an atom – which it is. However, I want it asserted as a predicate that can be evaluated.
Many thanks.