The Boolean Formula Value Problem as Formal Language

Similar documents
A Characterization of the Chomsky Hierarchy by String Turing Machines

Compiler Construction

Limited Automata and Unary Languages

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia

Multiple Choice Questions

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

CS402 Theory of Automata Solved Subjective From Midterm Papers. MIDTERM SPRING 2012 CS402 Theory of Automata

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

1. [5 points each] True or False. If the question is currently open, write O or Open.

CMPSCI 250: Introduction to Computation. Lecture 20: Deterministic and Nondeterministic Finite Automata David Mix Barrington 16 April 2013

Decision Procedures for Recursive Data Structures with Integer Constraints

Theory of Computations Spring 2016 Practice Final Exam Solutions

THEORY OF COMPUTATION

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

A fuzzy subset of a set A is any mapping f : A [0, 1], where [0, 1] is the real unit closed interval. the degree of membership of x to f

Eliminating the Storage Tape in Reachability Constructions

Last lecture CMSC330. This lecture. Finite Automata: States. Finite Automata. Implementing Regular Expressions. Languages. Regular expressions

Theory of Computation

CS5371 Theory of Computation. Lecture 8: Automata Theory VI (PDA, PDA = CFG)

Chapter 14: Pushdown Automata

A Note on the Succinctness of Descriptions of Deterministic Languages

SORT INFERENCE \coregular" signatures, they derive an algorithm for computing a most general typing for expressions e which is only slightly more comp

Solutions to Homework 10

R10 SET a) Construct a DFA that accepts an identifier of a C programming language. b) Differentiate between NFA and DFA?

ONE-STACK AUTOMATA AS ACCEPTORS OF CONTEXT-FREE LANGUAGES *

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Context-Free Languages & Grammars (CFLs & CFGs) Reading: Chapter 5

Learn Smart and Grow with world

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

On the Recognizability of Arrow and Graph Languages

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

Model checking pushdown systems

CS402 - Theory of Automata Glossary By

class. Moreover, so far, the problem of evaluating a Boolean formula [6] and the problem of multiplying permutations on ve points [3] (and some of the

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

Formal Definition of Computation. Formal Definition of Computation p.1/28

UNIT I PART A PART B

The Big Picture. Chapter 3

TOPIC PAGE NO. UNIT-I FINITE AUTOMATA

Finite Automata. Dr. Nadeem Akhtar. Assistant Professor Department of Computer Science & IT The Islamia University of Bahawalpur

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Introduction to Computer Architecture

Rational subsets in HNN-extensions

Slides for Faculty Oxford University Press All rights reserved.

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

MIT Specifying Languages with Regular Expressions and Context-Free Grammars. Martin Rinard Massachusetts Institute of Technology

Improved algorithms for constructing fault-tolerant spanners

MIT Specifying Languages with Regular Expressions and Context-Free Grammars

Chapter 2 Boolean algebra and Logic Gates

Some Interdefinability Results for Syntactic Constraint Classes

NP versus PSPACE. Frank Vega. To cite this version: HAL Id: hal

Automata Theory TEST 1 Answers Max points: 156 Grade basis: 150 Median grade: 81%

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:

ALGORITHMIC DECIDABILITY OF COMPUTER PROGRAM-FUNCTIONS LANGUAGE PROPERTIES. Nikolay Kosovskiy

CS3102 Theory of Computation Problem Set 2, Spring 2011 Department of Computer Science, University of Virginia

Conversion of Fuzzy Regular Expressions to Fuzzy Automata using the Follow Automata

Theory of Programming Languages COMP360

Treewidth and graph minors

Lecture 1: TSP on graphs of bounded branch width

A Formal Study of Practical Regular Expressions

Notes for Comp 454 Week 2

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Theory Bridge Exam Example Questions Version of June 6, 2008

CMPSCI 250: Introduction to Computation. Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014

CSE 105 THEORY OF COMPUTATION

CISC 4090 Theory of Computation

Recursively Defined Functions

Name: Finite Automata

Rewriting. Andreas Rümpel Faculty of Computer Science Technische Universität Dresden Dresden, Germany.

Exercises Computational Complexity

THE INTERNATIONAL JOURNAL OF SCIENCE & TECHNOLEDGE

Handout 9: Imperative Programs and State

CT32 COMPUTER NETWORKS DEC 2015

Pure Lambda Calculus. Lecture 17

Theory of Computation Dr. Weiss Extra Practice Exam Solutions

CS375: Logic and Theory of Computing

Automating Construction of Lexers

Lexical Analysis. Dragon Book Chapter 3 Formal Languages Regular Expressions Finite Automata Theory Lexical Analysis using Automata

Streaming Tree Transducers

Closure Properties of CFLs; Introducing TMs. CS154 Chris Pollett Apr 9, 2007.

Cuts from Proofs: A Complete and Practical Technique for Solving Linear Inequalities over Integers

Reflection in the Chomsky Hierarchy

Chapter Summary. Recursively defined Functions. Recursively defined sets and Structures Structural Induction

Nested Words. A model of linear and hierarchical structure in data. Examples of such data

2.1 Sets 2.2 Set Operations

Lexical Analysis. COMP 524, Spring 2014 Bryan Ward

NP-Completeness. Algorithms

2. BOOLEAN ALGEBRA 2.1 INTRODUCTION

LECTURE NOTES THEORY OF COMPUTATION

On Generalization of Fuzzy Concept Lattices Based on Change of Underlying Fuzzy Order

This book is licensed under a Creative Commons Attribution 3.0 License

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject.

Electronic Colloquium on Computational Complexity, Report No. 18 (1998)

Pumping Visibly Pushdown Languages

Chordal deletion is fixed-parameter tractable

CS 314 Principles of Programming Languages

LECTURE NOTES THEORY OF COMPUTATION

A Formalization of Transition P Systems

SAT-CNF Is N P-complete

Transcription:

The Boolean Formula Value Problem as Formal Language Klaus-Jörn Lange WSI, Universität Tübingen, Sand 13, D72076 Tübingen, Germany lange@informatik.uni-tuebingen.de Abstract. The Boolean formula value problem asks for the Boolean output value of a given input formula. We code it as a formal language D + {a, b}. D + is a nonregular, visibly pushdown language. We give automata for D + which enable us to derive some of its syntactic equations. It is unknown whether the given list of equations is complete. Using these equations some algebraic properties of the syntactic monoid of D + are sketched. Keywords: Boolean formula value problem, syntactic monoid, word equations, algebraic approach, TC 0 vs NC 1. 1 Introduction The Boolean formula value problem (BFVP) consists in evaluating Boolean formulas. Compared to the P -complete circuit value problem it is of rather low complexity; depending in the coding of the input formula the evaluation can be done in NC 1 if the formula is given in a parenthesized way (or in polish normal form) or deterministically in logarithmic space if the input formula is given as a tree coded by nodes and edges. In this paper we will be interested in the first of these two possibilities. It is quite easy to show the NC 1 -hardness of the Boolean evaluation problem for formulas given by parenthesized words or expressions in polish normal form. On the other hand,the construction to prove membership in NC 1 is quite involved [5]. The class NC 1 is quite attractive from the formal language viewpoint since Barrington showed, that each regular set, whose syntactic monoid contains an nonsolvable group is NC 1 -complete ([3]). Thus there exist regular sets whose word problem is NC 1 -complete. The aim of this investigation is to consider the Boolean formula evaluation problem from the algebraic formal language view-point despite the fact that it is nonregular and hence its syntactic monoid is infinite. This short note comes without proofs. Just the constructions and some examples are given. Proofs for the correctness of the automata constructions can be found in the Studienarbeit of Bernd Brumm ([4]). This paper is structured as follows: we first express (a special version of) the Boolean formula value problem via the Dyck language D over one pair of parenthesis. Then we present automata constructions. Finally, some first algebraic H. Bordihn, M. Kutrib, and B. Truthe (Eds.): Dassow Festschrift 2012, LNCS 7300, pp. 138 144, 2012. c Springer-Verlag Berlin Heidelberg 2012

Boolean Formula Value Problem 139 properties of BFVP are given including a list of defining equations which are not known to be complete. 1.1 Preliminaries Let L {a, b}. We say that two words x, y {a, b} are congruent modulo L if and only if we have zxz L zyz L for all z,z {a, b}.by[x] L we denote the congruence class of x modulo L. For the resulting notions and results concerning the syntactic monoid of L we refer to [6]. In our investigations of the Boolean formula value problem we will use the notion of visibly pushdown automata and languages as introduced by Alur ([1]). These were known before as input-driven languages and are characterized by the restriction that the modification of the stack in terms of push or pop moves are not dependent in the state but only in the input symbol. While the one-sided Dyck languages are visibly pushdown languages, the two-sided ones are not. 2 Coding the Boolean Formula Value Problem The coding of a problem, i.e.: its representation as formal language containing words which code problem instances, can usually be done in different ways without affecting the complexity of the problem. But the resulting formal languages will differ signifcantly in their algebraic properties expressed in their syntactic monoids. For instance will a parenthesis-language contain a zero in its syntactic monoid, while in the corresponding polish normal form language arbitrary words are subwords of valid expressions, which means that there is no zero in the syntactic monoid. Our aim is to choose a representation of BFVP which leads to a syntactic monoid as simple as possible. That is why we will represent boolean formulas by the NAND-operation, we will use a polish normal form instead of using parentheses, and we will represent binary trees by dyck words and not by the more usual Lukasiewicz words. It is well known that every Boolean function can be expressed by the (binary) NAND-function together with the Boolean constant TRUE. The conversion is possible by replacing AND(x, y) bynand(true,nand(x, y)), OR(x, y) by NAND(NAND(TRUE, x), NAND(TRUE, y)), and NOT(x) by NAND(TRUE,x). The size of the resulting NAND-formula is linear in the size of the original AND, OR-formula. Hence we will consider as input formulas, which are to be evaluated, complete binary trees labelled with NAND-function, i.e.; all inner nodes have two predecessors and are labelled by the NAND-function, while the remaining nodes are leaves of indegree zero labelled by the Boolean constant TRUE. As mentioned before, coding these formulas as graphs, with vertices and edges, leads to evaluation problems which are hard for deterministic logarithmic space.

140 K.-J. Lange The well-known alternative is to use parentheses to express the tree structure. Throughout of this paper we will represent the opening paranthesis by the letter a and the closing one by the letter b. We code complete binary trees as follows: the tree consisting of a single (root) vertex is coded by the empty word λ. If a vertex has two outgoing edges leading to its predecessors the left edge is labelled by a and the right one by b. The tree is then read in-order from left to right. Thus the word aabb represents the binary tree with 3 leaves, the left subree containing 2 leaves, and the right one containing one leave. Switching the left and right subtree yields the tree represented by abab. This gives a one-to-one corrspondence between complete binary trees and the Dyck language D {a, b}. We decided in favour of labelling the edges and against the more usual labelling of the vertices, which would lead to the well known representation of complete binary trees by the Lukasiewicz language. While (contextfree) grammars are in general easier to construct for the Lukasiewicz language, in the Dyck case the resulting syntactic (bicyclic) monoid is more simple. For instance D is generated by the single equation ab = λ whereas the Lukasiewicz language results in the equations aba = a, abb = b, andaab = a. A tree labelled by Boolean functions and constants evaluates either to TRUE or to FALSE. In this way the Dyck set D is divided into the two disjoint subsets D = D + D where D + consists in those elements of D which represent a tree (labelled with the NAND-function and the constant TRUE) which evaluates to TRUE and D contain those which evaluate to FALSE. Thus D + is a special formulation of the Boolean formual value problem which makes D + NC 1 -complete. In the following, we are going to investigate the properties of the formal language D +. 3 Properties of D + It is easy to see that D + is a context-free language. For instance, the set D + b 1 is generated by the grammar with the rules S aasss asass aassass b. Obviously, D + is a visibly push-down language as defined by Alur([1]), i.e. for each element of the terminal alphabet it is determined whether the stack of an push-down automaton accepting D + is pushed (here by the symbol a) orpopped (here by the symbol b). Alur et al. showed that a language is visibly push-down if and only if a certain congruence relation is of finite index ([2]). A close inspection shows that the resulting congruence relation divides the set D into four classes D = F N P T. This was explicated in [4]. 1 This set might be regarded as the Lukasiewicz-version of D +

Boolean Formula Value Problem 141 These four classes might be explained in the following way: T consists in those Dyck-words w which represent formulas, which evaluate to TRUE and if we add asuffixv such that wv is still a Dyck word, wv evaluates to TRUE, as well. F consists of the dual class of words representing fomulae evaluating to FALSE regardless how they are completed by a Dyck suffix. P and N are represent those formulas which evaluate to TRUE (respectively, FALSE) whose value can be changed by a suffix. The shortest member of these four classes are λ P, ab N, aabb T, and, abaabb F. We have D + = T P and D = F N. These four classes can be characterized in the following way: every w Dadmits a unique decomposition w = aw 1 baw 2 aw n b for some n 0andsomew i D. We then have w P iff n is even and for all 1 j n we have w j D +, w N iff n is odd and for all 1 j n we have w j D +, w T iff there exists some i < n/2 such that w 2i+1 D and for all 1 j 2i we have w j D +,and w F iff there exists some i<n/2 such that w 2i D and for all 1 j 2i 1wehavew j D +. Thus w D + iff w consists in a concatenation of an even number of words avb, v D +, followed by a word aub, u D, or followed by nothing. If that number is odd,we have w D. 3.1 Automata for D + Alur showed how to construct a push-down automaton out of the congruence whose classes serve both as stack alphabet and as set of states. In the case of D + the resulting automaton can be simplified by keeping as set of states {F, N, P, T } but shrinking the stack alphabet to Γ := {P, N} with the pushing transitions and the popping transitions T a F, P Pa P, P Na P, N Fa F, N T,P b N P, P b N N,P b T F, P b T. T,N b P P, N b P N,N b F F, N b F

142 K.-J. Lange The resulting automaton has a very regular structure like an infinite binary tree. It is thus possible to represent uniquely each combination of state and stack content of this automaton as a binary string in a way, that configurations connected by transitions are of a very similar shape. A pushing transition, i.e. reading an a, acts on a binary string ending in the bits xy, x, y {0, 1}, by appending the second to last bit x which makes the string now ending in xyx. A popping transition, i.e. reading a b, acts on a binary string ending in the bits xyz, x, y, z {0, 1}, by deleting the last bit z and then exchanging the remaining last two bits which makes the string now ending in yx. Interpreting these strings as binary numbers, the four pushing and eight popping rules can be given by the following rules: The automaton has infinitely many states labelled by natural numbers greater or equal to 4. The starting state is state 6. If the (one-way) input reads an a and the automaton is in state 4n + i for some n and some i<4 it goes to state 8n + j where i and j are given by: 4n +0 8n +0 4n +1 8n +2. 4n +2 8n +5 4n +3 8n +7 If a b is read we have the following rules: 8n +0 4n +0 8n +1 4n +0 8n +2 4n +2 8n +3 4n +2. 8n +4 4n +1 8n +5 4n +1 8n +6 4n +3 8n +7 4n +3 Since D + is NC 1 -completeit is thus an NC 1 -complete task to read a Dyck word and make according to the input letters the corresponding modulo computations and then to determine whether the result is 6 or 7 (corresponding to D + )or4 or 5 (corresponding to D ). 4 The Syntactic Monoid of D + We now investigate the infinite syntactic monoid of D +.Todoso,wefirstconsider equations fulfilled by the syntactic congruence of D +. After that we give a few algebraic properties of D +. 4.1 Equations It is easy to check the validity of the following equations fulfilled in {a, b} by D + either directly or using the automata given in the previous section:

Boolean Formula Value Problem 143 1. abab = λ, 2. aabbb = b, 3. aabaabb = aabba, 4. abbabb = babb, 5. aabba i ab = aabba i for all i 0, and 6. abb i abaabb = b i abaabb for all i 1. The last two (sets of) equations express that to the right of the word in aabba respectively to the left of the word in b babaabb the D + -evaluation is simply just a D-evaluation, i.e.: the reduction of the subword ab to λ. It is unclear, whether these equations are complete, i.e.: whether there are new equations not implied by the given ones, or independent, i.e.; whether one of them is implied by the others. Another interesting question is, whether these equations can be directed in either way (either from left to right or from right to left) such that each sequence of applications of the bidirectional equations could be simulated by a sequence of applications of the unidirectional versions of these equations. The last question is closely connected to the search for rewriting systems converting each w {a, b} into a normal form w (for instance a shortest word w.r.t. some ordering) such that w and w are congruent modulo D +.An application of the Knuth-Bendix-procedure to (unidirectional versions of) the given equations didn t give new ones. 4.2 Algebraic Properties of the D + We finally give a few algebraic properties of the syntactic monoid M D+ of D +. A standard tool to investigate the structure of a monoid are Green s relations (see for instance [6]). For finite monoids the D- and the J-relation allways coincide. This can hold in the infinite case, as well; an example is the syntactic monoid of the language D which is the bicyclic monoid. In contrast to that the syntactic monoid of D + has one J-class (i.e. for all x, y {a, b} there exist z,z {a, b} such that x is congruent zyz modulo D + ), but more then one D-class, since aabb and the empty word λ are not D-equivalent, i.e.: there is no x {a, b} such that both [aabb] L M D+ =[x] L M D+ and M D+ [x] L = M D+ [λ] L. We finally mention, that the syntactic monoid of D + is regular. That is, for all x {a, b} there exists some y (called an inverse of x) such that xyx is congruent with x and yxy with y modulo D +. If that inverse element y is uniquely determined by x, such a monoid is called inverse. While the syntactic monoid of D is inverse, that of D + is not; for instance the word bab has the two different inverses a and aaabb. These algebraic differences between D and D + express their differences in complexity. While D is in TC 0 (and complete w.r.t. Turing reducibilities), D + is NC 1 -complete(w.r.t. many-one reducibilities). Compared to D + a totally different NC 1 -complete problem is the word problem of A 5 (or of any other regular set whose syntactic monoid contains a nonsolvable group ([3])). In the proof of this fact the action of a Boolean gate with inputs

144 K.-J. Lange x and y is in some sense simulated by evaluating the commutator x 1 y 1 xy of the algebraic simulations of x and y. The proof makes uses of the fact, that a nonsolvable group contains arbitrarily long, nonvanishing commutatorchains. This leads to the question whether we can find in the syntactic monoid of D +, which is regular and has only one J-class, a similar algebraic simmulation of the action of Boolean gates, which would give a new proof of the NC 1 -hardness of the Boolean formula value problem. Acknowledgement. I would like to thank the referees for their careful reading of this note. References 1. Alur, R.: Visibly Pushdown Languages. In: Proc. 36th ACM Symp. on Theory of Computing, pp. 202 211 (2004) 2. Alur, R., Kumar, V., Madhusudan, P., Viswanathan, M.: Congruences for Visibly Pushdown Languages. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 1102 1114. Springer, Heidelberg (2005) 3. Barrington, D.A.: Bounded-width polynomial-size branching programs can recognize exactly those languages in NC 1. J. Comp. System Sci. 38, 150 164 (1989) 4. Brumm, B.: Das Auswertungsproblem als formale Sprache. Private Communication (2011) 5. Buss, S.R.: The Boolean formula value problem is in ALOGTIME. In: Proc. 19th Ann. ACM Symp. on Theory of Computing, pp. 123 131 (1987) 6. Pin, J.E.: Varieties of Formal Languages. Plenum, London (1986)