# Talk:WikiJournal Preprints/Dialectic algorithm

Latest comment: 5 years ago by Sophivorus in topic Editorial comments

Open access • Publication charge free • Public peer review

<meta name='citation_doi' value=>

## Article information

Author: Felipe Schenone

See author information ▼

This article has been declined for publication by the WikiJournal Preprints.

It is archived here as a record. Discussion can be viewed below.

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

This page aims to merely describe 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

A debate tree is a tree structure in which every node is an argument. The root node is called the main argument and the rest are called objections. Each objection is aimed at either the main argument, or another objection.

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

SUSTAINED
Without sustained objections
REFUTED
With sustained objections

Since objections are also arguments, the algorithm will run recursively until the end of the debate tree (the leaves). 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.

## Example

Below is an example of a small debate tree, with sustained arguments colored green and refuted arguments colored red. The structure of this debate tree is the same as the structure of the graph in this article.

•   Argument Causing unnecessary suffering to 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.

## Pseudocode

The essence of the debate 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
```

## Loops

Consider the following exchange:

•   Argument If God existed, then evil wouldn't exist. But evil exists. Therefore, God doesn't exist.
•   Objection Your argument is invalid because you're tainted by the Devil.
•   Objection That's an ad hominem fallacy.
•   Objection Your argument is invalid because you're tainted by the Devil.
•   Objection That's an ad hominem fallacy.
•   Objection Your argument is invalid because you're tainted by the Devil.
• ...

If each argument is only a copy-paste of the previous one, then this is only a human problem. However, if each argument is a "reuse" of the previous one so that objections are inherited, then this leads to an infinite loop in the debate algorithm.

The possibility of such loops increases sharply when extensions are incorporated, since reusing a single premise is more likely than reusing an entire argument.

## Extensions

### Inner structure

In the basic debate 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 such as propositional logic, and extend the debate algorithm into the new structure.

For example, an extension into the propositional structure of the arguments may work on the following definitions:

SOUND
An argument (or objection) is SOUND when it is VALID and all its premises are TRUE
VALID
An argument (or objection) is VALID when it has no SOUND objections (to its validity)
TRUE
A premise is TRUE when it has no SOUND objections

Or in pseudocode:

```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
}
```

The algorithm can be further extended to calculate the truth value of each premise out of its propositional structure in the standard ways, and perhaps even out of its first-order structure.

### Outer structure

This section describes how to apply methods akin to the debate algorithm to draw conclusions regarding a larger debate of which an argument may only be a part of.

There are two kinds of debates: debates about facts and debates about conventions. For example, Does God exist? is a debate about a fact, while Should abortion be legal? is a debate about a convention. The proper way of drawing conclusions differs for each kind of debate.

#### Debates about facts

When debating facts, infer the option with at least one sustained argument for and none against, if every other option has no sustained arguments for.

Needless to say, the current results of the debates aren't necessarily right or wrong. It's impossible to know, for certain anyway, if the current result of a debate is the absolute truth. However, if one option has few arguments, all refuted with several objections, and another option has many arguments with few objections refuted in various ways, then there's good reason to believe the second option. If the state of the debate is clear enough, one may, and should, infer the conclusion, but there will always be a leap of faith somewhere, even if tiny. Absolute certainty can never be achieved. However, when all arguments and all objections have been considered, the result will be our best guess as to the truth of the issue at hand. This is the most humans can aim for, and we should aim for it.

Some key logical consequences are:

• The number of arguments doesn't matter ― There may be just one argument in favor and hundreds against, but if the argument in favor is sustained and the hundreds are refuted, the answer will be what the argument in favor supports. Wikidebates are not a popularity contest.
• Not all arguments for an option need to be sustained in order for that option to prevail ― Just one is required (and none on the other options). In fact, if an issue is truly controversial, it should even be expected that all options will have some refuted arguments.

In pseudocode:

```function getBalance( option ) {
balance = 0
arguments = getArguments( option )
for argument in arguments {
balance = balance + getWeight( argument )
}
return balance
}

function getWinner( debate ) {
if ( getBalance( option1 ) > 0 and getBalance( option2 ) < 1 ) {
return option1
}
if ( getBalance( option1 ) < 1 and getBalance( option2 ) > 0 ) {
return option2
}
// And similarly combining any extra option
// Else return nothing
}
```

#### Debates about conventions

Debating about conventions (such as laws) is different from debating about facts. When debating about facts, all arguments on the false side must ultimately be wrong, otherwise reality would be contradictory. By contrast, when debating about conventions, there may be sound arguments on all sides, and deciding becomes a matter of weighting the sound arguments on each side.

But what is the "weight" of an argument and how do we measure it? The weight of an argument is its importance and relevance to the debate. And how do we measure weight? There's no agreed method (so far). Each reader must use his or her best judgment to weight the arguments.

The balance of an option is the combined weight of the sustained arguments for it, minus the combined weight of the sustained arguments against it.

In debates about conventions, infer the option with the best balance.

This can be put in pseudocode thus:

```function getBalance( option ) {
balance = 0
arguments = getArguments( option )
for argument in arguments {
balance = balance + getWeight( argument )
}
return balance
}

function getWinner( debate ) {
if ( getBalance( option1 ) > getBalance( option2 ) ) {
return option1
}
if ( getBalance( option1 ) < getBalance( option2 ) ) {
return option2
}
// Else no winner
}
```

## Implementations

The first implementation of the debate algorithm was Formal Forum, a debate site that featured a propositional extension of the algorithm and encouraged premise reuse. Loops where avoided by automatically checking for them before accepting a submission. However, the creator felt the issue would only get worse over time and with further formalization, and decided to close the forum.

Currently, the debate algorithm is available in the Wikidebate project. By clicking on the "Calculate status" button on any wikidebate (live example), the algorithm is run for every argument in the debate and arguments are colored according to their status. There's a wikidebate about the usefulness of the algorithm for the project and the wikidebate guidelines include some instructions on how to draw conclusions out of debates using methods akin to the debate algorithm. However, partly due to limitations in wiki software, every extra step in the formalization makes it harder for new users, so for now wikidebates incorporate only the most basic form of the algorithm (no extensions).

## Plagiarism check

Pass. WMF copyvio tool using TurnItIn. Example was used in other Wikiversity page, but indicated as illustrative case, so not regarded as plagiarism. T.Shafee(Evo﹠Evo)talk 11:13, 9 January 2018 (UTC)

## First peer review

Review by Justin Anthony Knapp ,

### Algorithm seems off to me

See Was 9/11 an inside job? [At the moment], the calculated answer is "Maybe". There are two Fors and three Againsts. One of the Fors is refuted and all three Againsts are sustained. Even though there is a single For which is sustained, it seems like the weight is clearly Against. (Keep in mind, of course, that this algorithm does not actually judge the merits of the arguments.) If there are 900 Againsts, 899 refuted Fors, and a single For that is sustained, that should not be a "Maybe" but a "No". Does anyone else think that the algorithm could use a tweak? —Justin (koavf)TCM☯ 05:00, 25 October 2016 (UTC)

Response

@Koavf: I think that what I wrote at Dialectic algorithm#Debating conventions is related to this issue, though 9/11 isn't a debate about conventions. I'm thinking about three main approaches to solving the problem of measuring the "merits" or "weight" of the arguments:

• A voting system: each user may vote once for each argument, and the number of votes determines the weight.
• A wiki system: any user may set the weight of any argument, and if other users don't find it reasonable, they may revert the edit and discuss it in the talk page.
• An algorithmic system: the weight could depend on something like the number of objections, or the number of nested objections.

Each has its pros and cons I think, and I don't see very clearly which is the right approach yet, or if there's a fourth that may be better. What I'm clear about is that it shouldn't matter much which is more practical, but rather which is the correct logical approach. If I had to choose now, I'd lean towards the voting system. What do you think? --Felipe (discusscontribs) 20:24, 27 October 2016 (UTC)

Review by Justin Anthony Knapp ,

The nice thing is that we can choose all of them! Maybe adopt one method on one debate and another on another. Or implement all three simultaneously and have the option to view all three and see which one wins in each approach... —Justin (koavf)TCM☯ 20:35, 27 October 2016 (UTC)

Response

@Koavf: I'm thinking of something like the image above. The number on the weight icon obviously represents the weight of the argument. Regarding your idea of having multiple ways of calculating the weight, yes it can be done, but we should consider several things first.

• Even if we implement more than one system, we should still choose one to be the default system (the one users will see until they select another). Which one will it be?
• I think that my current idea of how the algorithmic system could work is totally useless. The nice thing about the algorithmic system is that it doesn't require any user input. But weighting the arguments by the number of objections or nested objections has very little to do, I think, with the probable weight of an argument. Unless a better algorithmic system is proposed, I think that we should leave it aside.
• Implementing the voting system will probably require me to develop a custom extension that adds a table to the database to track the votes. I would be glad to develop this extension, but deploying it will be slow. Also, each argument will need a unique id for the software to be able to find the associated votes. So each argument will need an id specified in the wiki syntax `{{Argument for|the-argument-id|Your argument goes here.}}` which makes the system a bit more complicated and less robust. Another downside of this system is that new arguments will start with zero votes, so even if the argument is an important one, it may take a long time for the votes to reflect that.
• Deploying the wiki system, on the other hand, would be quite easy, doesn't require a custom extension, doesn't have the id problem, and may avoid the problem of new arguments not having a fair weight. The syntax for adding a weight with the wiki system would be simply `{{Argument for|12|Your argument goes here.}}` and if no weight is specified, we assume weight "1". Also, I think that the wiki system is less likely to turn debates into a popularity contest than the voting system, and it's also consistent with the general wiki framework on which Wikidebates run. The only problem I see with this system is that users may be unable to agree on what the proper weight of each argument should be. The voting system doesn't have this problem. But I guess only experience can decide that, and guidelines may go a long way in preventing biases.

So for the above reasons, I'm thinking about implementing the wiki system, seeing how it goes, and only implement the voting system if the wiki system proves ineffective, and the algorithmic system if a better algorithm is proposed. Any thoughts? --Felipe (discusscontribs) 15:58, 28 October 2016 (UTC)

Review by Justin Anthony Knapp ,

I don't want to seem dismissive or ignore you but I don't have any better feedback than that. Do it to it! —Justin (koavf)TCM☯ 19:38, 28 October 2016 (UTC)

Response

@Koavf: Not at all! I've given this a lot of thought (consider that I started this project 5 years ago, on its own domain) and I'm very glad you agree. I'll implement it soon, cheers! :) --Felipe (discusscontribs) 19:49, 28 October 2016 (UTC)

### New version

Response

@Koavf: Hi! You will probably notice that I did important changes to the algorithm, that don't reflect at all what I proposed earlier. The reason is that while I was trying to implement my earlier proposal, I became increasingly dissatisfied by how complicated and arbitrary it was all becoming. And then I had a revelation: to debate conventions and cope with other difficulties, the algorithm shouldn't become more complex, but simpler! It was a beautiful moment, really, and strangely enough it happened under a tree. XD By removing the part of the algorithm that computes the answer to the main question, we lose something, surely, but we gain much more in return:

• The algorithm is now much simpler to understand, which may draw new users.
• The algorithm is now much more flexible:
• It can be used for debating truth and conventions alike.
• Several debates can now be included in the same page without conflicting with each other. For example, the debate about God could now have a pre-debate about the meaning of the word God, and other sub-debates discussing particular topics related to God.
• The debate pages can now have all kinds of titles, not just yes-no questions. For example, the title of the pages could be statements, or questions with many possible answers, and sub-debates for each answer.
• Debates can now also happen on talk pages or other pages outside of the Wikidebate project.
• The final inference is now left to the user. The guidelines now include some advice on how to best infer conclusions. Also, on the psychological level, drawing the conclusion yourself rather than having the computer draw it for you can be more persuasive.
• At the implementation level, the algorithm is now so much more beautiful that it's clear to me that it was "meant" to be like this (see the Pseudocode section). This may one day draw other developers to implement the algorithm for other discussion systems. The simplification of the algorithm also makes it much easier to adapt for other systems, as all you need now is a nested discussion system, something fairly common.
• Graphs are also simpler to understand and generate.

I hope you like the change as much as I do, cheers! --Felipe (discusscontribs) 03:09, 3 November 2016 (UTC)

Review by Justin Anthony Knapp ,

Thanks for your hard work. I went to Should we go vegan? and I see that that the big yellow `MAYBE` is gone now. Is this what you intended with deleting the outcomes? —Justin (koavf)TCM☯ 03:12, 3 November 2016 (UTC)

Response

@Koavf: Yes! For the reasons explained above, I think that not drawing the final conclusion automatically is the solution to many problems and the door to many advantages. I hope it wasn't that particular thing that interested you about the project, and that you still see value on it, with the new version. Cheers! --Felipe (discusscontribs) 03:19, 3 November 2016 (UTC)

Review by Justin Anthony Knapp ,

Not at all--in fact, the conclusion was the part that was giving me the most grief! Thanks again, Felipe. —Justin (koavf)TCM☯ 03:20, 3 November 2016 (UTC)

Response

@Koavf: I'm glad to hear that! Yes, the conclusion was always a pain for me too hah. --Felipe (discusscontribs) 03:21, 3 November 2016 (UTC)

Comments by Marshall Sumter ,

Content suggestions:

The two-word term w:Recursive algorithm takes the reader to w:Recursion (computer science) to find out what it is. Perhaps a simple definitive example, or carefully worded definition, should be included in your article at this beginning point. --Marshallsumter (discusscontribs) 01:22, 12 August 2017 (UTC)

Done --Felipe (discusscontribs) 21:47, 13 August 2017 (UTC)
I like it! --Marshallsumter (discusscontribs) 18:56, 14 August 2017 (UTC)

In the wikidebate Does God exist? is "Absence of evidence is not evidence of absence. (2 objections, 0 sustained, 4 nested)". What is "nested" referring to? --Marshallsumter (discusscontribs) 01:54, 12 August 2017 (UTC)

The word "nested" refers to the total number of "descendants" of the argument. Do you think that "descendants", or maybe some other term, would be clearer? --Felipe (discusscontribs) 21:47, 13 August 2017 (UTC)
Perhaps just a clarifying note would work! The phrase: "descendants" of the argument helps! --Marshallsumter (discusscontribs) 18:56, 14 August 2017 (UTC)
Done I changed the term for "descendants". --Felipe (discusscontribs) 08:37, 26 August 2017 (UTC)

In an earlier version of the wikidebate Does God exist?, the reader could run the dialectic algorithm over the arguments to view a conclusion. Now there are five sustained arguments for existence and two sustained against. What does this mean? --Marshallsumter (discusscontribs) 02:34, 12 August 2017 (UTC)

Response

Before, the algorithm had to be run manually, but now it's run automatically from MediaWiki:Common.js on all pages with wikidebates. Also, before, the general conclusion of the wikidebates (YES, NO or MAYBE) was computed using the rules outlined at Wikidebate/Guidelines#Drawing conclusions, but now that is left to the reader. This decision was due to several reasons (explained above), the main ones being that the rules only made sense for debates about truth, not debates about conventions, and that in order to apply the rules, it's necessary to somehow tell the software which arguments are "for" and which arguments are "against" which complicates the syntax and leads to a steeper learning curve. That being said, I'm very keen to hear your thoughts on these issues! --Felipe (discusscontribs) 21:47, 13 August 2017 (UTC)

Comments by Marshall Sumter ,

This may also be of interest to our readers! Perhaps it would be helpful in a form similar to what you've written here. What do you think? --Marshallsumter (discusscontribs) 18:56, 14 August 2017 (UTC)

Being able to apply the dialectic algorithm to conventions is great! Perhaps you could include an example? --Marshallsumter (discusscontribs) 00:51, 15 August 2017 (UTC)
Response

Hey! Thanks again for your review and all the excellent advice, and sorry I wasn't able to reply to your comments sooner. I've been thinking about your suggestion and I'm kind of unsure wether I should include these issues in the article, basically because the article is currently focused solely on the dialectic algorithm, and these issues, though related, are not strictly speaking about the algorithm. I could write about these issues in a section titled "Uses" or "Applications", but I'm having trouble thinking about the right approach, so I haven't written it yet. --Felipe (discusscontribs) 09:34, 16 September 2017 (UTC)

It would be a good idea to include at least one wikidebate in your article to example the inner workings of how arguments are successfully objected to. This could include an edit mode to show what's going on. --Marshallsumter (discusscontribs) 02:34, 12 August 2017 (UTC)

Response

Done Great idea! I may improve or even change the example in due time, but I think the one I just added is decent enough. Do you think I should add more arguments? Even a mini wikidebate, with a main question and all? --Felipe (discusscontribs) 21:47, 13 August 2017 (UTC)

Comments by Marshall Sumter ,

Adding "a mini wikidebate, with a main question and all" is a great idea! There should be sufficient space! --Marshallsumter (discusscontribs) 18:56, 14 August 2017 (UTC)

Response

Again, I've been thinking about this and I'm not sure I want to get into it because it kinda goes beyond the algorithm and may get me into lots of stuff that broaden and complicate the article more than I'm willing to deal with right now. If I find the inspiration though, I may expand the section with the mini wikidebate. Cheers! --Felipe (discusscontribs) 09:34, 16 September 2017 (UTC)

Would the following reference[1] and some of its justifications for algorithms such as this be helpful to readers of WJS in placing your article in context? Perhaps, in your words would be better. Are there some you might like to include? --Marshallsumter (discusscontribs) 18:56, 14 August 2017 (UTC)

Response

Awesome reference! I started reading it but didn't finish yet. Sorry if I'm a bit slow but I usually work in short, spaced and intense bursts. --Felipe (discusscontribs) 09:34, 16 September 2017 (UTC)

In Should we use the dialectic algorithm on wikidebates?: "The "refuted" and "sustained" tags engages visitors to read more about an argument, especially when they disagree about its current status." to "The "refuted" and "sustained" tags engage visitors to read more about an argument, especially when they disagree about its current status." --Marshallsumter (discusscontribs) 01:42, 12 August 2017 (UTC)

Response

Done --Felipe (discusscontribs) 21:47, 13 August 2017 (UTC)

References:

1. Iyad Rahwan, Bita Banihashemi, Chris Reed, Douglas Walton, and Sherief Abdallah (December 2011). "Representing and classifying arguments on the semantic web". The Knowledge Engineering Review 26 (4): 487-511. Retrieved 2017-08-11.

Comments by Thomas Shafee ,

Whilst the second peer review is being organised, I wanted to make a couple of editorial comments:

1. The work would benefit from a short introduction discussing the need for such a diagram, and existing/related work. E.g. are there any relevant concepts from the following that would help readers put the work in context:
2. It could also benefit from a couple of sentences on the benefits and limitations of the diagram.
• e.g. a short summary of some of the key points raised here.

03:13, 8 November 2017 (UTC)

After some initial experimenting, I decided to just narrow the scope of the article and link to the relevant resources for those who want a larger scope. I favored this solution over adding new sections basically because I really don't like content duplication (see for example this idea and this extension I'm responsible for). Content duplication is inefficient and I don't want to contribute to the information overload by repeating content found elsewhere. I hope you like this solution as much as I do. Kind regards! --Felipe (discusscontribs) 02:52, 24 January 2018 (UTC)

## Second peer review

Review by anonymous peer reviewer ,

Reject the article. The "dialectic algorithm" has not been published elsewhere and its author has no reputation in the computational models of argument community. And the article provides no references to any prior related work, of which there is a large body of published work.

The paper is on its surface not sufficient to be even considered serious enough to bother to review.

Response

The dialectic algorithm hasn't been published elsewhere because it's original research, and the WikiJournal of Science allows original research. Regarding my lack of reputation, that's an ad hominem argument: judge the content, not the author. As to the lack of references, I'm aware of some related work, but this algorithm sprang out completely out of my own mind after many years of thought, so I see no need to cite anyone. If lack of references or reputation were good reasons for rejecting an article, this article should have been rejected! Kind regards, --Felipe (discusscontribs) 01:42, 9 November 2017 (UTC)

## Third peer review

Review by anonymous peer reviewer ,

The example as it stands is unsatisfactory, not because of the views it implies but because of falings in the logic:

“If God existed, then evil would not exist, as God is conceived as all-good, all-knowing, and all-powerful. But evil clearly exists. Therefore God does not exist.”

The weakness arises from the wording “...God is conceived as...”. It allows refutation by statements such as “The conception that God is all-powerful is wrong – he is not”. The conclusion that God does not exist is then not sustained. One way to get round the problem would be to reword the example as follows:

“If an all-good, all-knowing, and all-powerful God existed, then evil would not exist. But evil clearly exists. Therefore such a God does not exist.”

Unfortunately, though, this would make the example so simplistic as to be of little interest.

An alternative would be to keep the original example but then to discuss how it is only sustained if the three conceived characteristics of God are themselves sustained.

Response

I'll try to provide a better example in the next few days. The current one was copy-pasted from the wikidebate about God's existence, but I agree it can be improved. Thanks! --Felipe (discusscontribs) 01:43, 9 November 2017 (UTC)

Response

I just changed the example for a (hopefully) better one, in which the meaning of the terms is not controversial. --Felipe (discusscontribs) 22:17, 17 December 2017 (UTC)