Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Well-formed formula
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Syntactically correct logical formula}} {{broader|Mathematical formula}} {{Formal languages}} In [[mathematical logic]], [[propositional logic]] and [[predicate logic]], a '''well-formed formula''', abbreviated '''WFF''' or '''wff''', often simply '''formula''', is a finite [[sequence]] of [[symbol (formal)|symbols]] from a given [[alphabet (computer science)|alphabet]] that is part of a [[formal language]].<ref>Formulas are a standard topic in introductory logic, and are covered by all introductory textbooks, including Enderton (2001), Gamut (1990), and Kleene (1967)</ref> The abbreviation '''wff''' is pronounced "woof", or sometimes "wiff", "weff", or "whiff".{{refn| * "woof"<ref>{{Cite book |last=Gensler |first=Harry |url=https://books.google.com/books?id=YjuCAgAAQBAJ |title=Introduction to Logic |date=2002-09-11 |publisher=Routledge |isbn=978-1-134-58880-0 |pages=35 |language=en}}</ref><ref>{{Cite book |last1=Hall |first1=Cordelia |url=https://books.google.com/books?id=QZgKCAAAQBAJ |title=Discrete Mathematics Using a Computer |last2=O'Donnell |first2=John |date=2013-04-17 |publisher=Springer Science & Business Media |isbn=978-1-4471-3657-6 |pages=44 |language=en}}</ref><ref>{{Cite book |last=Agler |first=David W. |url=https://books.google.com/books?id=nhQHlwV5NSIC |title=Symbolic Logic: Syntax, Semantics, and Proof |date=2013 |publisher=Rowman & Littlefield |isbn=978-1-4422-1742-3 |pages=41 |language=en}}</ref><ref>{{Cite book |last=Simpson |first=R. L. |url=https://books.google.com/books?id=w2doAwAAQBAJ |title=Essentials of Symbolic Logic - Third Edition |date=2008-03-17 |publisher=Broadview Press |isbn=978-1-77048-495-5 |pages=14 |language=en}}</ref> * "wiff"<ref>{{Cite book |last=Laderoute |first=Karl |title=A Pocket Guide to Formal Logic |date=2022-10-24 |publisher=Broadview Press |isbn=978-1-77048-868-7 |pages=59 |language=en}}</ref><ref>{{Cite book |last1=Maurer |first1=Stephen B. |url=https://books.google.com/books?id=SWds5v8UUc4C |title=Discrete Algorithmic Mathematics, Third Edition |last2=Ralston |first2=Anthony |date=2005-01-21 |publisher=CRC Press |isbn=978-1-56881-166-6 |pages=625 |language=en}}</ref><ref>{{Cite book |last=Martin |first=Robert M. |url=https://books.google.com/books?id=0sOpx5-90d4C |title=The Philosopher's Dictionary - Third Edition |date=2002-05-06 |publisher=Broadview Press |isbn=978-1-77048-215-9 |pages=323 |language=en}}</ref> * "weff"<ref>{{Cite book |last=Date |first=Christopher |url=https://books.google.com/books?id=HMIay77Pkv0C |title=The Relational Database Dictionary, Extended Edition |date=2008-10-14 |publisher=Apress |isbn=978-1-4302-1042-9 |pages=211 |language=en}}</ref><ref>{{Cite book |last=Date |first=C. J. |url=https://books.google.com/books?id=TB5UCwAAQBAJ |title=The New Relational Database Dictionary: Terms, Concepts, and Examples |date=2015-12-21 |publisher="O'Reilly Media, Inc." |isbn=978-1-4919-5171-2 |pages=241 |language=en}}</ref> * "whiff"<ref>{{Cite book |last=Simpson |first=R. L. |url=https://books.google.com/books?id=exeO4UNCJ8cC |title=Essentials of Symbolic Logic |date=1998-12-10 |publisher=Broadview Press |isbn=978-1-55111-250-3 |pages=12 |language=en}}</ref> All sources supported "woof". The sources cited for "wiff", "weff", and "whiff" gave these pronunciations as alternatives to "woof". The Gensler source gives "wood" and "woofer" as examples of how to pronounce the vowel in "woof".}} A formal language can be identified with the set of formulas in the language. A formula is a [[syntax (logic)|syntactic]] object that can be given a semantic [[Formal semantics (logic)|meaning]] by means of an [[interpretation (logic)|interpretation]]. Two key uses of formulas are in propositional logic and predicate logic. ==Introduction== A key use of formulas is in [[propositional logic]] and [[Higher-order logic|predicate logic]] such as [[first-order logic]]. In those contexts, a formula is a string of symbols φ for which it makes sense to ask "is φ true?", once any [[free variable]]s in φ have been instantiated. In formal logic, [[Mathematical proof|proof]]s can be represented by sequences of formulas with certain properties, and the final formula in the sequence is what is proven. Although the term "formula" may be used for written marks (for instance, on a piece of paper or chalkboard), it is more precisely understood as the sequence of symbols being expressed, with the marks being a [[type-token distinction|token]] instance of formula. This distinction between the vague notion of "property" and the inductively-defined notion of well-formed formula has roots in Weyl's 1910 paper "Uber die Definitionen der mathematischen Grundbegriffe".<ref>W. Dean, S. Walsh, The Prehistory of the Subsystems of Second-order Arithmetic (2016), p.6</ref> Thus the same formula may be written more than once, and a formula might in principle be so long that it cannot be written at all within the physical universe. Formulas themselves are syntactic objects. They are given meanings by interpretations. For example, in a propositional formula, each propositional variable may be interpreted as a concrete proposition, so that the overall formula expresses a relationship between these propositions. A formula need not be interpreted, however, to be considered solely as a formula. ==Propositional calculus== {{Main|Propositional calculus}} The formulas of [[propositional calculus]], also called [[propositional formula]]s,<ref>First-order logic and automated theorem proving, Melvin Fitting, Springer, 1996 [https://books.google.com/books?id=T8OMqvXvWWQC&dq=%22propositional+formula%22&pg=PA11]</ref> are expressions such as <math>(A \land (B \lor C))</math>. Their definition begins with the arbitrary choice of a set ''V'' of [[propositional variable]]s. The alphabet consists of the letters in ''V'' along with the symbols for the [[logical connective|propositional connective]]s and parentheses "(" and ")", all of which are assumed to not be in ''V''. The formulas will be certain expressions (that is, strings of symbols) over this alphabet. The formulas are [[inductive definition|inductively]] defined as follows: * Each propositional variable is, on its own, a formula. * If φ is a formula, then ¬φ is a formula. * If φ and ψ are formulas, and • is any binary connective, then ( φ • ψ) is a formula. Here • could be (but is not limited to) the usual operators ∨, ∧, →, or ↔. This definition can also be written as a [[formal grammar]] in [[Backus–Naur form]], provided the set of variables is finite: {{#tag:syntaxhighlight|<alpha set> ::= p {{!}} q {{!}} r {{!}} s {{!}} t {{!}} u {{!}} ... (the arbitrary finite set of propositional variables) <form> ::= <alpha set> {{!}} ¬<form> {{!}} (<form>∧<form>) {{!}} (<form>∨<form>) {{!}} (<form>→<form>) {{!}} (<form>↔<form>)|lang="bnf"}} Using this grammar, the sequence of symbols :(((''p'' → ''q'') ∧ (''r'' → ''s'')) ∨ (¬''q'' ∧ ¬''s'')) is a formula, because it is grammatically correct. The sequence of symbols :((''p'' → ''q'')→(''qq''))''p'')) is not a formula, because it does not conform to the grammar. A complex formula may be difficult to read, owing to, for example, the proliferation of parentheses. To alleviate this last phenomenon, precedence rules (akin to the [[standard mathematical order of operations]]) are assumed among the operators, making some operators more binding than others. For example, assuming the precedence (from most binding to least binding) 1. ¬ 2. → 3. ∧ 4. ∨. Then the formula :(((''p'' → ''q'') ∧ (''r'' → ''s'')) ∨ (¬''q'' ∧ ¬''s'')) may be abbreviated as :''p'' → ''q'' ∧ ''r'' → ''s'' ∨ ¬''q'' ∧ ¬''s'' This is, however, only a convention used to simplify the written representation of a formula. If the precedence was assumed, for example, to be left-right associative, in following order: 1. ¬ 2. ∧ 3. ∨ 4. →, then the same formula above (without parentheses) would be rewritten as :(''p'' → (''q'' ∧ ''r'')) → (''s'' ∨ (¬''q'' ∧ ¬''s'')) ==Predicate logic== The definition of a formula in [[first-order logic]] <math>\mathcal{QS}</math> is relative to the [[Signature (mathematical logic)|signature]] of the theory at hand. This signature specifies the constant symbols, predicate symbols, and function symbols of the theory at hand, along with the [[Arity|arities]] of the function and predicate symbols. The definition of a formula comes in several parts. First, the set of '''[[Term (logic)|terms]]''' is defined recursively. Terms, informally, are expressions that represent objects from the [[domain of discourse]]. #Any variable is a term. #Any constant symbol from the signature is a term #an expression of the form ''f''(''t''<sub>1</sub>,...,''t''<sub>''n''</sub>), where ''f'' is an ''n''-ary function symbol, and ''t''<sub>1</sub>,...,''t''<sub>''n''</sub> are terms, is again a term. The next step is to define the [[atomic formula]]s. #If ''t''<sub>1</sub> and ''t''<sub>2</sub> are terms then ''t''<sub>1</sub>=''t''<sub>2</sub> is an atomic formula #If ''R'' is an ''n''-ary predicate symbol, and ''t''<sub>1</sub>,...,''t''<sub>''n''</sub> are terms, then ''R''(''t''<sub>1</sub>,...,''t''<sub>''n''</sub>) is an atomic formula Finally, the set of formulas is defined to be the smallest set containing the set of atomic formulas such that the following holds: #<math>\neg\phi</math> is a formula when <math>\phi</math> is a formula #<math>(\phi \land \psi)</math> and <math>(\phi \lor \psi)</math> are formulas when <math>\phi</math> and <math>\psi</math> are formulas; #<math>\exists x\, \phi</math> is a formula when <math>x</math> is a variable and <math>\phi</math> is a formula; #<math>\forall x\, \phi</math> is a formula when <math>x</math> is a variable and <math>\phi</math> is a formula (alternatively, <math>\forall x\, \phi</math> could be defined as an abbreviation for <math>\neg\exists x\, \neg\phi</math>). If a formula has no occurrences of <math>\exists x</math> or <math>\forall x</math>, for any variable <math>x</math>, then it is called {{Anchor|Quantifier-free formula}}'''quantifier-free'''. An ''existential formula'' is a formula starting with a sequence of [[existential quantification]] followed by a quantifier-free formula. ==Atomic and open formulas== {{Main|Atomic formula}} An ''atomic formula'' is a formula that contains no [[logical connective]]s nor [[Quantification (logic)|quantifiers]], or equivalently a formula that has no strict subformulas. The precise form of atomic formulas depends on the formal system under consideration; for [[propositional logic]], for example, the atomic formulas are the [[propositional variable]]s. For [[predicate logic]], the atoms are predicate symbols together with their arguments, each argument being a [[Formation rules|term]]. According to some terminology, an ''open formula'' is formed by combining atomic formulas using only logical connectives, to the exclusion of quantifiers.<ref>Handbook of the history of logic, (Vol 5, Logic from Russell to Church), Tarski's logic by Keith Simmons, D. Gabbay and J. Woods Eds, p568 [https://books.google.com/books?id=K5dU9bEKencC&q=open+formula&pg=PA568].</ref> This is not to be confused with a formula which is not closed. ==Closed formulas== {{Main|Sentence (logic)}} A ''closed formula'', also ''[[ground expression|ground]] formula'' or ''sentence'', is a formula in which there are no [[Free and bound variables|free occurrences]] of any [[variable (mathematics)|variable]]. If '''A''' is a formula of a first-order language in which the variables {{math|''v''<sub>1</sub>, …, ''v<sub>n</sub>''}} have free occurrences, then '''A''' preceded by {{math|∀''v''<sub>1</sub> ⋯ ∀''v<sub>n</sub>''}} is a ''universal closure'' of '''A'''. ==Properties applicable to formulas== * A formula '''A''' in a language <math>\mathcal{Q}</math> is ''[[satisfiability and validity|valid]]'' if it is true for every [[interpretation (logic)|interpretation]] of <math>\mathcal{Q}</math>. * A formula '''A''' in a language <math>\mathcal{Q}</math> is ''[[satisfiability and validity|satisfiable]]'' if it is true for some [[interpretation (logic)|interpretation]] of <math>\mathcal{Q}</math>. * A formula '''A''' of the language of [[Peano arithmetic|arithmetic]] is ''decidable'' if it represents a [[decidable set]], i.e. if there is an [[effective method]] which, given a [[substitution of variables|substitution]] of the free variables of '''A''', says that either the resulting instance of '''A''' is provable or its negation is. ==Usage of the terminology== In earlier works on mathematical logic (e.g. by [[Alonzo Church|Church]]<ref>Alonzo Church, [1996] (1944), Introduction to mathematical logic, page 49</ref>), formulas referred to any strings of symbols and among these strings, well-formed formulas were the strings that followed the formation rules of (correct) formulas. Several authors simply say formula.<ref>[[David Hilbert|Hilbert, David]]; [[Wilhelm Ackermann|Ackermann, Wilhelm]] (1950) [1937], Principles of Mathematical Logic, New York: Chelsea</ref><ref>Hodges, Wilfrid (1997), A shorter model theory, Cambridge University Press, {{isbn|978-0-521-58713-6}}</ref><ref>[[Jon Barwise|Barwise, Jon]], ed. (1982), Handbook of Mathematical Logic, Studies in Logic and the Foundations of Mathematics, Amsterdam: North-Holland, {{isbn|978-0-444-86388-1}}</ref><ref>Cori, Rene; Lascar, Daniel (2000), Mathematical Logic: A Course with Exercises, Oxford University Press, {{isbn|978-0-19-850048-3}}</ref> Modern usages (especially in the context of computer science with mathematical software such as [[List of model checking tools|model checkers]], [[automated theorem prover]]s, [[Interactive theorem proving|interactive theorem provers]]) tend to retain of the notion of formula only the algebraic concept and to leave the question of [[well-formedness]], i.e. of the concrete string representation of formulas (using this or that symbol for connectives and quantifiers, using this or that [[order of operations|parenthesizing convention]], using [[Polish notation|Polish]] or [[infix notation|infix]] notation, etc.) as a mere notational problem. The expression "well-formed formulas" (WFF) also crept into popular culture. ''WFF'' is part of an esoteric pun used in the name of the academic game "[[WFF 'N PROOF]]: The Game of Modern Logic", by Layman Allen,<ref>Ehrenburg 2002</ref> developed while he was at [[Yale Law School]] (he was later a professor at the [[University of Michigan]]). The suite of games is designed to teach the principles of symbolic logic to children (in [[Polish notation]]).<ref>More technically, [[Propositional calculus|propositional logic]] using the [[Fitch-style calculus]].</ref> Its name is an echo of ''[[whiffenpoof]]'', a [[nonsense word]] used as a [[Cheering|cheer]] at [[Yale University]] made popular in ''The Whiffenpoof Song'' and [[The Whiffenpoofs]].<ref>Allen (1965) acknowledges the pun.</ref> ==See also== {{Portal|Philosophy}} * [[Ground expression]] * [[Well-defined expression]] * [[Formal language]] * [[Glossary of logic]] * [[WFF 'N Proof]] ==Notes== {{Reflist}} ==References== *{{citation |first1=Layman E. |last1= Allen |title=Toward Autotelic Learning of Mathematical Logic by the WFF 'N PROOF Games | journal= Mathematical Learning: Report of a Conference Sponsored by the Committee on Intellective Processes Research of the Social Science Research Council |series= Monographs of the Society for Research in Child Development |volume=30 |issue=1 |year=1965 |pages=29–41 }} * {{Citation | last1=Boolos | first1=George | author1-link=George Boolos | last2=Burgess | first2=John | last3=Jeffrey | first3=Richard | author3-link=Richard Jeffrey | title=Computability and Logic | publisher=[[Cambridge University Press]] | edition=4th | isbn=978-0-521-00758-0 | year=2002}} * {{cite news | first=Rachel | last=Ehrenberg | title=He's Positively Logical | date=Spring 2002 | publisher=University of Michigan | url=http://www.umich.edu/~newsinfo/MT/02/Spr02/mt9s02.html | work=Michigan Today | access-date=2007-08-19 | archive-url=https://web.archive.org/web/20090208141433/http://umich.edu/~newsinfo/MT/02/Spr02/mt9s02.html | archive-date=2009-02-08 | url-status=dead }} * {{Citation | last1=Enderton | first1=Herbert | title=A mathematical introduction to logic | publisher=[[Academic Press]] | location=Boston, MA | edition=2nd | isbn=978-0-12-238452-3 | year=2001 }} * {{Citation | last1=Gamut | first1=L.T.F. | title=Logic, Language, and Meaning, Volume 1: Introduction to Logic |publisher= University Of Chicago Press | year= 1990 | isbn=0-226-28085-3 }} *{{Citation | last=Hodges | first=Wilfrid | section=Classical Logic I: First-Order Logic | editor1-last=Goble | editor1-first=Lou | title=The Blackwell Guide to Philosophical Logic | publisher=Blackwell | isbn=978-0-631-20692-7 | year=2001 | url-access=registration | url=https://archive.org/details/blackwellguideto0000unse_q4c2 }} *{{Citation | last1=Hofstadter | first1=Douglas | author1-link=Douglas Hofstadter | title=Gödel, Escher, Bach: An Eternal Golden Braid | publisher=[[Penguin Books]] | isbn=978-0-14-005579-5 | year=1980 }} * {{Citation | last1=Kleene | first1=Stephen Cole | author1-link=Stephen Kleene | title=Mathematical logic | orig-year=1967 | publisher=[[Dover Publications]] | location=New York | isbn=978-0-486-42533-7 | mr=1950307 | year=2002 }} * {{Citation|last=Rautenberg|first=Wolfgang|author-link=Wolfgang Rautenberg|doi=10.1007/978-1-4419-1221-3|title=A Concise Introduction to Mathematical Logic|publisher=[[Springer Science+Business Media]]|location=New York|edition=3rd|isbn=978-1-4419-1220-6|year=2010}} ==External links== *[http://www.cs.odu.edu/~toida/nerzic/content/logic/pred_logic/construction/wff_intro.html Well-Formed Formula for First Order Predicate Logic] - includes a short [[Java (programming language)|Java]] quiz. *[http://www.apronus.com/provenmath/formulas.htm Well-Formed Formula at ProvenMath] {{Mathematical logic}} {{DEFAULTSORT:Well-Formed Formula}} [[Category:Formal languages]] [[Category:Metalogic]] [[Category:Syntax (logic)]] [[Category:Mathematical logic]] [[Category:Logical expressions| ]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Broader
(
edit
)
Template:Citation
(
edit
)
Template:Cite news
(
edit
)
Template:Formal languages
(
edit
)
Template:Isbn
(
edit
)
Template:Main
(
edit
)
Template:Math
(
edit
)
Template:Mathematical logic
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Refn
(
edit
)
Template:Short description
(
edit
)