Search topics and sections

The philosophy of computer science studies the philosophical questions that come up in computer science and in building software. It asks what programs and computers are, how anyone can know that a program does what it should, and what kind of subject computer science is.[1]

Because programs are complex objects, many of the field's questions have counterparts in the philosophy of mathematics, the philosophy of science, and the philosophy of technology.[1]

Main questions

The field looks at the ontology and the epistemology of computing systems.[1] Ontology is the study of what kinds of things exist. Epistemology is the study of knowledge and how it is justified.

Most work centers on how systems are specified, programmed, implemented, verified, and tested.[1] Typical questions include:

  • What are software and hardware, and is the line between them real?
  • What is an algorithm, and when are two algorithms the same?
  • What is a program? Is it a theory, a model, or a built object?
  • What does it mean for a physical device to carry out a computation?
  • How can anyone know that a program is correct?
  • Is computer science mathematics, engineering, or a science?

Roughly, a system is correct when it behaves as it is supposed to.

Software and hardware

Computing systems are usually split into two kinds of thing.[1] Software (algorithms, source code, programs) is treated as abstract. Hardware (processors, hard drives, whole machines) is concrete and physical. Philosophers have questioned this split in several ways.

Author Main claim
James Moor (1978) The split is practical, not a split between kinds of thing. What counts as software for one professional may count as hardware for another.
Peter Suber (1988) Hardware is a kind of software, because any definite pattern can be given a meaning that makes it readable and executable.
Timothy Colburn (1999, 2000) Software is a "concrete abstraction". It always sits in some physical medium, yet programmers write it without regard to any one machine.
Nurbay Irmak (2012) Software is an "abstract artifact". It has no place in space, but it starts to exist at a time and can stop existing.
William Duncan (2017) Software is a set of instructions that act as specifications for a machine. Hardware is an artifact whose function is to carry out the specified computation.

Moor points out that no program exists without some physical form, such as a disk or a sheet of paper.[1] Early programs were even hardwired into machines or set as patterns of physical levers. An engineer who builds hardwired circuits may call many physical parts "software".

Levels of abstraction

A second approach replaces the two-part split with a stack of levels.[1] Each level is an abstraction, a simpler description that hides details handled elsewhere. For example, an abstract data type such as a list is defined only by its operations (make an empty list, add an element, take the first element, take the rest), not by how memory stores it.

Some authors argue that abstraction in computing differs from abstraction in mathematics.[1] Colburn and Shute (2007) say that in computing, information is hidden but not destroyed. Details ignored at one level must be handled at a lower one: a programmer need not know where a variable sits in memory, but the machine must.

The six levels

Giuseppe Primiero (2016) lists six levels for a digital computing system, from top to bottom:[1]

  1. Intention: the problem that customers, users, or other stakeholders want solved.
  2. Specification: the set of requirements a solution must meet.
  3. Algorithm: a procedure that solves the problem and meets the specification.
  4. High-level language instructions: the source code, written in a language such as C, Java, or Python.
  5. Assembly and machine code: the instructions a compiler and assembler produce, which a processor can run.
  6. Execution: the physical machine running the instructions.
Levels of abstraction in a digital computing system Intention Problem to solve Specification Requirements Algorithm Procedure High-level code C, Java, Python Assembly / machine code Execution Physical machine implemented by implemented by implemented by implemented by implemented by More abstract More concrete Each level is a function for the level below and a structure for the level above
Primiero's levels of abstraction for a digital computing system. Each level is implemented by the one below it, from the stakeholders' intention down to physical execution.

On this view, no single level defines what a computing system is, and none settles where software ends and hardware begins.[1] The system is the whole stack.

Function and structure

Raymond Turner (2018) argues that each level states the function of the level below it and is the structure that realizes the level above it.[1] A function says what must be done. A structure says how it is done.

Two results follow from this picture:[1]

  • Many structures can realize one function. One specification can be met by many algorithms, one algorithm can be written in many languages, source code can be compiled for different instruction set architectures, and one executable can run on many machines that share an instruction set.
  • Each level sets the standard of correctness for the level below it (Primiero 2020). An error can therefore sit at any level, not only in the running machine.

Specifications and artifacts

Specifications

A specification states what a system must do.[1] For a phone app that blocks call-center calls, it might say: keep a blacklist of numbers, update it every so many days, check each incoming call against it, and block any call that matches. Specifications often start in plain language and are later written in a formal specification language such as VDM or Z, or in a graphical language such as UML.

Turner (2011) defines the idea by its role: "something is a specification when it is given correctness jurisdiction over an artefact".[1] A system is correct when it behaves as its specification says and malfunctions when it does not.

A model and a specification can hold the same information but differ in which way they govern.[1] If a model does not match the system it describes, the model is fixed. If a system does not match its specification, the system is fixed. Turner notes this is an ideal, since specifications are themselves revised when they cannot be built or do not capture what clients wanted.

Programs as technical artifacts

A technical artifact is a human-made object designed to fulfill a function, such as a screwdriver, a bridge, or a television (Kroes 2012).[1] It has functional properties (what it is for) and structural properties (the physical features that let it do that). A screwdriver's function, turning screws, can be realized by a metal-and-plastic hand tool or by an electric one.

Turner argues that computing systems are technical artifacts in this sense, with each level in the stack acting as structure for the level above.[1] A consequence is that a structure need not be physical, so the idea of an abstract artifact makes sense in computing.

Where functions come from

Philosophers disagree about what gives an artifact its function.[1]

Theory Function is fixed by Example or strength Problem
Causal (Cummins 1975) What the object can physically do A heart's function of pumping blood comes from its ability to contract and expand Cannot define malfunction or tell intended functions from side effects. If the call-blocking app starts blocking friends, that would count as a new function. A phone heating up during a long call would count too.
Intentional (McLaughlin 2001; Searle 1995) What the designer or user intends Explains malfunction and side effects Leaves open whether the function lives in the object or in someone's mind

Turner (2018) proposes combining the two.[1] There is no function without an implementation, and no intention without clients, developers, and users.

What is an algorithm?

The word "algorithm" comes from the name of al-Khwārizmī, a ninth-century Persian mathematician who gave rules for arithmetic with Arabic numerals.[1] Long division and Euclid's algorithm for the greatest common divisor are familiar examples. Intuitively, an algorithm is a set of instructions for carrying out a task.

The effort to define algorithms precisely began with the crisis in the foundations of mathematics in the early twentieth century.[1] Logicians made the idea of "effective calculability" exact, which gave rise to the theory of computation. Even so, Moshe Vardi (2012) notes that there is still no general agreement on what an algorithm is.[1]

Classical definitions

Andrey Markov (1954) gave an early precise definition.[1] An algorithm is determined (no step allows an arbitrary choice), applicable (it works for a whole class of inputs), and effective (it tends to reach a result). Stephen Kleene (1967) added that it must be finite and that its steps must be mechanical, needing no insight to follow.

Donald Knuth (1973) listed five features of an algorithm:[1]

  • Finiteness: it always stops after a finite number of steps.
  • Definiteness: each step is precisely and unambiguously defined.
  • Input: it has zero or more inputs.
  • Output: it has zero or more outputs.
  • Effectiveness: each operation is basic enough that a person with pencil and paper could do it exactly in finite time.

Formal definitions

Yuri Gurevich (2000) gave an axiomatic definition for one class, sequential algorithms.[1] He showed that any sequential algorithm can be simulated by a sequential abstract state machine that meets three postulates:

  1. Sequential time: the algorithm has a set of states, a set of starting states, and a rule that moves from one state to the next. A run need not stop.
  2. Abstract state: each state is a first-order structure, meaning a set of objects together with named functions and relations on them, as used in logic.
  3. Bounded exploration: each step looks at only a fixed, finite set of terms in the current state.

Gurevich (2011) also argues that no formal definition can cover all algorithms, since the idea keeps growing to include parallel, analog, and quantum algorithms.[1]

Yiannis Moschovakis (2001) objects that abstract machines miss what is essential.[1] For him an algorithm is a system of recursive equations, and the many abstract machines for a sorting method such as mergesort are different implementations of one algorithm. This raises the open problem of saying exactly when two implementations are equivalent.

Primiero (2020) describes algorithms at three levels: as informal specifications, as procedures written in a formal language, and as abstract machines that can be implemented.[1] At the lowest level he defines two machines as running the same algorithm when their abstract machines are in a bisimulation, a formal matching of their states and steps.

Informal definitions

Robin Hill (2016) offers an informal definition:[1]

An algorithm is a finite, abstract, effective, compound control structure, imperatively given, accomplishing a given purpose, under given provisions.

On this definition a recipe is not an algorithm because it is not effective, and a game is not one because it is not imperatively given.[1]

What is a program?

Programs as theories

Allen Newell and Herbert Simon (1972) held that a program simulating human problem solving is an empirical theory of the mind it simulates.[1] The program's run predicts the steps a person will take on the same task. If the two differ, the program is revised, like a theory that fails a test.

Others reject this view:[1]

  • Moor (1978) calls it a myth. A program can only simulate some phenomena, so at most it is a model, and models do not explain or predict the way theories do.
  • Paul Thagard (1984) argues that programs fit neither main account of scientific theories. On the syntactic view, theories are sets of statements describing a system, but programs are instructions, not descriptions. On the semantic view, theories are collections of models, but programs simulate systems without satisfying a theory's laws and axioms. William Rapaport replies that languages such as Prolog can be read both as instructions and as descriptions.
  • Peter Naur (1985) argues that programming is theory building in a different sense. The programmers hold a theory of the program, and this shared knowledge matters more than documentation or specifications when the program must change.

Turner treats programming languages as mathematical objects with a formal grammar and a formal semantics.[1] In operational semantics, a rule such as

⟨P,s⟩⇓s′\langle P, s \rangle \Downarrow s'

says that program PP run in state ss ends in state s′s'. On this view a language with an operational semantics is like an axiomatic theory of operations, with its rules as axioms for the relation ⇓\Downarrow.[1]

Programs as artifacts

Turner (2014) also argues that programming languages are technical artifacts.[1] Their functional properties come from the semantics of each construct. Their structural properties come from how a machine carries out each construct, for example computing the value of EE and storing it at location xx for the assignment x:=Ex := E.

When are two programs the same?

Gualtiero Piccinini holds that two programs can be identified by their syntax and the operations they perform on symbols, which he calls an internal semantics.[1] Mark Sprevak (2010) gives a counterexample: one adding program works on Arabic numerals and another on Roman numerals. Both compute addition, but seeing this requires reading the symbols as numbers.

Nicola Angius and Primiero (2018) treat program identity like the identity of other kinds of things.[1] They propose bisimulation between the machines that two programs implement as the test of identity, with the weaker relation of simulation as a test for copies.

Implementation

Implementation is the relation between a level and a level above it, such as a program and the algorithm it carries out.[1] It matters because correctness is defined through it. A correct program is a correct implementation of an algorithm, and a correct system is a correct implementation of its specifications.

Account Proposed by Implementation is Main criticism
Semantic interpretation Rapaport (1999, 2005) Giving an abstract or syntactic domain a meaning in some medium, which can be abstract or concrete It does not account for incorrect implementations (Primiero 2020). An array that implements a stack does not give correctness standards for the stack; the stack gives them for the array (Turner 2018).
Specification and artifact Turner (2012, 2014, 2018) A relation in which the abstract level is a specification with authority over an artifact It links only one specification to one artifact, so an error cannot be traced to several levels at once (Primiero 2020).
Instantiation across levels Primiero (2020) A relation between any level and any level higher in the stack

Turner (2012) separates three ways a physical machine can implement an abstract machine.[1] In the intentional sense, the abstract machine specifies every allowed behavior. In the extensional sense, there is a mapping of states and steps between the two. In the empirical sense, testing shows the physical machine behaves as the abstract one prescribes.

Physical computation

A central question is which physical systems compute.[1] If any system that implements an algorithm counts, then brains, cells, the universe, and perhaps everything compute. The claim that everything computes is called pancomputationalism.

Rapaport (2018) defines a computer as any "physical plausible implementation of anything logically equivalent to a universal Turing machine".[1] The word "plausible" is needed because a universal Turing machine has unlimited memory and never makes errors, while real machines have finite memory and can make errors.

Searle and the replies

John Searle (1990) argued that anything can implement a Turing machine.[1] Being a Turing machine is a matter of syntax, of handling 0s and 1s, and syntax is not a physical property of the system. An observer assigns it, so any system whose behavior can be described that way counts as computing.

Several replies try to block this conclusion:[1]

  • Patrick Hayes (1997): if everything computed, "being a computer" would mean nothing. Computers are systems whose stored patterns can be both data and instructions and can change themselves, like "magic paper".
  • Piccinini (2007, 2015): a system computes when its behavior is explained by a computing mechanism, one that turns input strings into output strings by general rules.
  • André Curtis-Trudel: a system computes when it resembles a computing architecture. For a digital computer, the architecture is its instruction set architecture.

Mapping accounts

The simple mapping account says a physical system SS correctly implements a specification SPSP only if a mapping ff links the states of SS to the states of SPSP and every state change in SS matches a state change in SPSP:[1]

s1→s2 in S⟹f(s1)→f(s2) in SPs_1 \to s_2 \text{ in } S \quad\Longrightarrow\quad f(s_1) \to f(s_2) \text{ in } SP

Here s1s_1 and s2s_2 are physical states and f(s1)f(s_1) and f(s2)f(s_2) are the matching computational states.

Simple mapping account of implementationf(s1)f(s2)s1s2ffSpecification SPPhysical system S(computational states)(physical states)Each physical stepmust match acomputational step
In the simple mapping account, a physical system SS implements a specification SPSP when a mapping ff sends each physical state ss to a computational state f(s)f(s), so that every physical transition from s1s_1 to s2s_2 matches a computational transition from f(s1)f(s_1) to f(s2)f(s_2).

The weakness is that such a mapping is easy to find for almost any system, which opens the door to pancomputationalism (Anderson and Piccinini 2024).[1]

Other accounts add conditions:[1]

  • Causal (David Chalmers 1996; Jack Copeland 1996): the mapping must hold for what would happen, not only for what does happen.
  • Semantic (Sprevak 2012): a system needs a description of what it is meant to achieve.
  • Syntactic: only physical states that count as syntactic can map to computational states.
  • Normative (Turner 2012): the abstract specification sets the rules the physical system must follow.
  • Robust (Anderson and Piccinini 2024): the mapping must be stable under small physical disturbances and reliable.

One device, two functions

The same physical device can often be read as computing different functions.[1] A logic gate can implement either AND or OR, depending on which voltage range is labeled true. Fresco, Copeland, and Wolf (2021) call this multiple specifiability, and Curtis-Trudel (2022) argues that the labeling an agent chooses fixes the function.

One physical gate read as AND or ORABQPhysical gateVoltagesABQLLLLHLHLLHHHLabel H = trueABQFFFFTFTFFTTTANDLabel L = trueABQTTTTFTFTTFFFORlabelinglabeling
The same physical gate gives a high output only when both inputs are high. Reading high voltage as true makes it compute AND, and reading low voltage as true makes it compute OR.

Verification and correctness

Verification is the process of checking whether a system is correct with respect to its specification.[1] There are two broad families:

In many practical cases both are used together.[1]

Formal methods as models

Formal verification needs a representation of the software.[1] In theorem proving, the program is represented as an axiomatic system and correctness is derived from the axioms. In model checking, the program is represented as a state transition system (a graph of the program's possible states and the steps between them), the required properties are written in temporal logic (a logic for statements about what holds now, always, or eventually), and an algorithm checks whether they hold.

Angius and Guglielmo Tamburrini (2011) compare these state transition systems to scientific models.[1] Before verification, such a model is a hypothesis about all the runs the program could make. After a property is checked in the model, the program is tested to see whether the model was an accurate picture.

Testing as experiment

Edsger Dijkstra wrote in 1970: "Program testing can be used to show the presence of bugs, but never to show their absence!"[2] Gregor Snelting (1998) saw this as bringing Karl Popper's principle of falsifiability into computer science.[1] Testers can run a program on only a finite set of inputs for a finite time, so passing tests never proves it correct.

Tested inputs within the space of all possible inputsAll possible inputsUntested: bugs may remainTested inputsBug found
Testing runs a program on only a small sample of its possible inputs. A test can show that a bug exists, but it cannot show that the untested inputs are free of bugs.

Testing differs from a scientific experiment in several ways.[1] First, when a test fails, testers fix the program, not the hypothesis, because a specification is a requirement rather than a claim about nature.

Viola Schiaffonati (2015) argues that most software tests are explorative experiments rather than theory-driven ones.[1] Testers often explore a system's behavior without a guiding theory. They also often act as users in a real-like setting, while in a theory-driven experiment the experimenters do not take part.

Matti Tedre (2015) separates five kinds of experiment in computing:[1]

  • Feasibility experiments check whether a system does what users asked for.
  • Trial experiments test single abilities under set starting conditions.
  • Field experiments run in real settings rather than simulated ones.
  • Comparison experiments test several systems that realize the same function to see which works better.
  • Controlled experiments test hypotheses about a system's behavior. These are the only kind on a par with theory-driven experiments in science.

The proof debate

One of the field's early debates was over whether programs can be proved correct.[1] Tony Hoare (1969), who gave an axiomatic basis for programming (now called Hoare logic), concluded that programming is an "exact science" whose proofs stand on a par with proofs in mathematics. Others pushed back on several grounds.

  • Richard De Millo, Richard Lipton, and Alan Perlis (1979) argued that real mathematical proofs are graspable, so experts can see why they hold. Correctness proofs are long and hard to follow, and they lack the lemmas and new concepts that let a reader check a long mathematical proof step by step.[1]
  • Hoare himself (1981) admitted that proving correctness is possible in principle but hardly achievable in practice.[1]
  • Large proofs are done by machine, so the question moves to whether the proving program is correct. Konstantine Arkoudas and Selmer Bringsjord (2007) reply that a small proof checker is easier to verify.[1]
  • James Fetzer (1988) argued that a proof can show a program meets its specification, but not that a physical machine running it will. That last step needs empirical checking.[1]

Tyler Burge argues that computer-based proofs can still give a priori knowledge, because their justification does not rest on sense experience even if their use does.[1]

Correctness checks at each level of a program Intention Specification Algorithm High-level code Assembly / machine code Execution needs access to people's intentions formal verification (mathematical) testing (empirical)
The six levels of a program, from intention down to execution, each matched to the way its correctness is checked. Checking a specification against intention needs access to people's intentions, the levels from specification to machine code can be formally verified, and execution is checked by testing.

In the layered view, correctness between the non-physical levels can be checked mathematically, while the execution level is checked empirically by testing.[1] Checking a specification against clients' intentions would need access to the mental states of the people involved.

Miscomputation

Alan Turing (1950) separated errors of functioning from errors of conclusion.[1] Errors of functioning come from faulty hardware. Errors of conclusion occur when a correct machine still fails at its task, for example when the program meets a specification that does not capture what users need.

Nir Fresco and Primiero (2013) extended this into a taxonomy of miscomputation based on the levels of abstraction:[1]

Error type What it violates Name of the result
Conceptual Consistency of the requirements, such as an inconsistent set of intentions Mistake
Material Correctness of a level relative to the level above, such as an algorithm that does not meet the specification Failure
Performable Physical limits, through faulty hardware Operational malfunction

At the source-code level, these errors are called slips.[1] A conceptual slip breaks the syntax rules of the language. A material slip breaks its semantic rules, for example using a variable that was never given a value.

Luciano Floridi, Fresco, and Primiero (2015) argue that software can misfunction but cannot dysfunction.[1] A dysfunction is one copy behaving differently from other copies of the same type, which applies to physical tokens. Software misfunctions through poor design, doing its job but with unwanted side effects.

More recent work adds users to the picture. Alessandro Buda and Primiero (2024) argue that laws, user needs, and the choices of developers and sellers also shape what counts as correct, and they propose a model that attaches user levels to each level of abstraction.[1]

What kind of discipline is computer science?

Computer science became an academic discipline separate from mathematics and physics between the 1960s and the 1970s.[1] Since then there has been debate over whether it is mostly mathematics, mostly engineering, or mostly a science.

Even its subject matter is disputed. Newell, Alan Perlis, and Simon (1967) argued that computer science is the study of computers, and in answering objections widened this to computers and the phenomena around them, including algorithms.[3] Knuth (1974) defined it as "the study of algorithms".[3]

View Core idea Supporters
Mathematics Programs are mathematical objects, and knowledge of them comes from deductive proof. Hoare, Dijkstra
Engineering Computer science studies what can exist and builds tools; it has no laws of its own. Juris Hartmanis ("engineering of mathematics", 1981), Fred Brooks (1996)
Science Computer science uses both deduction and experiment to study computing systems. Newell and Simon, Peter Denning, Walter Tichy, Colburn

The mathematical view

The study of computation as a mathematical idea began in logic, with Hilbert's Entscheidungsproblem: is there a mechanical procedure for deciding whether any sentence of logic is provable?[1] Answering it required an exact model of a mechanical method. Supporters of the mathematical view treat programs as physical realizations of such models and reason about them by proof.

The engineering view

In the late 1970s, as computers spread into everyday life, many researchers shifted from proving programs correct to managing complexity and measuring reliability.[1] For large programs that interact with users and other systems, a full proof is mostly not feasible. Brooks argued that "the scientist builds in order to study; the engineer studies in order to build", and that computer scientists are toolmakers.[3]

The scientific view

In their 1975 Turing Award lecture, Newell and Simon argued:[1]

Computer science is an empirical discipline. We would have called it an experimental science, but like astronomy, economics, and geology, some of its unique forms of observation and experience do not fit a narrow stereotype of the experimental method.

The main argument for the scientific view is that practice combines proof and experiment.[1] Testing cannot rule out faults, so for safety-critical systems, such as controllers of airplanes and nuclear plants, correctness is checked by a mix of formal methods and testing. Computer science thus uses both deductive and inductive reasoning, as sciences do.

Open questions include what kind of science computing is, what experiments in computing are, whether computing has laws, and how computer science relates to software engineering.[1]

Several neighboring fields overlap with the philosophy of computer science.

  • Computer ethics deals with the moral side of computing. James Moor (1985) defined it as "the analysis of the nature and social impact of computer technology and the corresponding formulation and justification of policies for the ethical use of such technology".[4] He argued that its typical problem is a "policy vacuum", where new computing abilities leave no clear rule for how to act.[4]
  • The philosophy of artificial intelligence asks what AI is and whether it should be built. Rapaport's 2023 textbook treats these questions alongside whether people should trust decisions made by computers.[5]
  • The Church-Turing thesis and its challengers are also covered in introductions to the field.[5]

References

  1. The Philosophy of Computer Science, Nicola Angius, Giuseppe Primiero, and Raymond Turner, Stanford Encyclopedia of Philosophy, 2025.
  2. Notes on Structured Programming (EWD 249), Edsger W. Dijkstra, E.W. Dijkstra Archive, 1970.
  3. What Is Computer Science?, William J. Rapaport, APA Newsletter on Philosophy and Computers, 2017.
  4. What Is Computer Ethics?, James H. Moor, Metaphilosophy, 1985.
  5. Philosophy of Computer Science: An Introduction to the Issues and the Literature, William J. Rapaport, Wiley, 2023.

Figure