In general, a system's knowledge relates the system's operations to its goals. A conventional program organizes certain operations together to serve a certain goal, while reasoning creates new relations on the basis of the existing ones to related operations and goals in more flexible ways.
The key technical idea is to give a proposition P(a, b, c) a procedural interpretation to see it as an executable procedure. The same proposition can also be interpreted as a goal, i.e., a proposition to be realized.
Prolog: introduction with examples that can be tested in SWI-Prolog online.
The same Prolog program can be used for multiple goals with different input/output combinations. This property also increases the complexity of programming and debugging.Planning can be carried out as state-space search without executing the operations, but only recording the path.
Without a given graph to be searched, planning can also be carried out as reasoning that generates part of the graph when necessary: to specify each state by a set of propositions, and each operation by its preconditions and consequences (postconditions). Example: STRIPS in Shakey.Planning can be considered as one form of self-programming. Beside combinatorial explosion, there is also the frame problem, which is about the difficulty of fully specifying the preconditions and consequences of an operation.
A well-known agent framework is the Belief-Desire-Intention (BDI) model, which provides the procedures for plan selection, execution, monitoring, and revision.