Two fun R packages

Pinference: Probability Inference for Propositional Logic. “Implementation of T. Hailperin’s procedure to calculate lower and upper bounds of the probability for a propositional-logic expression, given equality and inequality constraints on the probabilities for other expressions. Truth-valuation is included as a special case. Applications range from decision-making and probabilistic reasoning, to pedagogical for probability and logic courses.”

RobinCar2: ROBust INference for Covariate Adjustment in Randomized Clinical Trials. “Performs robust estimation and inference when using covariate adjustment and/or covariate-adaptive randomization in randomized controlled trials.” Though see this post.

Logic and psychology

I happened upon an interesting question on Philosophy Stack Exchange: “What are the main views among academics on the question of the relation between logic and human cognition?” Here follows (a lightly edited version of) my answer.

Van Benthem (2008) offers examples of how cognition and social practices influence the development of logics, citing, e.g., Prior’s work on temporal structures and Lewis and Stalnaker on comparative orderings of possible worlds. He concedes that much of the work in this direction is informal (p. 74):

Logicians analyzing natural language, or computer scientists modeling “common sense”, tend to go by their own intuitions, anecdotal evidence from colleagues, email surveys of sometimes surprising naiveness, and other easy procedures that avoid the laboratories and statistical packages of the world of careful experimental design. But even so, experimental evidence is relevant, in that these theories can be, and sometimes are, modified under pressure of evidence from actual usage, even when it comes through these home-grown sources.

He also points to work in the other direction, where cognitive scientists take non-classical logics and use them to model social and cognitive phenomena. An example I know about (it was one of the reasons I chose my PhD topic and supervisor) is Stenning and van Lambalgen’s (2005) analysis of the “suppression task” in psychology, using nonmonotonic logic. Probability theory may be viewed as a kind of logic and it is used in cognitive science too; try e.g., Pfeifer (2013) and references that follow.

One key element of cognitive science studies that use logics is how people interpret tasks, and often have different interpretations, which can be modelled as choosing a logic and setting its parameters. Geis and Zwicky (1971) observe that logic students sometimes map the natural language indicative “if A, then B” to a biconditional in classical logic, so even in logic class interpretations aren’t naive.

Cognitive scientists don’t expect non-specialists to be aware of the logics that model their interpretations and inferences, e.g., here’s Da Silva Neves, Bonnefon, and Raufaste (2002, p. 110) discussing the relationship between potential properties of people’s reasoning systems and how people feel that they reason:

… even if we expect human inference to corroborate these properties, we know of no sufficient reason to think that lay reasoners would recognize any rationality postulate as valid, neither that they would conscientiously use them to guide their reasoning. […W]e assume that human inference is constrained by knowledge organisation in memory and that its formal properties emerge from a spreading activation process operating directly on knowledge structures.

References

van Benthem, J. (2008). Logic and reasoning: Do the facts matter? Studia logica, 88, 67-84.

Da Silva Neves, R., Bonnefon, J. F., & Raufaste, E. (2002). An empirical test of patterns for nonmonotonic inference. Annals of Mathematics and Artificial Intelligence, 34, 107-130.

Geis, M. L., & Zwicky, A. M. (1971). On invited inferences. Linguistic inquiry, 2(4), 561-566.

Pfeifer, N. (2013). The new psychology of reasoning: A mental probability logical perspective. Thinking & Reasoning, 19(3-4), 329-345.

Stenning, K., & van Lambalgen, M. (2005). Semantic interpretation as computation in nonmonotonic logic: The real meaning of the suppression task. Cognitive Science, 29(6), 919-960.

No reasoning task is too irritating to be completed

Consider the sentence: “No head injury is too trivial to be ignored.” What does it mean?

Now consider: “No missile is too small to be banned.”

Go back to the first sentence – are you sure it means what you thought it did?

See Wason, P. C., & Reich, S. S. (1979). A Verbal Illusion. Quarterly Journal of Experimental Psychology, 31(4), 591–597.

Individuals versus aggregrates

“Winwood Reade is good upon the subject,” said Holmes. “He remarks that, while the individual man is an insoluble puzzle, in the aggregate he becomes a mathematical certainty. You can, for example, never foretell what any one man will do, but you can say with precision what an average number will be up to. Individuals vary, but percentages remain constant. So says the statistician.”

—The Sign of Four by Sir Arthur Conan Doyle (hat-tip MP)

Dysrationalia — if you disagree with me, off with your head

Some quotations from a critique of (an early version of) Stanovich’s theory by Sternberg (1994). Firstly, theory:

“Why do we need a theory? Because we’ve had too many fly-by-night constructs in the abilities business, and we don’t need more of them. We do need serious new constructs — and the way to present them is via a theory […] — and construct validation of that theory.”

What is an irrational belief?

“In the real world, few problems truly lend themselves to the kind of deductive (rational) reasoning we learn in logic classes. The vast majority of problems are inductive, so that arguments can be stronger or weaker, but not logically valid or invalid. I am afraid that Stanovich has fallen into a trap that of labeling people as “dysrational” who have beliefs that he does not accept. And therein lies frightening potential for misuse. And if you disagree with me, off with your head. Here, it’s a joke. Historically, it’s not.”

Reference

Robert J. Sternberg (1994). What If the Construct of Dysrationalia Were an Example of Itself? Educational Researcher, 23, pp. 22-23+27

The rational agent

“… the rational agent is not simply the one who follows the normative canons of logic and probability theory, and neither is she the one who follows adapted heuristics for action choice or ‘somatic markers’. Rather the rational agent is the critically self-aware agent; the one who is aware why she acts, and who modifies her own behaviour according to her self-knowledge. As Karl Popper (1990) wrote, ‘A rationalist is simply someone for whom it is more important to learn than to be proved right’…”

Lambie, J. A. (2008). On the irrationality of emotion and the rationality of awareness. Consciousness and Cognition, 17, 946-971

Prover9 and Mace4

Just found two fantastic programs and a GUI for exploring first-order classical models and also automated proof, Prover9 and Mace4.  There are many other theorem provers and model checkers out there.  This one is special as it comes as a self-contained and easy to use package for Windows and Macs.

There are many impressive examples built in which you can play with.  To start easy, I gave it a syllogism:

all B are A
no B are C

with existential presupposition, which is expressed:

exists x a(x).
exists x b(x).
exists x c(x).
all x (b(x) -> a(x)).
all x (b(x) -> -c(x)).

and asked it to find a model. Out popped a model with two individuals, named 0 and 1:

a(0).
- a(1).

b(0).
- b(1).

- c(0).
c(1).

So individual 0 is an A, a B, but not a C. Individual 1 is not an A, nor a B, but is a C.

Then I requested a counterexample to the conclusion no C are A:

a(0).
a(1).

b(0).
- b(1).

- c(0).
c(1).

The premises are true in this model, but the conclusion is false.

Finally, does the conclusion some A are not C follow from the premises?

2 (exists x b(x)) [assumption].
4 (all x (b(x) -> a(x))) [assumption].
5 (all x (b(x) -> -c(x))) [assumption].
6 (exists x (a(x) & -c(x))) [goal].
7 -a(x) | c(x). [deny(6)].
9 -b(x) | a(x). [clausify(4)].
10 -b(x) | -c(x). [clausify(5)].
11 b(c2). [clausify(2)].
12 c(x) | -b(x). [resolve(7,a,9,b)].
13 -c(c2). [resolve(10,a,11,a)].
16 c(c2). [resolve(12,b,11,a)].
17 $F. [resolve(16,a,13,a)].

Indeed it does. Unfortunately the proofs aren’t very pretty as everything is rewritten in normal forms.  One thing I want to play with is how non-classical logics may be embedded in this system.

Competence vs. performance

It’s all Chomsky’s fault (Chomsky 1965, p. 4):

“We thus make a fundamental distinction between competence (the speaker-hearer’s knowledge of his language) and performance (the actual use of language in concrete situations). […] A record of natural speech will show numerous false starts, deviations from rules, changes of plan in mid-course, and so on. The problem for the linguist, as well as for the child learning the language, is to determine from the data of performance the underlying system of rules that have been mastered by the speaker-hearer and that he puts to use in actual performance.”

So the idea is that people are trying to do C but only manage to do P, because of various constraints. We (children, adults, theorists) see (imperfect) P, and want to infer C. We go to school and go through various rigmaroles to better approximate C. The same distinction is applied in reasoning. Various options: people are irrational (with respect to C); maybe C = P, if we look hard enough to see it. Or bright people have P = C. Or bright people want P = C.

What fascinates me in reasoning is the role played by small groups of experts who produce particular systems of reasoning – logical calculi, probabilistic machinery – along with proofs that they have properties which they argue are reasonable properties to have. Then others come along to use the systems. Hey, this looks like a good logic to know; maybe it’ll help make my arguments better if I use it. Maybe this probability calculus will make it easier to diagnose illness in my patients. And so on. Then somebody else comes along and decides whether or not we’re consistent with a competence theory’s judgements, or whether we’re interpreting things a different way; whether another competence theory (application thereof) might be more appropriate for a given situation or a different psychological model of the situation.

Easy to get tied up in knots.

References

Chomsky, N. (1965). Aspects of the Theory of Syntax. MIT Press.

“Conscious” reasoning

Read this:

For us, however, a key difference is that only conscious reasoning can make use of working memory to hold intermediate conclusions, and accordingly reason in a recursive way (Johnson-Laird, 2006, p. 69): primitive recursion, by definition, calls for a memory of the results of intermediate computations (Hopcroft & Ulmann, 1979). [… example task omitted …] The non-recursive processes of intuition cannot make this inference, but when we deliberate about it consciously, we grasp its validity (Cherubini & Johnson-Laird, 2004). Conscious reasoning therefore has a greater computational power than unconscious reasoning, and so it can on occasion overrule our intuitions.

There’s no evidence that whatever bits of memory intuition uses cannot do recursion.  Hunting through semantic memory structures can be viewed as a recursive process and the process is not (at least always) accessible to consciousness.  Aside from this, you can impose recursion on just about any process you care to analyse, and you can often remove recursion from a process description depending on what primitives are available.  Questioning whether a process “is” or “isn’t” recursive isn’t a healthy activity.  Also the jump from “recursive” to “primitive recursive”, as if they were one and the same, is deeply confusing.  See the Stanford Encyclopaedia of Philosophy for details of other flavours of recursion.

Bucciarelli, M.; Khemlani, S. & Johnson-Laird, P. N. (2008). The psychology of moral reasoning. Judgment and Decision Making, 3, 121-139

A good way to think about truth

“My intention was not to deal with the problem of truth, but with the problem of truth-teller or truth-telling as an activity. By this I mean that, for me, it was not a question of analyzing the internal or external criteria that would enable the Greeks and Romans, or anyone else, to recognize whether a statement or proposition is true or not. At issue for me was rather the attempt to consider truth-telling as a specific activity, or as a role.”

Discourse & Truth, Concluding remarks by Foucault. (Spotted here.)