In general, a system's knowledge relates the system's operations to its goals. A conventional program organizes certain operations together to achieve a specific 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 flexibility comes with a cost in 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 approach toward 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.
Later, the meaning of the concept is broaden to a framework to cover almost all AI research, such as in AI textbooks. Recently, in the context of Large Language Models (LLMs), Agentic AI (or an AI Agent) refers to a system that uses an LLM as its core "brain" to perform complex, multi-step tasks autonomously, rather than just responding to a single prompt with text.