 The idea that counterfactual reasoning is central to rational agency has surfaced in another way in cognitive science and artificial intelligence, where encoding counterfactual-supporting relationships has emerged as a major theory of mental representation (Chater et al. 2010). These disciplines also study how states of mind like belief, desire, and intention explain rational agency. But they are not satisfied with just showing that certain states of mind can explain certain choices and actions. They aim to explain how those particular states of mind lead to those choices and actions. They do so by characterizing those states of mind in terms of representations, and formulating particular algorithms for using those representations to learn, make choices and perform  actions.[9]  Many recent advances in cognitive science and artificial intelligence share a starting point with Bayesian epistemology: agents must learn and decide what to do despite being uncertain what exactly the world is like, and these processes can be modeled in the probability calculus. On a simple Bayesian approach, an agent represents the world with a probability distribution over binary facts or variables that represent what the world is like. But even for very simple domains the probability calculus does not provide computationally tractable representations and algorithms for implementing Bayesian intelligence. The tools of Bayesian networks, structural equations and causal models, developed by Spirtes, Glymour, and Scheines (1993, 2000) and Pearl (2000, 2009) address this limitation, and also afford simple algorithms for causal and counterfactual reasoning, among other cognitive processes. This framework represents an agent’s knowledge in a way that puts counterfactuals and causal connections at the center, and the tools it provides have been influential beyond cognitive science and AI. It has also been applied to topics covered later in this entry: the semantic analyses of counterfactuals  (§3.2)  and metaphysical dependence, causation and scientific explanation  (§1.3).  For this reason, it will be useful to describe its basics now, though still focusing on its applications to mental representation. What follows is a simplified version of the accessible introduction in Sloman (2005: Ch.4). For a more thorough introduction, see Pearl (2009: Ch.1).