# DebateTree algorithm

(Redirected from Dialectic algorithm)
Graphic representation of a small debate tree, with sustained arguments painted green and refuted arguments painted red.

The DebateTree algorithm (formerly dialectic algorithm) is a recursive algorithm for computing the status (SUSTAINED or REFUTED) of any argument out of the structure of its debate tree. The algorithm captures the intuitive idea that an argument should be considered refuted when it has unrefuted objections, and sustained otherwise.

This article is aimed at merely describing the algorithm. To read about its usefulness, see the wikidebate here. To learn about the broader context of the algorithm, see the resources here.

## Algorithm

Animation showing the DebateTree algorithm as the debate grows. Notice how the leaves of the tree are always green.

Given a debate tree, the DebateTree algorithm labels each argument as either SUSTAINED or REFUTED based on the following definitions:

SUSTAINED
Without sustained objections
REFUTED
With sustained objections

Considering that objections are also arguments, the algorithm will run recursively until the end of the debate (the leaves of the debate tree). Arguments at the end have no sustained objections (indeed, they have no objections at all) so they are labeled SUSTAINED, and the algorithm is then able to solve the status of all the other arguments.

## Pseudocode

The essence of the DebateTree algorithm can be summed up in a simple, beautiful recursive function:

```function getStatus( argument )
let objections = getObjections( argument )
for each objection in objections do
if getStatus( objection ) === SUSTAINED then
return REFUTED
return SUSTAINED
```

The function calls itself recursively until it reaches the leaves of the debate tree. The leaves have no objections, so the algorithm returns SUSTAINED for each leaf and from there on solves the status for every other argument in the tree.

An alternative, boolean formulation may be:

```function isSustained( argument )
let objections = getObjections( argument )
for each objection in objections do
if isSustained( objection ) then
return FALSE
return TRUE
```

## Example

Below is an example of a small debate tree, with refuted arguments stroked. The structure of this debate tree is the same as the structure of the graph in this article.

•   Argument Causing unnecessary suffering on animals is morally wrong. Eating or otherwise exploiting animals is unnecessary and causes much suffering. Therefore, eating or otherwise exploiting animals is morally wrong and should be abolished.
•   Objection Non-human animals have no feelings and suffer no pain.
•   Objection Non-human animals behave very similar to us humans under circumstances that would cause us pain: they scream (or produce other loud noises), shake, contort, run, try to avoid the source of pain, etc.
•   Objection Non-human animals, especially mammals and birds, have a nervous system very similar to our own.
•   Objection Animals in the wild suffer more, as starvation and predation is a constant threat to them. For a natural equilibrium, all animal species living in the wild live at the brink of starvation, as an excess of food leads to their numbers increasing, then collapsing.
•   Objection Animals in factory farms suffer guaranteed predation at a fraction of their natural life span. They don't lack food, true, but they are systematically mutilated, exploited, denied of basic freedom of movement, electrocuted, kicked, and many, many, many other atrocities. In traditional farms, animals are denied freedom of movement and reproduction, and also suffer guaranteed predation at a fraction of their natural life span.

## Use

The DebateTree algorithm is being used optionally on the Wikidebate project. By clicking on the "Run DebateTree algorithm" button on any wikidebate, the algorithm is run on every argument of the debate, and tags with the calculated status are appended to each.

One of these wikidebates is about wether on not the algorithm is useful on wikidebates. The current debate is transcluded here:

## Extensions

In the basic DebateTree algorithm, the inner structure of the arguments is ignored.

It's possible however to give the arguments some structure according to well known logical theories, and extend the DebateTree algorithm into the new structure.

For example, using the terms "sound", "valid" and "true" in non-standard ways:

```function isSound( argument ) {
if not isValid( argument ) then
return FALSE

let premises = getPremises( argument )
foreach premise in premises do
if not isTrue( premise ) then
return FALSE

return TRUE
}

function isValid( argument ) {
let objections = getObjections( argument )
foreach objection in objections do
if isSound( objection ) then
return FALSE
return TRUE
}

function isTrue( premise ) {
let objections = getObjections( premise )
foreach objection in objections do
if isSound( objection ) then
return FALSE
return TRUE
}
```

Further, the algorithm can be extended to calculate the truth value of each premise out of its propositional structure, first-order structure, etc. in the standard ways.

Also, in the broader context of a wikidebate, the status of an entire option or debate can be calculated with similar methods.

However, at least in the Wikidebate project, every extra step in the formalization makes it harder for new users, so for now the DebateTree algorithm only incorporates the most basic form of the algorithm.