From MediaWiki.org
Jump to: navigation, search

This page was moved from MetaWiki.
It probably requires cleanup – please feel free to help out. In addition, some links on the page may be red; respective pages might be found at Meta. Remove this template once cleanup is complete.

MediaWiki extensions manual
Crystal Clear action run.png

Release status: experimental

Implementation Tag
Description Specific vernacular text conversion for Formal Logic
Author(s) w:User:Alfakim
Latest version 0.93a (25-09-2006)
MediaWiki 1.6
License No license specified
Download Extension:WikiLogic/Syntax

Translate the WikiLogic extension if it is available at translatewiki.net

Check usage and version matrix; code metrics
NOTE!: This is a development version. It has never been tested.

WikiLogic (previously, EasyLogic) is an extension for MediaWiki that adds the ability to informally write Formal Logic between <logic></logic> tags. By informally, what is meant is that a user could write, for instance:

"<logic>p AND s THEREFORE q OR ExFx</logic>", or maybe
"<logic>a&b SO q V EXISTENTIALxGx</logic>"

...and the extension would parse all the logical words into the correct characters. Non-logical words remain untouched, and certain short-cut phrases (e.g. "E" for an existential quantifier) are also parsed.

These logical symbols cannot usually be written using a keyboard, and at least not without great pains, so the idea of the extension is to make writing logic easier. In this sense it is an informal, logic-based version of LaTeX.

There are internal options to output images rather than text, and external, parameter-controlled options to output a LaTeX or template string. The LaTeX does not yet work.


CAPITALS are converted to logic, lowercase are left as they are (constants or variables). Furthermore, individual characters can be escaped with "\", e.g. "\E" produces a literal "E" rather than the existential quantifier.

Logical symbols supported[edit]

Below is a list of the symbols supported by the extension. If you are using images, then each requires an image on your server stored at a directory (e.g. "/logic/") designated in the code for the extension.

Currently there are 22 logical symbols that this extension can convert text into. They are the main symbols of Propositional Logic, Quantifier Logic and Modal Logic and Set Theory logic.

Image Symbol name Phrases parsed by extension into this symbol
EasyLogictherefore.png Therefore "therefore"
EasyLogicturnstile1.png Syntactic turnstile "turnstile1"
EasyLogicturnstile2.png Semantic turnstile "semanticturnstile"
EasyLogicnotequal.png Not equal "notequal"
EasyLogicand.png And "and"
EasyLogicor.png Or "or"
EasyLogiccond.png Material conditional "cond"
EasyLogicbicond.png Biconditional "bicond"
EasyLogicuniversal.png Universal quantifier "universal"
EasyLogicexistential.png Existential quantifier "existential"
EasyLogicunion.png Union _|"
EasyLogicintersect.png Intersect ^|"
EasyLogicelement.png Element of "element"
Not an element of "notelement"
EasyLogicsubset.png Subset "subset"
Not subset "notsubset"
EasyLogicpsubset.png Proper subset "propersubset"
Not proper subset "notpropersubset"
EasyLogicempty.png Empty set "0"
Necessity "necessity"
Possibility "possibly"
Identity "identical"


Arguments can be specified when calling the extension:

<logic argument="value" argument2="value2">xyz</logic>

Argument "output" can be set to "latex" or "template" to output a LaTeX or wikitext template string instead.

The argument "width" can be specified to determine the width of images if in image mode. The width is in CSS units, e.g. "1em", "20px", "1cm", etc.


The extension is stored in a file called WikiLogic.php, the code for which is stored here. The file should be placed in your extensions folder.

To activate the extension, include it from your LocalSettings.php with:


...and change any internal variables you need to, to alter its functionality.


This extension was written by w:User:Alfakim to make it easier and less daunting for philosophy students to write Formal logic on a Wiki.

Currently the extension is quite crude, and a major improvement to it would be to combine it with the LaTeX engine so that it generates a .PNG file all by itself.

However, in the meantime, the extension can be easily improved by adding more symbols that it can convert.