Introduction to Tree Logics

Similar documents
Deciding XPath Containment with MSO

Query Reasoning on Data Trees with Counting

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

On the Satisfiability of Two-Variable Logic over Data Words

1 Efficient Reasoning about Data Trees via Integer Linear Programming

A Decision Procedure for XPath Containment

Monadic Datalog Containment on Trees Using the Descendant-Axis

Transitive Closure Logic, Nested Tree Walking Automata, and XPath

Automata, Logic and Games: Theory and Application

Pattern Logics and Auxiliary Relations

Query Reasoning on Trees with Types, Interleaving, and Counting

Reasoning about XML with Temporal Logics and Automata

MSO Querying over Trees via Datalog Evaluation

Journal of Applied Logic

Queries, Modalities, Relations, Trees, XPath Lecture VII Core XPath and beyond

Efficient Reasoning about Data Trees via Integer Linear Programming

Two-Variable Logic on Data Trees and XML Reasoning

Counting in trees. Helmut Seidl 1 Thomas Schwentick 2 Anca Muscholl 3. 1 Introduction

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Two-Variable Logic on Data Trees and XML Reasoning

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

Satisfiability of Downward XPath with Data Equality Tests

Logics and automata over in nite alphabets

Compact Representation for Answer Sets of n-ary Regular Queries

An Automata-Theoretic Approach to Regular XPath

Containment for XPath Fragments under DTD Constraints

TheTwo-VariableGuardedFragmentwith Transitive Guards Is 2EXPTIME-Hard

The Complexity of Query Containment in Expressive Fragments of XPath 2.0

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation

Counter Automata and Classical Logics for Data Words

Comp487/587 - Boolean Formulas

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang

CS 208: Automata Theory and Logic

Theoretical Foundations of the UML

Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD

From Monadic Second-Order Definable String Transformations to Transducers

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014

A System for the Static Analysis of XPath

Deciding Twig-definability of Node Selecting Tree Automata

Abstract model theory for extensions of modal logic

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler

Deciding Twig-definability of Node Selecting Tree Automata

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER

From Constructibility and Absoluteness to Computability and Domain Independence

First-Order Queries over One Unary Function

Between tree patterns and conjunctive queries: is there tractability beyond acyclicity?

Node Selection Query Languages for Trees

Extending Two-Variable Logic on Trees

On the use of guards for logics with data

Conditional XPath. MAARTEN MARX Informatics Institute, Universiteit van Amsterdam The Netherlands. No Institute Given

Forward-XPath and extended register automata on data-trees (with Appendix)

Static Analysis and Query Answering for Incomplete Data Trees with Constraints

Tree Automata with Global Constraints

About the relationship between formal logic and complexity classes

Automata Theory for Presburger Arithmetic Logic

On the Expressive Power of Logics on Finite Models

FIRST-ORDER QUERY EVALUATION ON STRUCTURES OF BOUNDED DEGREE

Opleiding Informatica

Two-Variable Logic with Counting and Linear Orders

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

Satisfiability of XPath Queries with Sibling Axes

arxiv: v5 [cs.fl] 21 Feb 2012

Automata, Logic and Games: Theory and Application

Efficient Reasoning about Data Trees via Integer Linear Programming

Combining Temporal Logics for Querying XML Documents

Büchi Automata and Their Determinization

Languages, logics and automata

Alternating nonzero automata

3 Propositional Logic

Finite and Algorithmic Model Theory II: Automata-Based Methods

Finite Automata and Languages

Chapter 0 Introduction. Fourth Academic Year/ Elective Course Electrical Engineering Department College of Engineering University of Salahaddin

Forward-XPath and extended register automata

Theory of Computation

Non-Deterministic Time

The Classical Decision Problem

Succinctness of the Complement and Intersection of Regular Expressions

On Datalog vs. LFP. Anuj Dawar and Stephan Kreutzer

Axiomatic set theory. Chapter Why axiomatic set theory?

Model Checking Lower Bounds for Simple Graphs. Michael Lampis KTH Royal Institute of Technology

The Boundary Between Decidability and Undecidability for Transitive-Closure Logics

Finite Universes. L is a fixed-length language if it has length n for some

CSE 1400 Applied Discrete Mathematics Definitions

Mathematical Preliminaries. Sipser pages 1-28

Alternating register automata on finite data words and trees DIEGO FIGUEIRA

On Incomplete XML Documents with Integrity Constraints

Logics for Data and Knowledge Representation

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

Monadic Second Order Logic and Automata on Infinite Words: Büchi s Theorem

Algorithmic Model Theory SS 2016

Some Modal Aspects of XPath

Computación y Sistemas ISSN: Instituto Politécnico Nacional México

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

On Nondeterministic Unranked Tree Automata with Sibling Constraints

Expressive Power of Monadic Logics on Words, Trees, Pictures, and Graphs

Friendly Logics, Fall 2015, Lecture Notes 1

Finite Model Theory and Descriptive Complexity

Classical First-Order Logic

Theory of computation: initial remarks (Chapter 11)

if t 1,...,t k Terms and P k is a k-ary predicate, then P k (t 1,...,t k ) Formulas (atomic formulas)

Transcription:

1 / 26 Introduction to Tree Logics Pierre Genevès CNRS (slides mostly based on the ones by W. Martens and T. Schwentick) University of Grenoble, 2014 2015

2 / 26 Why Logic? Tree automaton algorithm Logical formula specification appropriate for queries Most expressive logics are tightly related to tree automata

3 / 26 Outline 1. Trees seen as logical structures 2. First-order logic over trees 3. Monadic second-order logic over trees

4 / 26 What is a Logic? Mathematical logic A tool that allows reasoning (show properties) about things (e.g. arithmetic, set theory...) Before talking about a logic, one must define the thing we are talking about! The thing is usually a structure (unconstrained, word, tree...)

4 / 26 What is a Logic? Mathematical logic A tool that allows reasoning (show properties) about things (e.g. arithmetic, set theory...) Before talking about a logic, one must define the thing we are talking about! The thing is usually a structure (unconstrained, word, tree...) Recall that in logic: A relational vocabulary is a sequence of relation names (R,..., T ) with associated arities arity(r),..., arity(t ) A structure S over (R,..., T ) is a tuple (D, R S,..., T S ) where D is a finite set, and R S D arity(r),..., S S D arity(s)

5 / 26 Trees as relational structures A tree t over a ranked alphabet Σ = {a,..., b} naturally corresponds to a structure t over the vocabulary V Σ = (child, <, L a,..., L b ) Example b a a c # # 4 # # a # b 1 2 3 8 9 10 11 12 # # a # 13 14 15 16 5 # # 17 18 a 6 7 Structure D t = {1, 2, 3,...} L σ: unary relations L a = {1, 3, 4, 10, 15} L b = {2, 12}... child, < (ordering) are binary relations 1 child t 2 1 child t 3 2 child t 4... 2 < t 3 4 < t 5...

6 / 26 Outline 1. Trees seen as relational structures 2. First-order logic over trees 3. Monadic second-order logic over trees

7 / 26 First-Order Logic over Trees FO over the vocabulary V Σ = (child, <, L a,..., L b ) : ϕ ::= x = y x child y x < y L a(x)... L b (y) ϕ ϕ ϕ xϕ with usual abbreviations ϕ ϕ, ϕ ϕ, xϕ,... Example All nodes labeled a in t have a child labeled b, iff: t = x(l a(x) y(l b (y) x child y))

7 / 26 First-Order Logic over Trees FO over the vocabulary V Σ = (child, <, L a,..., L b ) : ϕ ::= x = y x child y x < y L a(x)... L b (y) ϕ ϕ ϕ xϕ with usual abbreviations ϕ ϕ, ϕ ϕ, xϕ,... Notation/terminology If ϕ is a formula over V Σ then Langage(ϕ) := {t t ranked tree Σ such that t = ϕ} ϕ is satisfiable iff Langage(ϕ), valid iff Langage( ϕ) = We note FO[child, <] as a shorthand for FO over V Σ A tree language L is definable in FO[child, <] if there exists ϕ with L = Langage(ϕ)

8 / 26 Applications to XML Trees A closed formula ϕ defines a tree type (Langage(ϕ)), for example: x(l a(x) y(l b (y) x child y)) A formula ϕ(x, y) with two free variables defines a relation between two tree nodes: a (relative) query

8 / 26 Applications to XML Trees A closed formula ϕ defines a tree type (Langage(ϕ)), for example: x(l a(x) y(l b (y) x child y)) A formula ϕ(x, y) with two free variables defines a relation between two tree nodes: a (relative) query Exercise: Is the following query definable in FO[child, <]? child::a[parent::b]/child::c self::a/descendant::b

8 / 26 Applications to XML Trees A closed formula ϕ defines a tree type (Langage(ϕ)), for example: x(l a(x) y(l b (y) x child y)) A formula ϕ(x, y) with two free variables defines a relation between two tree nodes: a (relative) query Exercise: Is the following query definable in FO[child, <]? child::a[parent::b]/child::c self::a/descendant::b

9 / 26 Observation about FO Expressivity Transitive Closure x child + y is not expressible in FO[child, <]

9 / 26 Observation about FO Expressivity Transitive Closure x child + y is not expressible in FO[child, <] We can consider FO[descendant, <] instead

9 / 26 Observation about FO Expressivity Transitive Closure x child + y is not expressible in FO[child, <] We can consider FO[descendant, <] instead Example descendant::p[not child::q]/child::* z(x descendant z L p(z) w(z child w L q(w)) z child y))

9 / 26 Observation about FO Expressivity Transitive Closure x child + y is not expressible in FO[child, <] We can consider FO[descendant, <] instead Example descendant::p[not child::q]/child::* z(x descendant z L p(z) w(z child w L q(w)) z child y)) Here, z child w stands for: z descendant w v(z descendant v v descendant y) Property Every XPath expression of the CoreXPath fragment is equivalent to a formula with 2 free variables in FO 2 [descendant, <] [Marx, 2004, Genevès and Vion-Dury, 2004]

10 / 26 CoreXPath query ::= /path absolute path path relative path query query union query query intersection path ::= path/path path composition path[qualifier] qualified path axis::nodetest step qualifier ::= qualifier and qualifier conjunction qualifier or qualifier disjunction not(qualifier) negation path path nodetest ::= σ node label any node label axis ::= tree navigation axis self child parent descendant preceding descendant-or-self ancestor ancestor-or-self following-sibling preceding-sibling following

11 / 26... what about the reciprocal property? Is any FO 2 [descendant, <] formula equivalent to a CoreXPath expression? A desirable property for a query language if true, CoreXPath is expressively complete with respect to paths definable in FO: if a path is definable in FO, then there exists a CoreXPath expression that defines it.

11 / 26... what about the reciprocal property? Is any FO 2 [descendant, <] formula equivalent to a CoreXPath expression? A desirable property for a query language... No! if true, CoreXPath is expressively complete with respect to paths definable in FO: if a path is definable in FO, then there exists a CoreXPath expression that defines it. CoreXPath is not complete with respect to FO 2 [descendant, <] But a relatively simple extension of CoreXPath is sufficient for obtaining the reciprocal [Marx, 2004]...

12 / 26 Example (CoreXPath extended) def e 1 = self::*[(child::*[f 1]) /child::*[f 2]] }{{} e 2 F 1 and F 2 are filtering expressions e 2 is not a CoreXPath expression, it defines the transitive-reflexive closure of the relation expressed by child::*[f 1]

12 / 26 Example (CoreXPath extended) def e 1 = self::*[(child::*[f 1]) /child::*[f 2]] }{{} e 2 F 1 and F 2 are filtering expressions e 2 is not a CoreXPath expression, it defines the transitive-reflexive closure of the relation expressed by child::*[f 1] e 2 is equivalent to: x = y (x descendant y F 1(y) z(x descendant z z descendant y F 1(z))) e 1 defines the set of paths (x, x) such that x has a descendant y for which F 2 is true and for all z strictly between x and y, F 1 is true. e 1 is not expressible in CoreXPath: Any CoreXPath qualifier is equivalent to a FO formula with only 2 variables It can be shown that the main qualifier of e 1 requires 3 variables

13 / 26 Example (CoreXPath extended) def e 1 = self::*[(child::*[f 1]) /child::*[f 2]] }{{} e 2 e 2 is called a conditional axis (different from descendant-or-self=child since it depends on F 1) Conditional XPath is CoreXPath extended with all conditional axes in the 4 directions (descendant, ancestor, following-sibling, preceding-sibling) Properties Conditional XPath is expressively complete with respect to FO[descendant, <] [Marx, 2004] Most CoreXPath properties (like linear-time evaluation) generalize to Conditional XPath

14 / 26 Is FO the Ideal Logic for XML? Assessment for XML FO (and variants) are appropriate for characterizing the expressive power and (to some extent) the complexity of query languages... Decidability and Complexity Over an unconstrained relational structure: FO is undecidable [Church, 1936, Turing, 1937] Over trees: FO is decidable but not elementary FO 2 (the fragment of FO restricted to only 2 distinct variables) : 2-NEXPTIME [Mortimer, 1975], NEXPTIME [Grädel et al., 1997] But...

15 / 26 FO Expressivity is Limited Limitation FO does not capture all regular tree languages Example: The language L composed of all trees with an even number of a (recall tree automata!) L is not definable in FO (exercise: intuitively, FO cannot count ) FO is not expressive enough for reasoning over all DTDs, XML Schemas, Relax NGs

16 / 26 Outline 1. Trees seen as relational structures 2. First-order logic over trees 3. Monadic second-order logic over trees

17 / 26 Monadic Second-Order Logic MSO is the extension of FO with set variables X : ϕ ::= x = y x child y x < y L a(x)... L b (y) ϕ ϕ ϕ xϕ X (x) X ϕ with usual abbreviations ϕ ϕ, ϕ ϕ, xϕ, X ϕ,... Example: Boolean Expressions true expression X. X (root) x (L 1(x) X (x)) (L 0(x) X (x)) ((L (x) X (x)) ( y[x child y X (y)])) ((L (x) X (x)) ( y[x child y X (y)]))

17 / 26 Monadic Second-Order Logic MSO is the extension of FO with set variables X : ϕ ::= x = y x child y x < y L a(x)... L b (y) ϕ ϕ ϕ xϕ X (x) X ϕ with usual abbreviations ϕ ϕ, ϕ ϕ, xϕ, X ϕ,... Notation and Terminology If ϕ is a closed formula over V Σ then Langage(ϕ) := {t t ranked tree over Σ such that t = ϕ} A tree language is definable in MSO if there exists a MSO formula ϕ with S = Langage(ϕ)

18 / 26 MSO Variants: WSkS Think a little bit... Let s go back to the definition of our relational vocabulary We need to model our logical structure (ordered trees: structure + order) Instead of child and <, we could define and use relations ch i modeling the parent to i-th child relationship: x ch i y iff y is the i-th child of x Then instead of MSO[child,<], we can consider MSO[ch 1, ch 2,..., ch k ] please write some formulas This is WSkS (Weak monadic Second-order logic of k Successors), which is not so weak...

19 / 26 WS2S: A Variant of Special Interest Zoom on WSkS = MSO[ch 1, ch 2,..., ch k ] Are the i s in ch i annoying? Remember the binary tree encoding... Considering ch 1 and ch 2 is sufficient wlog! We can even call them first successor and second successor or fc (for first-child) and ns (next-sibling), explicitly referring to the unranked case Anyway, this is WS2S.

20 / 26 The logical tree structure: another perspective b a a a0.1 b b 0.0 b a a b ɛ ɛ.0 ɛ.1 0.0.0 0.0.1 0.1.0 0.1.1 b a a b 0.1.0.1 a a a 1.0 1.1 L WS2S ϕ ::= x = y firstchild(x, y) nextsibling(x, y) L a(x)... L b (y) ϕ ϕ ϕ xϕ X (x) X ϕ

21 / 26 Logical Variants Now you know how to build and clearly define plenty of (different?) logical formalisms Most importantly: you understand why it is important to define and mention the relational vocabulary over the logical structure FO[child, <], FO[descendant, <], FO[fc, ns], FO[fc +, ns + ], FO 2 [fc +, ns + ] Exercise(s): what are the connections between those logics? Btw: what was the problem again with FO[fc,ns]? MSO[child, <], MSO[fc, ns]=ws2s Exercise: finding MSO formulas not in any FO: e.g. true boolean expressions, other ones?

22 / 26 Exercise with MSO Construct a WS2S formula ϕ which describes the set of trees with an even number of a nodes, e.g.: a b a a a b b b a a b b a a b a a L WS2S ϕ ::= x = y firstchild(x, y) nextsibling(x, y) L a(x)... L b (y) ϕ ϕ ϕ xϕ X (x) X ϕ

23 / 26 Expressivity and Decidability of MSO Theorem [Thatcher and Wright, 1968, Doner, 1970] MSO exactly captures regular tree languages The satisfiability-problem for a MSO formula is decidable Principle: the logic-tree automata connection Show that MSO is as expressive as tree automata We associate a tree automaton to each formula, and reciprocally For the direction logic automata, induction: basic tree automata ϕ ϕ : composition of tree automata (recall: closure of regular tree languages) Satisfiability of the logical formula: emptiness check of the final automaton

23 / 26 Expressivity and Decidability of MSO Theorem [Thatcher and Wright, 1968, Doner, 1970] MSO exactly captures regular tree languages The satisfiability-problem for a MSO formula is decidable Principle: the logic-tree automata connection Show that MSO is as expressive as tree automata We associate a tree automaton to each formula, and reciprocally For the direction logic automata, induction: basic tree automata ϕ ϕ : composition of tree automata (recall: closure of regular tree languages) Satisfiability of the logical formula: emptiness check of the final automaton We can compute the tree automaton (the algorithm) that corresponds to a given logical formula (specification)!

24 / 26 Complexity What is the size of the tree automaton corresponding to ϕ? (a) smaller than ϕ (c) larger then ϕ (b) same size as ϕ (d) HUGE

24 / 26 Complexity What is the size of the tree automaton corresponding to ϕ? (a) smaller than ϕ (c) larger then ϕ (b) same size as ϕ (d) HUGE Hints ϕ: construction of the complement of the automaton for ϕ (determinisation) xϕ x ϕ Each quantifier alternation (e.g. ) introduces a determinisation...

24 / 26 Complexity What is the size of the tree automaton corresponding to ϕ? (a) smaller than ϕ (c) larger then ϕ (b) same size as ϕ (d) HUGE Hints ϕ: construction of the complement of the automaton for ϕ (determinisation) xϕ x ϕ Each quantifier alternation (e.g. ) introduces a determinisation...

24 / 26 Complexity What is the size of the tree automaton corresponding to ϕ? (a) smaller than ϕ (c) larger then ϕ (b) same size as ϕ (d) HUGE Hints ϕ: construction of the complement of the automaton for ϕ (determinisation) xϕ x ϕ Each quantifier alternation (e.g. ) introduces a determinisation...

25 / 26 Complexity Theorem The number of states of the automaton associated with a formula with n quantifier alternations is in the worst case at least: c n 2 2...2 where c is a constant. [Stockmeyer and Meyer, 1973] That s a lower bound! MSO satisfiability is decidable in non-elementary time (i.e. not bounded by any stack of exponentials) Nevertheless, there exists an implementation of this decision procedure: MONA [Klarlund and Møller, 2001]

25 / 26 Complexity Theorem The number of states of the automaton associated with a formula with n quantifier alternations is in the worst case at least: c n 2 2...2 where c is a constant. [Stockmeyer and Meyer, 1973] That s a lower bound! MSO satisfiability is decidable in non-elementary time (i.e. not bounded by any stack of exponentials) Nevertheless, there exists an implementation of this decision procedure: MONA [Klarlund and Møller, 2001]

25 / 26 Complexity Theorem The number of states of the automaton associated with a formula with n quantifier alternations is in the worst case at least: c n 2 2...2 where c is a constant. [Stockmeyer and Meyer, 1973] That s a lower bound! MSO satisfiability is decidable in non-elementary time (i.e. not bounded by any stack of exponentials) Nevertheless, there exists an implementation of this decision procedure: MONA [Klarlund and Møller, 2001]

25 / 26 Complexity Theorem The number of states of the automaton associated with a formula with n quantifier alternations is in the worst case at least: c n 2 2...2 where c is a constant. [Stockmeyer and Meyer, 1973] That s a lower bound! MSO satisfiability is decidable in non-elementary time (i.e. not bounded by any stack of exponentials) Nevertheless, there exists an implementation of this decision procedure: MONA [Klarlund and Møller, 2001]

26 / 26 FO Summary: 2 Yardsticks for Measuring Expressivity FO[fc +, ns + ] is expressively equivalent to Conditional XPath No FO variant can capture regular tree languages entirely

26 / 26 FO Summary: 2 Yardsticks for Measuring Expressivity FO[fc +, ns + ] is expressively equivalent to Conditional XPath No FO variant can capture regular tree languages entirely MSO One of the most expressive (yet decidable) logic known today You pay for what you get: 1. Satisfiability is non-elementary 2. Unless P=NP, there does not exist any elementary f (i.e. bounded by a stack of exponential) such that MSO formulas can be evaluated in time f (size(ϕ)) p(size(t)) with p polynomial [Frick and Grohe, 2002] This makes MSO almost useless as a query language :(

26 / 26 FO Summary: 2 Yardsticks for Measuring Expressivity FO[fc +, ns + ] is expressively equivalent to Conditional XPath No FO variant can capture regular tree languages entirely MSO One of the most expressive (yet decidable) logic known today You pay for what you get: 1. Satisfiability is non-elementary 2. Unless P=NP, there does not exist any elementary f (i.e. bounded by a stack of exponential) such that MSO formulas can be evaluated in time f (size(ϕ)) p(size(t)) with p polynomial [Frick and Grohe, 2002] This makes MSO almost useless as a query language :( There exists a logic [Genevès et al., 2007] as expressive as MSO and much more efficient (for both evaluation and satisfiability)...

26 / 26 Church, A. (1936). A note on the entscheidungsproblem. Journal of Symbolic Logic, 1:101 102. Doner, J. (1970). Tree acceptors and some of their applications. Journal of Computer and System Sciences, 4:406 451. Frick, M. and Grohe, M. (2002). The complexity of first-order and monadic second-order logic revisited. In LICS, pages 215 224. Genevès, P., Layaïda, N., and Schmitt, A. (2007). Efficient static analysis of XML paths and types. In PLDI 07: Proceedings of the 2007 ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 342 351, New York, NY, USA. ACM Press. Genevès, P. and Vion-Dury, J.-Y. (2004). XPath formal semantics and beyond: A Coq-based approach. In TPHOLs 04: Emerging Trends Proceedings of the 17th International Conference on Theorem Proving in Higher Order

26 / 26 Logics, pages 181 198, Salt Lake City, Utah, United States. University Of Utah. Grädel, E., Kolaitis, P. G., and Vardi, M. Y. (1997). On the decision problem for two-variable first-order logic. Bulletin of Symbolic Logic, 3(1):53 69. Klarlund, N. and Møller, A. (2001). MONA Version 1.4 User Manual. BRICS Notes Series NS-01-1, Department of Computer Science, University of Aarhus. Marx, M. (2004). Conditional XPath, the first order complete XPath dialect. In PODS 04: Proceedings of the twenty-third ACM Symposium on Principles of Database Systems, pages 13 22, New York, NY, USA. ACM Press. Mortimer, M. (1975). On language with two variables. Zeit für Math. Logik und Grund. der Math., 21:135 140. Stockmeyer, L. and Meyer, A. (1973). Word problems requiring exponential time.

26 / 26 In STOC 73: Proceedings of the 5th ACM symposium on Theory of computing, pages 1 9, New York, NY, USA. ACM Press. Thatcher, J. W. and Wright, J. B. (1968). Generalized finite automata theory with an application to a decision problem of second-order logic. Mathematical Systems Theory, 2(1):57 81. Turing, A. (1937). On computable numbers, with an application to the entscheidungsproblem. Proc. London Math. Soc. Correction in vol. 43, pp. 544-546., 42:230 265.