The complexity of counting solutions to Generalised Satisfiability Problems modulo k
打开数字的英文作文
打开数字的英文作文Title: Exploring the Significance of Numbers in Everyday Life。
Numbers are the fundamental building blocks of the universe, governing every aspect of our existence from the grandeur of galaxies to the intricacies of subatomic particles. They serve as the language through which we comprehend the world around us, enabling us to quantify, analyze, and understand phenomena that range from the mundane to the extraordinary. In this essay, we delve into the multifaceted significance of numbers in our daily lives, exploring their role in various domains and their profound impact on human civilization.To begin with, numbers are indispensable tools in the realm of mathematics, serving as the foundation upon which mathematical theories and principles are constructed. From the simplicity of counting to the complexity of calculus, numbers provide the framework for solving equations,modeling natural phenomena, and unlocking the mysteries of the universe. Without numbers, the vast edifice of mathematics would crumble, rendering fields such as physics, engineering, and economics virtually incomprehensible.Moreover, numbers play a crucial role in communication and commerce, facilitating transactions, measurements, and exchanges of information on a global scale. Whether we are discussing the price of goods, the dimensions of a building, or the coordinates of a location, numbers serve asuniversal symbols that transcend language barriers and cultural differences. In the digital age, where data drives decision-making and technological innovation, the abilityto manipulate and interpret numbers is essential forsuccess in virtually every sector of the economy.Beyond their practical utility, numbers also possess symbolic and cultural significance that permeates various aspects of human society. In many cultures, certain numbers are imbued with auspicious or ominous meanings, influencing beliefs, traditions, and rituals. For example, the number seven is often associated with luck and spirituality inmany societies, while the number thirteen is viewed as unlucky in Western superstition. Furthermore, numbersfeature prominently in art, literature, and religion, serving as metaphors for concepts such as infinity, perfection, and transcendence.In addition to their symbolic and cultural connotations, numbers have profound psychological effects on the human mind, shaping our perceptions, behaviors, and decision-making processes in subtle ways. Research in cognitive psychology has revealed that humans have an innate tendency to assign numerical values to objects and events, a phenomenon known as "numerical cognition." Moreover, numerical illusions and biases, such as the "anchoring effect" and the "Gestalt law of proximity," demonstrate how numbers can influence our judgments and interpretations of reality.Furthermore, numbers hold a special significance in the context of time, serving as markers of temporal progression and historical continuity. The concept of chronological time, with its division into seconds, minutes, hours, days,and years, is an essential aspect of human civilization, enabling us to organize our lives, record our achievements, and reflect on the passage of time. Moreover, the use of numerical calendars and timelines allows us to contextualize historical events, chart the course of evolution, and envision the future trajectory of humanity.In conclusion, numbers are not merely abstract entities but integral components of our everyday experience, shaping our perceptions, actions, and understanding of the world. From the elegance of mathematical equations to the symbolism of cultural rituals, numbers permeate every aspect of human existence, enriching our lives with their infinite complexity and profound significance. As we navigate the complexities of modern society, let us recognize and appreciate the indispensable role that numbers play in illuminating the mysteries of the universe and charting the course of human civilization.。
验证NP问题
The Complexity of Theorem-Proving Procedures∗Stephen A.CookUniversity of TorontoSummaryIt is shown that any recognition problem solved by a polynomial time-bounded nondeterministic Turing machine can be“reduced”to the problem of determining whether a given propositional formula is a tautology.Here“reduced”means,roughly speaking,that thefirst problem can be solved determinis-tically in polynomial time provided an oracle is available for solving the second.From this notion of reducible,polynomial degrees of difficulty are defined,and it is shown that the problem of determining tautologyhood has the same polynomial degree as the problem of determining whether thefirst of two given graphs is isomorphic to a subgraph of the second.Other examples are discussed.A method of measuring the complexity of proof procedures for the predicate calculus is introduced and discussed. Throughout this paper,a set of strings1means a set of strings on somefixed,large,finite alphabetΣ. This alphabet is large enough to include symbols for all sets described here.All Turing machines are deterministic recognition devices,unless the contrary is explicitly stated.1Tautologies and Polynomial Re-Reducibility.Let usfix a formalism for the propositional calculus in which formulas are written as strings onΣ.Since we will require infinitely many proposition symbols(atoms),each such symbol will consist of a member ofΣfollowed by a number in binary notation to distinguish that symbol.Thus a formula of length n can only have about n/log n distinct function and predicate symbols.The logical connectives are∧2(and),∨(or),and¬(not).The set of tautologies(denoted by{tautologies})is a certain recursive set of strings on this alphabet, and we are interested in the problem offinding a good lower bound on its possible recognition times.We provide no such lower bound here,but theorem1will give evidence that{tautologies}is a difficult set to recognize,since many apparently difficult problems can be reduced to determining tautologyhood.By reduced we mean,roughly speaking,that if tautologyhood could be decided instantly(by an“oracle”) then these problems could be decided in polynomial time.In order to make this notion precise,we introduce query machines,which are like Turing machines with oracles in[1].A query machine is a multitape Turing machine with a distinguished tape called the query tape,and three distinguished states called the query state,yes state,and no state,respectively.If M is a query machine and T is a set of strings,then a T-computation of M is a computation of M in which initially M is in the initial state and has an input string w on its input tape,and each time M assumes the query state ∗Transliteration of the original1971typewritten paper by Tim Rohlfs(rev.3).I transcripted basically exactly as Cook wrote the text;frequently,I even kept inconsistent punctuation.Whenever my version differs from Cook’s,I give notice.Minor typesetting issues are corrected without notice.1Cook underlines phrases he wants to emphasize.I will use italics for this purpose.2Cook uses&(“et”)instead of∧.For better readability,I will use∧,which is common usage.there is a string u on the query tape,and the next state M assumes is the yes state if u∈T and the no state if u/∈T.We think of an“oracle”,which knows T,placing M in the yes state or no state.Definition.A set S of strings is P-reducible(P for polynomial)to a set T of strings iff there is some query machine M and a polynomial Q(n)such that for each input string w,the T-computation of M with input w halts within Q(|w|)steps(|w|is the length of w)and ends in an accepting state iff w∈S.It is not hard to see that P-reducibility is a transitive relation.Thus the relation E on sets of strings, given by(S,T)∈E iff each of S and T is P-reducible to the other,is an equivalence relation.The equivalence class containing a set S will be denoted by deg(S)(the polynomial degree of difficulty of S).Definition.We will denote deg({0})by L∗,where0denotes the zero function.Thus L∗is the class of sets recognizable in polynomial time.L∗was discussed in[2],p.5,and is the string analog of Cobham’s3class L of functions[3].We now define the following special sets of strings.1.The subgraph problem is the problem given twofinite undirected graphs,determine whether thefirst is isomorphic to a subgraph of the second.A graph G can be represented by a string G on the alphabet{0,1,∗}by listing the successive rows of its adjacency matrix,separated by∗s.We let{subgraph pairs}denote the set of strings G1∗∗G2such that G1is isomorphic to a subgraph of G2.2.The graph isomorphism problem will be represented by the set,denoted by{isomorphic graphpairs},of all strings G1∗∗G2such that G1is isomorphic to G2.3.The set{Primes}is the set of all binary notations for prime numbers.4.The set{DNF tautologies}is the set of strings representing tautologies in disjunctive normal form.5.The set D3consists of those tautologies in disjunctive normal form in which each disjunct has atmost three conjuncts(each of which is an atom or negation of an atom).Theorem1.If a set S of strings is accepted by some nondeterministic Turing machine within polynomial time,then S is P-reducible to{DNF tautologies}.Corollary.Each of the sets in definitions1)–5)is P-reducible to{DNF tautologies}.This is because each set,or its complement,is accepted in polynomial time by some nondeterministic Turing machine.Proof of the theorem.Suppose a nondeterministic Turing machine M accepts a set S of strings within time Q(n),where Q(n)is a polynomial.Given an input w for M,we will construct a proposition formula A(w)in conjunctive normal form such that A(w)is satisfiable iff M accepts w.Thus¬A(w)is easily put in disjunctive normal form(using De Morgan’s laws),and¬A(w)is a tautology if and only if w/∈S. Since the whole construction can be carried out in time bounded by a polynomial in|w|(the length of w),the theorem will be proved.We may as well assume the Turing machine M has only one tape,which is infinite to the right but has a left-most square.Let us number the squares from left to right1,2,....Let usfix an input w to M of length n,and suppose w∈S.Then there is a computation of M with input w that ends in an accepting state within T=Q(n)steps.The formula A(w)will be built from many different proposition symbols, whose intended meanings,listed below,refer to such a computation.3The paper erroneously refers to“Cabham”.Suppose the tape alphabet for M is {σ1,...,σl }and the set of states is {q 1,...,q r }.4Notice that since the computation has at most T =Q (n )steps,no tape square beyond T is scanned.Proposition symbols:•P i s ,t for 1≤i ≤l ,1≤s ,t ≤T .P i s ,t is true iff tape square number s at step t contains the symbol σi .•Q i t for 1≤i ≤r ,1≤t ≤T .Q i t is true iff at step t the machine is in state q i .•S s ,t for 1≤s ,t ≤T is true iff at time t square number s is scanned by the tape head.The formula A (w )is a conjunction B ∧C ∧D ∧E ∧F ∧G ∧H ∧I formed as follows.Notice A (w )is in conjunctive normal form.B will assert that at each step t ,one and only one square is scanned.B is a conjunction B 1∧B 2∧...∧B T ,where B t asserts that at time t one and only one square is scanned:B t =(S 1,t ∨S 2,t ∨...∨S T ,t )∧ 1≤i <j ≤T(¬S i ,t ∨¬S j ,t ).For 1≤s ≤T and q ≤t ≤T j C s ,t asserts that at square s and time t there is one and only one symbol.C is the conjunction of all the C s ,t .D asserts that for each t there is one and only one state.E asserts the initial conditions are satisfied:E =Q 01∧S 1,1∧P i 11,1∧P i 22,1∧...∧P i n n ,1∧P 1n +1,1∧...∧P 1T ,1where w =σi 1...σi n ,q 0is the initial state and σ1is the blank symbol.F ,G ,andH assert that for each time t the values of the P ’s,Q ’s and S ’s are updated properly.For example,G is the conjunction over all t ,i ,j of G t i ,j ,where G t i ,j asserts that if at time t the machine is in state q i scanning symbol σj ,then at time t +1the machine is in state q k ,where q k is the state given by the transition function for M .5G t i ,j =T s =1¬Q i t ∨¬S s ,t ∨¬P j s ,t ∨Q k t +1 .Finally,the formula I asserts that the machine reaches an accepting state at some time.The machine M should be modified so that it continues to compute in some trivial fashion after reaching an accepting state,so that A (w )will be satisfied.It is now straightforward to verify that A (w )has all the properties asserted in the first paragraph of theproof.Theorem 2.The following sets are P-reducible to each other in pairs (and hence each has the same polynomial degree of difficulty):{tautologies },{DNF tautologies },D 3,{subgraph pairs }.Remark.We have not been able to add either {primes }or {isomorphic graphpairs }to the above list.To show {tautologies }is P-reducible to {primes }would seem to require some deep results in number theory,while showing {tautologies }is P-reducible to {isomorphic graphpairs }would probably upset a conjecture of Corneil’s [4]from which he deduces that the graph isomorphism problem can be solved in polynomial time.Incidently,it is 6not hard to see from the Davis-Putnam procedure [5]that the set D 2consisting of all DNF tautologies with at most two conjuncts per disjunct,is in L ∗.Hence D 2cannot be added to the list in theorem 2(unless all sets in the list are in L ∗).4Here,the original paper mentions {q 1,...,q s }instead of {q 1,...,q r }.There’s a hardly readable,handwritten “r”below the “s”,and Cook subsequently does not refer to s but to r ;so it is likely that q r is correct.5Following this sentence,the paper contains some handwritten annotation I cannot decipher.6The original paper contains a typing error here (“it”instead of “it is”).Proof of theorem2.By the corollary to theorem1,each of the sets is P-reducible to{DNF tautologies}. Since obviously{DNF tautologies}is P-reducible to{tautologies},it remains to show{DNF tautologies} is P-reducible to D3and D3is P-reducible to{subgraph pairs}.To show{DNF tautologies}is P-reducible to D3,let A be a proposition formula in disjunctive normal form.Say A=B1∨B2∨...∨B k,where B1=R1∧...∧R s,and each R i is an atom or negation of an atom, and s>3.Then A is a tautology if and only if A is a tautology whereA =P∧R3∧...∧R s∨¬P∧R1∧R2∨B2∨...∨B k,where P is a new atom.Since we have reduced the number of conjuncts in B1,this process may be repeated until eventually a formula is found with at most three conjuncts per disjunct.Clearly the entire process is bounded in time by a polynomial in the length of A.It remains to show that D3is P-reducible to{subgraph pairs}.Suppose A is a formula in disjunctive normal form with three conjuncts per disjunct.Thus A=C1∨...∨C k,where C i=R i1∧R i2∧R i3,and each R i j is an atom or a negation of an atom.Now let G1be the complete graph with vertices{v1,v2,...,v k}, and let G2be the graph with vertices{u i j},1≤i≤k,1≤j≤3,such that u i j is connected by an edge to u rs if and only if i=r and the two literals(R i j,R rs)do not form an opposite pair(that is they are neither of the form(P,¬P)nor of the form(¬P,P)).Thus there is a falsifying truth assignment to the formula A iff there is a graph homomorphismφ:G1→G2such that for each i,φ(i)=u i j for some j.(The homomorphism tells for each i which of R i1,R i2,R i3should be falsified,and the selective lack of edges in G2guarantees that the resulting truth assignment is consistently specified.)In order to guarantee that a one-one homomorphismφ:G1→G2has the property that for each i,φ(i)=u i j for some j,we modify G1and G2as follows.We select graphs H1,H2,...,H k which are sufficiently distinct from each other that if G 1is formed from G1by attaching H i to v i,1≤i≤k,and G 2is formed from G2by attaching H i to each of u i1and u i2and u i3,1≤i≤k,then every one-one homomorphismφ:G 1→G 2has the property just stated.It is not hard to see such a construction can be carried out in polynomial time.Then G 1can be embedded in G 2if and only if A/∈D3.This completes the proof of theorem2.2DiscussionTheorem1and its corollary give strong evidence that it is not easy to determine whether a given proposition formula is a tautology,even if the formula is in normal disjunctive form.Theorems1and 2together suggest that it is fruitless to search for a polynomial decision procedure for the subgraph problem,since success would bring polynomial decision procedures to many other apparently intractible problems.Of course the same remark applies to any combinatorial problem to which{tautologies}is P-reducible.Furthermore,the theorems suggest that{tautologies}is a good candidate for an interesting set not in L∗,and I feel it is worth spending considerable effort trying to prove this conjecture.Such a proof would be a major breakthrough in complexity theory.In view of the apparent complexity of{DNF tautologies},it is interesting to examine the Davis-Putnam procedure[5].This procedure was designed to determine whether a given formula in conjunctive normal form is satisfiable,but of course the“dual”procedure determines whether a given formula in disjunctive normal form is a tautology.I have not yet been able tofind a series of examples showing the procedure(treated sympathetically to avoid certain pitfalls)must require more than polynomial time. Nor have I found an interesting upper bound for the time required.If we let strings represent natural numbers,(or k-tuples of natural numbers)using m-adic or other suitable notation,then the notions in the preceeding sections can be made to apply to sets of numbers(or k-place relations on numbers).It is not hard to see that the set of relations accepted in polynomial time by some nondeterministic Turing machine is precisely the set L+of relations of the form(∃y≤g k(x))R(x,y)(1)where g k(x)=2(l(max x))k,l(z)is the dyadic length of z,and R(x,y)is an L∗relation,(L+is the class of extended positive rudimentary relations of Bennett[6]).If we remove the bound on the quantifier in formula(1),the class L+would become the class of recursively enumerable sets.Thus if L+is the analog of the class of r.e.sets,then determining tautologyhood is the analog of the halting problem; since,according to theorem1,{tautologies}has the complete L+degree just as the halting problem has the complete r.e.degree.Unfortunately,the diagonal argument which shows the halting problem is not recursive apparently cannot be adapted to show{tautologies}is not in L∗.3The Predicate CalculusFormulas in the predicate calculus are represented by strings in a manner similar to the propositional calculus.In addition to the symbols for the latter,we need the quantifier symbols∀and∃,and symbols for forming an infinite list of individual variables,and infinite lists of function and predicate symbols of each order(of course the underlying alphabetΣis stillfinite).Suppose Q is a procedure which operates on the above formulas and which terminates on a given input formula A iff A is unsatisfiable.Since there is no decision procedure for satisfiability in the predicate calculus,it follows that there is no recursive function T such that if A is unsatisfiable,then Q will terminate within T(n)steps,where n is the length of A.How then does one appraise the efficiency of the procedure?We will take the following approach.Most automatic theorem provers depend on the Herbrand theo-rem,which states briefly that a formula A is unsatisfiable if and only if some conjunction of substitution instances of the functional form f n(A)of A is truth functionally inconsistent.Suppose we order the terms in the Herbrand universe of f n(A)according to rank,and then order in a natural way the substitution instances of f n(A)from the Herbrand universe.The ordering should be such that in general substitution instances which use terms with greater rank follow substitution instances which use terms of lesser rank. Let A1,A2,...be these substitution instances in order.Definition.If A is unsatisfiable,thenφ(A)is the least k such that A1∧A2∧...∧A k is truth-functionally inconsistent.If A is satisfiable,thenφ(A)is undefined.Now let Q be the procedure which,given A,computes the sequence A1,A2,...and for each i,tests whether A1∧...∧A i is truth-functionally consistent.If the answer is ever no,the procedure terminates successfully.Then clearly there is a recursive T(k)such that for all k and all formulas A,if the length of A≤k andφ(A)≤k,then Q will terminate within T(k)steps.We suggest that the function T(k)is a measure of the efficiency of Q.For convenience,all procedures in this section will be realized on single tape Turing machines,which we shall call simply machines.Definition.Given a machine M Q and recursive function T Q(k),we will say M Q is of type Q and runs within time T Q(k)provided that when M Q starts with a predicate formula A written on its tape,then M Q halts if and only if A is unsatisfiable,and for all k,ifφ(A)≤k and|A|≤log2k,then M Q halts within T Q(k)steps.In this case we will also say that T Q(k)is of type Q.Here|A|is the length of A.The reason for the condition|A|≤log2k instead of|A|≤k,is that with the latter condition,finding a lower bound for T Q(k)would be nearly equivalent tofinding a lower bound for the decision problem for the propositional calculus.In particular,theorem3A would become obvious and trivial.Theorem3.A)For any T Q(k)of type Q,T Q(k)√(2)k/(log k)2is unbounded.B)There is a T Q (k )of type Q such thatT Q (k )≤k 2k (log k )2.Outline of proof.A)Given any machine M ,one can construct a predicate formula A (M )which issatisfiable if and only if M never halts when starting on a blank tape.This is done along the lines described in Wang [7]in the proof which reduces the halting problem to the decision problem for the predicate calculus.Further,if M halts in s steps,then φ(A (M ))≤s 2.Thus,if,contrary to (2),T Q (k )=O (√k /log 2k ),then a modification of M Q could verify in onlyO (√s 2/log 2s 2)=O (s /log 2s )steps that M halted in s steps (provided m ≤log s 2,where m is the length of A (M )).A diagonal argument (see [8]p.153)shows that this is impossible in general.B)The machine M Q operates in time T Q by following the procedure outlined at the beginning ofthis section.Note that the formula A 1∧A 2∧...∧A k has length O (k log 2k ),since we can assume |A |≤log k .Theorem 4.If the set S of strings is accepted by a nondeterministic machine within time T (n )=2n ,and if T Q (k )is an honest (i.e.real-time countable)function of type Q,then there is a constant K so S can be recognized by a deterministic machine within time T Q (K 8n ).Proof.Suppose M 1is a nondeterministic machine which accepts S in time 2n .Let M 2be a nondeter-ministic machine which simulates M 1for exactly 2n steps and then halts,unless M 1accepts the input,in which case M 2computes forever.Thus for all strings w ,if w ∈S then there is a computation for which M 2with input w fails to halt,and if w /∈S ,then M 2with input w halts within 4n steps for all computations.Now given w of length n ,we may construct a formula A (w )of length O (n )such that A (w )is satisfiable if and only if M 1accepts w .(A (w )is constructed in a way similar to A (M )in the proof of 3A.)7Further,if M 2halts within 4n steps for all possible computations,then φ(A (w ))≤K (4n )2=K 8n .Thus,a deterministic machine M can be constructed to determine whether w ∈S by presenting M Q with input A (w ).If no result appears within TQ (K 8n )steps,then w ∈S ,and otherwise w /∈S .4More DiscussionThere is a large gap between the lower bound of √k /(log k )2for time functions T Q (k )given in theorem3A and a possible T Q (k )=k 2k (log k )2given in 3B.However,there are reasons for the gap.For example,if we could improve the result in 3B and find a T Q (k )bounded by a polynomial in k ,then by theorem 4we could simulate a nondeterministic 2n time bounded machine deterministically in time p (2n )for some polynomial p .This is contrary to experience which indicates deterministic simulation of a nondeterministic T (n )time bounded machine requires time k T (n )in general.On the other hand,if we could push up the lower bound given in theorem 3A and showT Q (k )2is unbounded,then we could conclude {tautologies }/∈L ∗,since otherwise the general Herbrand proofprocedure would provide a T Q (k )smaller than 2k .Thus such an improvement in 3A would require amajor breakthrough in complexity theory.7The paper refers to “1A”here.Since this theorem does not exist,and A (M )only exists in 3A,it seems certain that 3A is correct.Thefield of mechanical theorem proving badly needs a basis for comparing and evaluating the dozens of procedures which appear in the literature.Performance of a procedure on examples by computer is a good criterion,but not sufficient(unless the procedure proves useful in some practical way).A theoretical complexity criterion is needed which will bring out fundamental limitations and suggest new goals to pursue.The criterion suggested here(the function T Q(k))is probably too crude.For example,it might be better to make T Q(k)a function of several variables,of which one isφ(A),and another might be the minimum number of substitution instances of f n(A)needed to form a contradiction(note that in general not all of A1,A2,...,Aφ(A)are needed).T Q(k)may be a crude measure,but it does provide a basis for discussion,and,I hope,will stimulate progress towardfinding better complexity measures for theorem provers.References[1]D.L.Kreider and R.W.Ritchie:Predictably Computable Functionals and Definitions by Recursion.Zeitschrift für math.Logik und Grundlagen der Math.,V ol.10,65–80(1964).[2]S.A.Cook:Characterizations of Pushdown Machines in terms of Time-Bounded Computers.J.puting Machinery,V ol.18,No.1,Jan.1971,pp4–18.[3]Cobham,Alan:The intrinsic computational difficulty of functions.Proc.of the1964InternationalCongress for Logic,Methodology,and the Philosophy of Science,North Holland Publishing Co., Amsterdam,pp.24–30.[4]D.G.Corneil and C.C.Gotlieb:An Efficient Algorithm for Graph Isomorphism.J.Assoc.Computing Machinery,V ol.17,No.1,Jan.1970,pp51–64.[5]M.Davis and H.Putnam:A Computing Procedure for Quantification putingMachinery,1960,pp.201–215.[6]J.H.Bennett:On Spectra.Doctoral Dissertation,Princeton University,1962.[7]Hao Wang:Dominoes and the AEA case of the decision problems.Proc.of the Symposium onMathematical Theory of Automata,at Polytechnic Institute of Brooklyn,1962.pp.23–55.[8]John Hopcroft and Jeffrey Ullman:Formal Languages and their Relation to Automata.Addison-Wesley,1969.。
专八英语阅读
英语专业八级考试TEM-8阅读理解练习册(1)(英语专业2012级)UNIT 1Text AEvery minute of every day, what ecologist生态学家James Carlton calls a global ―conveyor belt‖, redistributes ocean organisms生物.It’s planetwide biological disruption生物的破坏that scientists have barely begun to understand.Dr. Carlton —an oceanographer at Williams College in Williamstown,Mass.—explains that, at any given moment, ―There are several thousand marine species traveling… in the ballast water of ships.‖ These creatures move from coastal waters where they fit into the local web of life to places where some of them could tear that web apart. This is the larger dimension of the infamous无耻的,邪恶的invasion of fish-destroying, pipe-clogging zebra mussels有斑马纹的贻贝.Such voracious贪婪的invaders at least make their presence known. What concerns Carlton and his fellow marine ecologists is the lack of knowledge about the hundreds of alien invaders that quietly enter coastal waters around the world every day. Many of them probably just die out. Some benignly亲切地,仁慈地—or even beneficially — join the local scene. But some will make trouble.In one sense, this is an old story. Organisms have ridden ships for centuries. They have clung to hulls and come along with cargo. What’s new is the scale and speed of the migrations made possible by the massive volume of ship-ballast water压载水— taken in to provide ship stability—continuously moving around the world…Ships load up with ballast water and its inhabitants in coastal waters of one port and dump the ballast in another port that may be thousands of kilometers away. A single load can run to hundreds of gallons. Some larger ships take on as much as 40 million gallons. The creatures that come along tend to be in their larva free-floating stage. When discharged排出in alien waters they can mature into crabs, jellyfish水母, slugs鼻涕虫,蛞蝓, and many other forms.Since the problem involves coastal species, simply banning ballast dumps in coastal waters would, in theory, solve it. Coastal organisms in ballast water that is flushed into midocean would not survive. Such a ban has worked for North American Inland Waterway. But it would be hard to enforce it worldwide. Heating ballast water or straining it should also halt the species spread. But before any such worldwide regulations were imposed, scientists would need a clearer view of what is going on.The continuous shuffling洗牌of marine organisms has changed the biology of the sea on a global scale. It can have devastating effects as in the case of the American comb jellyfish that recently invaded the Black Sea. It has destroyed that sea’s anchovy鳀鱼fishery by eating anchovy eggs. It may soon spread to western and northern European waters.The maritime nations that created the biological ―conveyor belt‖ should support a coordinated international effort to find out what is going on and what should be done about it. (456 words)1.According to Dr. Carlton, ocean organism‟s are_______.A.being moved to new environmentsB.destroying the planetC.succumbing to the zebra musselD.developing alien characteristics2.Oceanographers海洋学家are concerned because_________.A.their knowledge of this phenomenon is limitedB.they believe the oceans are dyingC.they fear an invasion from outer-spaceD.they have identified thousands of alien webs3.According to marine ecologists, transplanted marinespecies____________.A.may upset the ecosystems of coastal watersB.are all compatible with one anotherC.can only survive in their home watersD.sometimes disrupt shipping lanes4.The identified cause of the problem is_______.A.the rapidity with which larvae matureB. a common practice of the shipping industryC. a centuries old speciesD.the world wide movement of ocean currents5.The article suggests that a solution to the problem__________.A.is unlikely to be identifiedB.must precede further researchC.is hypothetically假设地,假想地easyD.will limit global shippingText BNew …Endangered‟ List Targets Many US RiversIt is hard to think of a major natural resource or pollution issue in North America today that does not affect rivers.Farm chemical runoff残渣, industrial waste, urban storm sewers, sewage treatment, mining, logging, grazing放牧,military bases, residential and business development, hydropower水力发电,loss of wetlands. The list goes on.Legislation like the Clean Water Act and Wild and Scenic Rivers Act have provided some protection, but threats continue.The Environmental Protection Agency (EPA) reported yesterday that an assessment of 642,000 miles of rivers and streams showed 34 percent in less than good condition. In a major study of the Clean Water Act, the Natural Resources Defense Council last fall reported that poison runoff impairs损害more than 125,000 miles of rivers.More recently, the NRDC and Izaak Walton League warned that pollution and loss of wetlands—made worse by last year’s flooding—is degrading恶化the Mississippi River ecosystem.On Tuesday, the conservation group保护组织American Rivers issued its annual list of 10 ―endangered‖ and 20 ―threatened‖ rivers in 32 states, the District of Colombia, and Canada.At the top of the list is the Clarks Fork of the Yellowstone River, whereCanadian mining firms plan to build a 74-acre英亩reservoir水库,蓄水池as part of a gold mine less than three miles from Yellowstone National Park. The reservoir would hold the runoff from the sulfuric acid 硫酸used to extract gold from crushed rock.―In the event this tailings pond failed, the impact to th e greater Yellowstone ecosystem would be cataclysmic大变动的,灾难性的and the damage irreversible不可逆转的.‖ Sen. Max Baucus of Montana, chairman of the Environment and Public Works Committee, wrote to Noranda Minerals Inc., an owner of the ― New World Mine‖.Last fall, an EPA official expressed concern about the mine and its potential impact, especially the plastic-lined storage reservoir. ― I am unaware of any studies evaluating how a tailings pond尾矿池,残渣池could be maintained to ensure its structural integrity forev er,‖ said Stephen Hoffman, chief of the EPA’s Mining Waste Section. ―It is my opinion that underwater disposal of tailings at New World may present a potentially significant threat to human health and the environment.‖The results of an environmental-impact statement, now being drafted by the Forest Service and Montana Department of State Lands, could determine the mine’s future…In its recent proposal to reauthorize the Clean Water Act, the Clinton administration noted ―dramatically improved water quality since 1972,‖ when the act was passed. But it also reported that 30 percent of riverscontinue to be degraded, mainly by silt泥沙and nutrients from farm and urban runoff, combined sewer overflows, and municipal sewage城市污水. Bottom sediments沉积物are contaminated污染in more than 1,000 waterways, the administration reported in releasing its proposal in January. Between 60 and 80 percent of riparian corridors (riverbank lands) have been degraded.As with endangered species and their habitats in forests and deserts, the complexity of ecosystems is seen in rivers and the effects of development----beyond the obvious threats of industrial pollution, municipal waste, and in-stream diversions改道to slake消除the thirst of new communities in dry regions like the Southwes t…While there are many political hurdles障碍ahead, reauthorization of the Clean Water Act this year holds promise for US rivers. Rep. Norm Mineta of California, who chairs the House Committee overseeing the bill, calls it ―probably the most important env ironmental legislation this Congress will enact.‖ (553 words)6.According to the passage, the Clean Water Act______.A.has been ineffectiveB.will definitely be renewedC.has never been evaluatedD.was enacted some 30 years ago7.“Endangered” rivers are _________.A.catalogued annuallyB.less polluted than ―threatened rivers‖C.caused by floodingD.adjacent to large cities8.The “cataclysmic” event referred to in paragraph eight would be__________.A. fortuitous偶然的,意外的B. adventitious外加的,偶然的C. catastrophicD. precarious不稳定的,危险的9. The owners of the New World Mine appear to be______.A. ecologically aware of the impact of miningB. determined to construct a safe tailings pondC. indifferent to the concerns voiced by the EPAD. willing to relocate operations10. The passage conveys the impression that_______.A. Canadians are disinterested in natural resourcesB. private and public environmental groups aboundC. river banks are erodingD. the majority of US rivers are in poor conditionText CA classic series of experiments to determine the effects ofoverpopulation on communities of rats was reported in February of 1962 in an article in Scientific American. The experiments were conducted by a psychologist, John B. Calhoun and his associates. In each of these experiments, an equal number of male and female adult rats were placed in an enclosure and given an adequate supply of food, water, and other necessities. The rat populations were allowed to increase. Calhoun knew from experience approximately how many rats could live in the enclosures without experiencing stress due to overcrowding. He allowed the population to increase to approximately twice this number. Then he stabilized the population by removing offspring that were not dependent on their mothers. He and his associates then carefully observed and recorded behavior in these overpopulated communities. At the end of their experiments, Calhoun and his associates were able to conclude that overcrowding causes a breakdown in the normal social relationships among rats, a kind of social disease. The rats in the experiments did not follow the same patterns of behavior as rats would in a community without overcrowding.The females in the rat population were the most seriously affected by the high population density: They showed deviant异常的maternal behavior; they did not behave as mother rats normally do. In fact, many of the pups幼兽,幼崽, as rat babies are called, died as a result of poor maternal care. For example, mothers sometimes abandoned their pups,and, without their mothers' care, the pups died. Under normal conditions, a mother rat would not leave her pups alone to die. However, the experiments verified that in overpopulated communities, mother rats do not behave normally. Their behavior may be considered pathologically 病理上,病理学地diseased.The dominant males in the rat population were the least affected by overpopulation. Each of these strong males claimed an area of the enclosure as his own. Therefore, these individuals did not experience the overcrowding in the same way as the other rats did. The fact that the dominant males had adequate space in which to live may explain why they were not as seriously affected by overpopulation as the other rats. However, dominant males did behave pathologically at times. Their antisocial behavior consisted of attacks on weaker male,female, and immature rats. This deviant behavior showed that even though the dominant males had enough living space, they too were affected by the general overcrowding in the enclosure.Non-dominant males in the experimental rat communities also exhibited deviant social behavior. Some withdrew completely; they moved very little and ate and drank at times when the other rats were sleeping in order to avoid contact with them. Other non-dominant males were hyperactive; they were much more active than is normal, chasing other rats and fighting each other. This segment of the rat population, likeall the other parts, was affected by the overpopulation.The behavior of the non-dominant males and of the other components of the rat population has parallels in human behavior. People in densely populated areas exhibit deviant behavior similar to that of the rats in Calhoun's experiments. In large urban areas such as New York City, London, Mexican City, and Cairo, there are abandoned children. There are cruel, powerful individuals, both men and women. There are also people who withdraw and people who become hyperactive. The quantity of other forms of social pathology such as murder, rape, and robbery also frequently occur in densely populated human communities. Is the principal cause of these disorders overpopulation? Calhoun’s experiments suggest that it might be. In any case, social scientists and city planners have been influenced by the results of this series of experiments.11. Paragraph l is organized according to__________.A. reasonsB. descriptionC. examplesD. definition12.Calhoun stabilized the rat population_________.A. when it was double the number that could live in the enclosure without stressB. by removing young ratsC. at a constant number of adult rats in the enclosureD. all of the above are correct13.W hich of the following inferences CANNOT be made from theinformation inPara. 1?A. Calhoun's experiment is still considered important today.B. Overpopulation causes pathological behavior in rat populations.C. Stress does not occur in rat communities unless there is overcrowding.D. Calhoun had experimented with rats before.14. Which of the following behavior didn‟t happen in this experiment?A. All the male rats exhibited pathological behavior.B. Mother rats abandoned their pups.C. Female rats showed deviant maternal behavior.D. Mother rats left their rat babies alone.15. The main idea of the paragraph three is that __________.A. dominant males had adequate living spaceB. dominant males were not as seriously affected by overcrowding as the otherratsC. dominant males attacked weaker ratsD. the strongest males are always able to adapt to bad conditionsText DThe first mention of slavery in the statutes法令,法规of the English colonies of North America does not occur until after 1660—some forty years after the importation of the first Black people. Lest we think that existed in fact before it did in law, Oscar and Mary Handlin assure us, that the status of B lack people down to the 1660’s was that of servants. A critique批判of the Handlins’ interpretation of why legal slavery did not appear until the 1660’s suggests that assumptions about the relation between slavery and racial prejudice should be reexamined, and that explanation for the different treatment of Black slaves in North and South America should be expanded.The Handlins explain the appearance of legal slavery by arguing that, during the 1660’s, the position of white servants was improving relative to that of black servants. Thus, the Handlins contend, Black and White servants, heretofore treated alike, each attained a different status. There are, however, important objections to this argument. First, the Handlins cannot adequately demonstrate that t he White servant’s position was improving, during and after the 1660’s; several acts of the Maryland and Virginia legislatures indicate otherwise. Another flaw in the Handlins’ interpretation is their assumption that prior to the establishment of legal slavery there was no discrimination against Black people. It is true that before the 1660’s Black people were rarely called slaves. But this shouldnot overshadow evidence from the 1630’s on that points to racial discrimination without using the term slavery. Such discrimination sometimes stopped short of lifetime servitude or inherited status—the two attributes of true slavery—yet in other cases it included both. The Handlins’ argument excludes the real possibility that Black people in the English colonies were never treated as the equals of White people.The possibility has important ramifications后果,影响.If from the outset Black people were discriminated against, then legal slavery should be viewed as a reflection and an extension of racial prejudice rather than, as many historians including the Handlins have argued, the cause of prejudice. In addition, the existence of discrimination before the advent of legal slavery offers a further explanation for the harsher treatment of Black slaves in North than in South America. Freyre and Tannenbaum have rightly argued that the lack of certain traditions in North America—such as a Roman conception of slavery and a Roman Catholic emphasis on equality— explains why the treatment of Black slaves was more severe there than in the Spanish and Portuguese colonies of South America. But this cannot be the whole explanation since it is merely negative, based only on a lack of something. A more compelling令人信服的explanation is that the early and sometimes extreme racial discrimination in the English colonies helped determine the particular nature of the slavery that followed. (462 words)16. Which of the following is the most logical inference to be drawn from the passage about the effects of “several acts of the Maryland and Virginia legislatures” (Para.2) passed during and after the 1660‟s?A. The acts negatively affected the pre-1660’s position of Black as wellas of White servants.B. The acts had the effect of impairing rather than improving theposition of White servants relative to what it had been before the 1660’s.C. The acts had a different effect on the position of white servants thandid many of the acts passed during this time by the legislatures of other colonies.D. The acts, at the very least, caused the position of White servants toremain no better than it had been before the 1660’s.17. With which of the following statements regarding the status ofBlack people in the English colonies of North America before the 1660‟s would the author be LEAST likely to agree?A. Although black people were not legally considered to be slaves,they were often called slaves.B. Although subject to some discrimination, black people had a higherlegal status than they did after the 1660’s.C. Although sometimes subject to lifetime servitude, black peoplewere not legally considered to be slaves.D. Although often not treated the same as White people, black people,like many white people, possessed the legal status of servants.18. According to the passage, the Handlins have argued which of thefollowing about the relationship between racial prejudice and the institution of legal slavery in the English colonies of North America?A. Racial prejudice and the institution of slavery arose simultaneously.B. Racial prejudice most often the form of the imposition of inheritedstatus, one of the attributes of slavery.C. The source of racial prejudice was the institution of slavery.D. Because of the influence of the Roman Catholic Church, racialprejudice sometimes did not result in slavery.19. The passage suggests that the existence of a Roman conception ofslavery in Spanish and Portuguese colonies had the effect of _________.A. extending rather than causing racial prejudice in these coloniesB. hastening the legalization of slavery in these colonies.C. mitigating some of the conditions of slavery for black people in these coloniesD. delaying the introduction of slavery into the English colonies20. The author considers the explanation put forward by Freyre andTannenbaum for the treatment accorded B lack slaves in the English colonies of North America to be _____________.A. ambitious but misguidedB. valid有根据的but limitedC. popular but suspectD. anachronistic过时的,时代错误的and controversialUNIT 2Text AThe sea lay like an unbroken mirror all around the pine-girt, lonely shores of Orr’s Island. Tall, kingly spruce s wore their regal王室的crowns of cones high in air, sparkling with diamonds of clear exuded gum流出的树胶; vast old hemlocks铁杉of primeval原始的growth stood darkling in their forest shadows, their branches hung with long hoary moss久远的青苔;while feathery larches羽毛般的落叶松,turned to brilliant gold by autumn frosts, lighted up the darker shadows of the evergreens. It was one of those hazy朦胧的, calm, dissolving days of Indian summer, when everything is so quiet that the fainest kiss of the wave on the beach can be heard, and white clouds seem to faint into the blue of the sky, and soft swathing一长条bands of violet vapor make all earth look dreamy, and give to the sharp, clear-cut outlines of the northern landscape all those mysteries of light and shade which impart such tenderness to Italian scenery.The funeral was over,--- the tread鞋底的花纹/ 踏of many feet, bearing the heavy burden of two broken lives, had been to the lonely graveyard, and had come back again,--- each footstep lighter and more unconstrained不受拘束的as each one went his way from the great old tragedy of Death to the common cheerful of Life.The solemn black clock stood swaying with its eternal ―tick-tock, tick-tock,‖ in the kitchen of the brown house on Orr’s Island. There was there that sense of a stillness that can be felt,---such as settles down on a dwelling住处when any of its inmates have passed through its doors for the last time, to go whence they shall not return. The best room was shut up and darkened, with only so much light as could fall through a little heart-shaped hole in the window-shutter,---for except on solemn visits, or prayer-meetings or weddings, or funerals, that room formed no part of the daily family scenery.The kitchen was clean and ample, hearth灶台, and oven on one side, and rows of old-fashioned splint-bottomed chairs against the wall. A table scoured to snowy whiteness, and a little work-stand whereon lay the Bible, the Missionary Herald, and the Weekly Christian Mirror, before named, formed the principal furniture. One feature, however, must not be forgotten, ---a great sea-chest水手用的储物箱,which had been the companion of Zephaniah through all the countries of the earth. Old, and battered破旧的,磨损的, and unsightly难看的it looked, yet report said that there was good store within which men for the most part respect more than anything else; and, indeed it proved often when a deed of grace was to be done--- when a woman was suddenly made a widow in a coast gale大风,狂风, or a fishing-smack小渔船was run down in the fogs off the banks, leaving in some neighboring cottage a family of orphans,---in all such cases, the opening of this sea-chest was an event of good omen 预兆to the bereaved丧亲者;for Zephaniah had a large heart and a large hand, and was apt有…的倾向to take it out full of silver dollars when once it went in. So the ark of the covenant约柜could not have been looked on with more reverence崇敬than the neighbours usually showed to Captain Pennel’s sea-chest.1. The author describes Orr‟s Island in a(n)______way.A.emotionally appealing, imaginativeB.rational, logically preciseC.factually detailed, objectiveD.vague, uncertain2.According to the passage, the “best room”_____.A.has its many windows boarded upB.has had the furniture removedC.is used only on formal and ceremonious occasionsD.is the busiest room in the house3.From the description of the kitchen we can infer that thehouse belongs to people who_____.A.never have guestsB.like modern appliancesC.are probably religiousD.dislike housework4.The passage implies that_______.A.few people attended the funeralB.fishing is a secure vocationC.the island is densely populatedD.the house belonged to the deceased5.From the description of Zephaniah we can see thathe_________.A.was physically a very big manB.preferred the lonely life of a sailorC.always stayed at homeD.was frugal and saved a lotText BBasic to any understanding of Canada in the 20 years after the Second World War is the country' s impressive population growth. For every three Canadians in 1945, there were over five in 1966. In September 1966 Canada's population passed the 20 million mark. Most of this surging growth came from natural increase. The depression of the 1930s and the war had held back marriages, and the catching-up process began after 1945. The baby boom continued through the decade of the 1950s, producing a population increase of nearly fifteen percent in the five years from 1951 to 1956. This rate of increase had been exceeded only once before in Canada's history, in the decade before 1911 when the prairies were being settled. Undoubtedly, the good economic conditions of the 1950s supported a growth in the population, but the expansion also derived from a trend toward earlier marriages and an increase in the average size of families; In 1957 the Canadian birth rate stood at 28 per thousand, one of the highest in the world. After the peak year of 1957, thebirth rate in Canada began to decline. It continued falling until in 1966 it stood at the lowest level in 25 years. Partly this decline reflected the low level of births during the depression and the war, but it was also caused by changes in Canadian society. Young people were staying at school longer, more women were working; young married couples were buying automobiles or houses before starting families; rising living standards were cutting down the size of families. It appeared that Canada was once more falling in step with the trend toward smaller families that had occurred all through theWestern world since the time of the Industrial Revolution. Although the growth in Canada’s population had slowed down by 1966 (the cent), another increase in the first half of the 1960s was only nine percent), another large population wave was coming over the horizon. It would be composed of the children of the children who were born during the period of the high birth rate prior to 1957.6. What does the passage mainly discuss?A. Educational changes in Canadian society.B. Canada during the Second World War.C. Population trends in postwar Canada.D. Standards of living in Canada.7. According to the passage, when did Canada's baby boom begin?A. In the decade after 1911.B. After 1945.C. During the depression of the 1930s.D. In 1966.8. The author suggests that in Canada during the 1950s____________.A. the urban population decreased rapidlyB. fewer people marriedC. economic conditions were poorD. the birth rate was very high9. When was the birth rate in Canada at its lowest postwar level?A. 1966.B. 1957.C. 1956.D. 1951.10. The author mentions all of the following as causes of declines inpopulation growth after 1957 EXCEPT_________________.A. people being better educatedB. people getting married earlierC. better standards of livingD. couples buying houses11.I t can be inferred from the passage that before the IndustrialRevolution_______________.A. families were largerB. population statistics were unreliableC. the population grew steadilyD. economic conditions were badText CI was just a boy when my father brought me to Harlem for the first time, almost 50 years ago. We stayed at the hotel Theresa, a grand brick structure at 125th Street and Seventh avenue. Once, in the hotel restaurant, my father pointed out Joe Louis. He even got Mr. Brown, the hotel manager, to introduce me to him, a bit punchy强力的but still champ焦急as fast as I was concerned.Much has changed since then. Business and real estate are booming. Some say a new renaissance is under way. Others decry责难what they see as outside forces running roughshod肆意践踏over the old Harlem. New York meant Harlem to me, and as a young man I visited it whenever I could. But many of my old haunts are gone. The Theresa shut down in 1966. National chains that once ignored Harlem now anticipate yuppie money and want pieces of this prime Manhattan real estate. So here I am on a hot August afternoon, sitting in a Starbucks that two years ago opened a block away from the Theresa, snatching抓取,攫取at memories between sips of high-priced coffee. I am about to open up a piece of the old Harlem---the New York Amsterdam News---when a tourist。
我最喜欢的课程是数学英语作文60词
数学之美:我的最爱Mathematics, the queen of sciences, has always fascinated me. Its elegance and precision are what draw me into its realm, where logic and creativity coalesce into beautiful theorems and proofs. From the simplicity of arithmetic to the complexity of differential equations,math offers a window into the universe of possibilities.My journey with math began as a child, when I was introduced to the basics of counting and addition. As Igrew older, the subjects became more intricate, but thethrill of unlocking mysteries never faded. Each new concept, whether it was geometry, algebra, or calculus, was a new adventure that expanded my horizons.The beauty of math lies in its universality. It is the language of science, engineering, finance, and even art.Its principles underlie the design of bridges, the analysis of economic trends, and the creation of computer algorithms. Math is not just a subject; it is a way of thinking that helps us make sense of the world.In the classroom, math is my sanctuary. It's where I can lose myself in a world of symbols and equations, where the only limit is my imagination. Solving mathematical problems is like solving puzzles, and the sense of accomplishment when I find the answer is unparalleled.Moreover, math has taught me the importance of perseverance. It's a subject that requires dedication and practice, and the rewards are often not immediate. But with every struggle and every mistake, I learn something new about myself and about the universe.In conclusion, my love for math is not just a passion; it is a way of life. It shapes my thinking, challenges my boundaries, and brings me joy and fulfillment. Mathematics, to me, is not just a subject; it is a journey of discovery and understanding.**数学的魅力:我的最爱**数学,这门科学的女王,一直让我着迷。
A complete classification of the complexity of propositional abduction
1
2
ห้องสมุดไป่ตู้
N. CREIGNOU AND B. ZANUTTINI
abduction problem. Another application is configuration [1], and still another one is text interpretation [16]. Abduction has also been studied with temporal knowledge bases [4]. Closer to the reasoning processes themselves, abduction is a fundamental part of the CMS/ATMS [24], and it has many relations with default reasoning [26]. From a complexity-theoretic point of view, abduction is in general very hard, since in its full generality propositional abduction as a decision problem is ΣP 2 -complete; that is to say, it is at the second level of the polynomial hierarchy. However many restrictions on the syntactic form of the knowledge base have been identified that make the problem easier, even polynomial for some of them: 2CNF and monotone knowledge bases (see, e.g., [20]), definite Horn CNF [26, 11] and affine [28] bases, CNF bases with unit-refutable pseudo-completion [14] or with bounded kernel width [10], Horn bases given by their characteristic models [19] and some classes of DNF bases [28]. Among those restrictions some impose local properties to the knowledge bases, such as being in definite Horn CNF, and some impose global properties, such as being in Hornrenamable DNF or having a unit-refutable pseudo-completion. Our work takes place in the framework of propositional classes of formulas defined by local properties. More precisely, we investigate the computational complexity of propositional abduction in Schaefer’s framework. This now famous framework consists in considering propositional formulas in generalized conjunctive form. These formulas are conjunctions of constraints built over a fixed finite set L of Boolean relations. In his seminal paper [25], Schaefer studied the computational complexity of the satisfiability problem in this setting, sat(L), and established a dichotomy theorem which asserts that for each finite set of relations L, sat(L) is either NP-complete or in P. In a nutshell, Schaefer’s dichotomy theorem asserts that there are exactly four (nontrivial) polynomial time cases of sat(L): every relation in L is bijunctive; every relation in L is Horn; every relation in L is dual Horn; every relation in L is affine. Moreover, this dichotomy is polynomial-time decidable, that is, there is a polynomial time algorithm that, given a finite set of Boolean relations L, decides whether sat(L) is NP-complete or in P. Our main contribution is a trichotomy theorem for the computational complexity of propositional abduction (seen as a decision problem) in Schaefer’s framework. We consider that hypotheses are the terms formed upon a given set of variables, and that queries are given by a single positive literal. In this framework, we prove that depending on the set of relations L the abduction problem is either polynomial or NP-complete or ΣP 2 -complete. More precisely, we show that the abduction problem with positive queries is: polynomial-time solvable if every relation in the language is bijunctive, affine, definite Horn, IHS-B − or IHS-B +1 ; otherwise, NP-complete if the language is Horn or dual Horn; and finally, ΣP 2 -complete in every other case. The first essential difference from Schaefer’s dichotomy theorem is that, unlike the satisfiability problem, the abduction problem for Horn relations and for dual Horn relations need not to be in P. Instead, the abduction problem is in P for certain classes of Horn relations (namely definite Horn, IHS-B −) and for certain classes of dual Horn relations (namely IHS-B +), while it is NP-complete for all other classes of Horn relations and all other classes of dual Horn relations. Furthermore, the abduction problem is ΣP 2 -complete for every finite set of relations for which the satisfiability is NP-complete. From this result we derive two additional trichotomy results by considering the variants of abduction in which the query to be explained is a negative literal, or an
有关于数学归纳法的英文文献
有关于数学归纳法的英文文献Mathematical induction is a powerful and fundamental proof technique used in mathematics to establish the truth of statements or propositions that involve natural numbers. It is a deductive reasoning method that allows one to prove that a given statement is true for all natural numbers, starting from a base case and then showing that if the statement is true for a particular natural number, then it is also true for the next natural number.The essence of mathematical induction lies in the fact that the natural numbers form an ordered set with a well-defined starting point, the number 1, and a clear successor relationship, where each natural number has a unique next number. This structure allows us to build up proofs by starting with the base case and then demonstrating that the statement holds for the next number, and so on, until we can conclude that the statement is true for all natural numbers.The general structure of a mathematical induction proof consists of two main steps:1. Base case: Establish that the statement is true for the first natural number, typically 1.2. Inductive step: Assume that the statement is true for a particular natural number k, and then show that it is also true for the next natural number, k+1.Once these two steps are completed, the principle of mathematical induction allows us to conclude that the statement is true for all natural numbers.One of the key advantages of mathematical induction is its ability to handle statements that involve an infinite number of cases, such as those related to sequences, series, or properties of natural numbers. By proving the statement for the base case and then showing that it holds for the next number, we can establish the truth of the statement for all natural numbers, even though there are infinitely many of them.Mathematical induction has a wide range of applications in various branches of mathematics, including number theory, combinatorics, algorithm analysis, and even in some areas of computer science and physics. It is a fundamental tool for proving the correctness of algorithms, establishing properties of recursive data structures, and solving problems that involve the manipulation of natural numbers.One classic example of the application of mathematical induction is the proof of the formula for the sum of the first n positive integers, which states that the sum of the first n positive integers is equal to n(n+1)/2. To prove this formula using induction, we first establish the base case by showing that the statement is true for n=1, as 1(1+1)/2 = 1. Then, we assume that the statement is true for some natural number k, and we show that it is also true for the next natural number, k+1, by using the following steps:Assume the statement is true for n=k:Sum of the first k positive integers = k(k+1)/2Now, consider the sum of the first k+1 positive integers:Sum of the first k+1 positive integers = 1 + 2 + 3 + ... + k + (k+1)= (k(k+1)/2) + (k+1)= (k(k+1) + 2(k+1))/2= (k^2 + 3k + 2)/2= (k+1)(k+2)/2Therefore, the statement is also true for n=k+1. By the principle of mathematical induction, we can conclude that the formula for the sum of the first n positive integers is true for all natural numbers n.Another important application of mathematical induction is in thefield of algorithm analysis, where it is used to prove the correctness and runtime complexity of algorithms. For example, when analyzing the time complexity of a recursive algorithm, we can use induction to show that the algorithm's running time grows in a certain way as the input size increases.Consider the classic Fibonacci sequence, where each number in the sequence is the sum of the two preceding numbers, starting with 0 and 1. We can use mathematical induction to prove that the nth Fibonacci number can be calculated using the formula F(n) = (phi^n - psi^n) / sqrt(5), where phi = (1 + sqrt(5))/2 and psi = (1 - sqrt(5))/2.To prove this formula, we first establish the base cases for n=0 and n=1, where the formula holds true. Then, we assume that the formula holds for some natural number k, and we show that it also holds for the next number, k+1, by using the recursive definition of the Fibonacci sequence and some algebraic manipulations.Through this inductive argument, we can conclude that the formula for the nth Fibonacci number is valid for all natural numbers n.In addition to its applications in mathematics and computer science, mathematical induction has also found uses in other fields, such as physics and engineering. For example, in the study of the properties of materials, induction can be used to prove that a certain materialproperty holds true for all atoms or molecules in a system, starting from the base case of a single atom or molecule and then showing that the property extends to the next atom or molecule.Overall, mathematical induction is a powerful and versatile proof technique that allows us to establish the truth of statements involving natural numbers. Its ability to handle infinite cases and its applications in various domains make it an essential tool in the mathematician's and scientist's toolkit.。
功能点数与复杂度之间的对应关系
功能点数与复杂度之间的对应关系一、概述功能点数和复杂度是软件开发过程中常用的两个指标,它们之间有着密切的关系。
在软件开发中,我们经常会遇到这样的问题:增加功能点是否会增加软件的复杂度?软件的复杂度又是如何影响功能点的开发和维护呢?本文将从功能点数和复杂度的定义、计算方法以及对应关系等方面进行探讨。
二、功能点数的定义和计算方法1. 功能点数的定义功能点数是指软件中包含的功能模块的数量。
常见的功能模块包括用户界面、数据输入、数据输出、数据管理等。
功能点数可以用来衡量软件的规模和复杂度,是评估软件工作量和成本的重要指标。
2. 功能点数的计算方法功能点数的计算方法有多种,其中最常用的是IFPUG(International Function Point Users Group)的方法。
IFPUG方法主要包括以下步骤:(1)识别功能类型:将软件中的功能模块分为不同的类型,如输入、输出、查询、文件接口等。
(2)计算功能点数:根据功能模块的类型和复杂度,计算每个功能模块的功能点数。
(3)汇总功能点数:将所有功能模块的功能点数汇总,得到软件的总功能点数。
三、复杂度的定义和计算方法1. 复杂度的定义复杂度是指软件中的逻辑结构或控制流的复杂程度。
常见的软件复杂度包括代码复杂度、数据结构复杂度、算法复杂度等。
复杂度可以用来衡量软件的难以理解和维护程度,是评估软件质量的重要指标。
2. 复杂度的计算方法复杂度的计算方法因复杂度类型的不同而有所差异。
以代码复杂度为例,常用的计算方法包括圈复杂度和路径复杂度。
圈复杂度是指程序中独立路径的数量,是衡量程序控制流程复杂度的指标;路径复杂度是指程序中所有可能路径的数量,是衡量程序结构复杂度的指标。
四、功能点数与复杂度的对应关系1. 增加功能点是否会增加复杂度?在一定程度上,增加功能点可能会增加软件的复杂度。
因为功能点的增加通常会导致软件中的控制流程、数据处理等方面的增加,从而导致软件的复杂度提高。
THE COMPLEXITY OF TREE AUTOMATA AND LOGICS OF PROGRAMS
THE COMPLEXITY OF TREE AUTOMATA AND LOGICS OFPROGRAMS ∗E.ALLEN EMERSON †AND CHARANJIT S.JUTLA ‡SIAM J.C OMPUT .c1999Society for Industrial and Applied Mathematics Vol.29,No.1,pp.132–158Abstract.The complexity of testing nonemptiness of finite state automata on infinite trees is investigated.It is shown that for tree automata with the pairs (or complemented pairs)acceptance condition having m states and n pairs,nonemptiness can be tested in deterministic time (mn )O (n );however,it is shown that the problem is in general NP-complete (or co-NP-complete,respectively).The new nonemptiness algorithm yields exponentially improved,essentially tight upper bounds for numerous important modal logics of programs,interpreted with the usual semantics over structures generated by binary relations.For example,it follows that satisfiability for the full branching time logic CTL ∗can be tested in deterministic double exponential time.Another consequence is that satisfiability for propositional dynamic logic (PDL)with a repetition construct (PDL-delta)and for the propositional Mu-calculus (Lµ)can be tested in deterministic single exponential time.Key plexity,tree automata,logics of programs,gamesAMS subject classifications.68Q68,68Q60,03B45PII.S00975397933047411.Introduction.There has been a resurgence of interest in automata on infinite objects [1]due to their intimate relation with temporal and modal logics of programs.They provide an important and uniform approach to the development of decision procedures for testing satisfiability of the propositional versions of these logics [43,33].Such logics and their corresponding decision procedures are not only of inherent mathematical interest,but are also potentially useful in the specification,verification,and synthesis of concurrent programs (cf.[27,8,25,21]).In the case of branching time temporal logic,the standard paradigm nowadays for testing satisfiability is the reduction to the nonemptiness problem for finite state au-tomata on infinite trees;i.e.,one builds a tree automaton which accepts essentially all models of the candidate formula and then tests nonemptiness of the tree automaton.Thus in order to improve the complexity there are two issues:(1)the size of the tree automaton and (2)the complexity of testing nonemptiness of the tree automaton.In this paper we obtain new,improved,and essentially tight bounds on testing nonemptiness of tree automata that allow us to close an exponential gap which has existed between the upper and lower bounds of the satisfiability problem of numerous important modal logics of programs.These logics include CTL ∗(the full branch-ing time logic [9]),PDL-delta (propositional dynamic logic with an infinite repetition construct [33]),and the propositional Mu-calculus (Lµ)(a language for characterizing temporal correctness properties in terms of extremal fixpoints of predicate transform-ers [19](cf.[7,2])).∗Receivedby the editors August 15,1993;accepted for publication (in revised form)April 30,1997;published electronically September 14,1999.This work was supported in part by NSF grants CCR-941-5496and CCR-980-4736,ONR URI contract N00014-86-K-0763,and Netherlands NWO grant nf-3/nfb 62-500./journals/sicomp/29-1/30474.html †Department of Computer Sciences,University of Texas at Austin,Austin,TX 78712(emerson @),and Mathematics and Computing Science Department,Eindhoven University of Technology,Eindhoven 5600MB,The Netherlands.‡IBM T.J.Watson Research Center,Yorktown Heights,NY 10598-0218(csjutla@).132COMPLEXITY OF TREE AUTOMATA133 To obtain these improvements,we focus on the complexity of testing nonemptiness of tree automata.Wefirst note,however,that the size of an automaton has two parameters:the number of states in the automaton’s transition diagram and the number of pairs in its acceptance condition.We next make the following important observation:for most logics of programs,the number of pairs is logarithmic in the number of states.We go on to analyze the complexity of testing nonemptiness of pairs tree automata [30]and show that it is NP-complete.However,a multiparameter analysis shows that there is an algorithm that runs in time(mn)O(n)which is polynomial in the number of states m and exponential in the number of pairs n in the acceptance condition of the automaton.The algorithm is based on a type of“pseudomodel checking”for certain restricted Mu-calculus formulae.Moreover,since the problem is NP-complete, it is unlikely to have a better algorithm which is polynomial in both parameters.The previous best known algorithm was in NP[6,41].The above nonemptiness algorithm now permits us to obtain a deterministic dou-ble exponential time decision procedure for CTL∗,by using the reduction from CTL∗to tree automata obtained in[13],in which the size of the automaton is double ex-ponential in the length of the formula and the number of pairs is only exponential in the length of the formula.The bound follows by simple arithmetic,since a double exponential raised to a single exponential power is still a double exponential.This amounts to an exponential improvement over the best previously known algorithm which was in nondeterministic double exponential time[6,41],i.e.,three exponentials when determinized.It is also essentially tight,since CTL∗was shown to be double exponential time hard[41];thus CTL∗is deterministic double exponential time complete.The above result has been obtained using only the classical pairs tree automata of Rabin[30].However,we also consider the complemented pairs tree automata of Streett[33],which were specifically introduced to facilitate formulation of tempo-ral decision procedures.We show that the nonemptiness problem of complemented pairs automata is co-NP-complete by reducing the complement of the problem to nonemptiness of the pairs automata and vice versa.The reduction employs the fact that infinite Borel games are determinate(Martin’s theorem[22]).This reduction also gives a deterministic algorithm which is polynomial in the number of states and exponential in the number of pairs.We can thus reestablish the above upper bound for CTL∗using complemented pairs automata as well.Using the recent single exponential general McNaughton[23]construction of Safra [32](i.e.,construction for determinizing a B¨u chifinite automaton on infinite strings), our new nonemptiness algorithm also gives us a deterministic single exponential time decision procedure for both PDL-delta and the Mu-calculus,since the Safra construc-tion allows us to reduce satisfiability of these logics to testing nonemptiness of a tree automaton with exponentially many states and polynomially many pairs.This rep-resents an exponential improvement over the best known deterministic algorithms for these logics,which took deterministic double exponential time,corresponding to the nondeterministic exponential time upper bounds of[41].The bounds are essentially tight also,since the exponential time lower bound follows from that established for ordinary PDL by Fischer and Ladner[14].It is interesting to note that for most logics(including PDL-delta and the Mu-calculus but excluding CTL∗),our nonemptiness algorithm(s)and Safra’s construc-tion both play a crucial role.Each is independent of the other.Moreover,each is134 E.ALLEN EMERSON AND CHARANJIT S.JUTLAneeded and neither alone suffices.Our algorithm improves the complexity of testing nonemptiness by an exponential factor,while Safra’s construction independently ap-plies to reduce the size of the automaton by an exponential factor.For example,the “traditional”result of Streett[33]gave a deterministic triple exponential algorithm for PDL-delta.Our algorithm alone improves it to deterministic double exponential time.Alternatively,Safra’s construction alone improves it to deterministic double exponential time.As shown in this paper,the constructions can be applied together to get a cumulative double exponential speedup for PDL-delta.In the case of CTL∗, we already had the effect of Safra’s construction,because[13]gave a way to determine with only a single exponential blowup the B¨u chi string automaton corresponding to a linear temporal logic formula by using the special structure of such automata(unique accepting run).Thus Safra’s construction provides no help for the complexity of the CTL∗logic.The remainder of the paper is organized as follows.In section2we give prelimi-nary definitions and terminology.In section3we establish a“small model theorem”for(pairs)tree automata.In section4we give the main technical results on test-ing nonemptiness of pairs tree automata.In section5we give the main results on nonemptiness of complemented pairs tree automata.Applications of the algorithms to testing satisfiability of modal logics of programs,including CTL∗,PDL-delta,and the Mu-calculus,are described in section6.Some concluding remarks are given in section7.2.Preliminaries.2.1.Logics of programs.2.1.1.Full branching time logic.The full branching time logic CTL∗[9]de-rives its expressive power from the freedom of combining modalities which quantify over paths and modalities which quantify states along a particular path.These modal-ities are A,E,F,G,X s,and U w(“for all futures,”“for some future,”“sometime,”“always,”“strong nexttime,”and“weak until,”respectively),and they are allowed to appear in virtually arbitrary combinations.Formally,we inductively define a class of state formulae(true or false of states)and a class of path formulae(true or false of paths):(S1)Any atomic proposition P is a state formula.(S2)If p,q are state formulae,then so are p∧q,¬p.(S3)If p is a path formula,then Ep is a state formula.(P1)Any state formula p is also a path formula.(P2)If p,q are path formulae,then so are p∧q,¬p.(P3)If p,q are path formulae,then so are X s p and pU w q.The semantics of a formula are defined with respect to a structure M=(S,R,L), where S is a nonempty set of states,R is a nonempty binary relation on S,and L is a labeling which assigns to each state a set of atomic propositions true in the state.A fullpath(s1,s2,...)is a maximal sequence of states such that(s i,s i+1)∈R for all i.A fullpath is infinite unless for some s k there is no s k+1such that(s k,s k+1)∈R. We write M,s|=p(M,x|=p)to mean that state formula p(path formula p)is true in structure M at state s(of fullpath x,respectively).When M is understood,we write simply s|=p(x|=p).We define|=inductively using the convention that x=(s1,s2,...)denotes a fullpath and x i denotes the suffix fullpath(s i,s i+1,...), provided i≤|x|,where|x|,the length of x,isωwhen x is infinite and k when x is finite and of the form(s1,...,s k);otherwise x i is undefined.COMPLEXITY OF TREE AUTOMATA 135For a state s ,(S1)s |=P iffP ∈L (s )for atomic proposition P ,(S2)s |=p ∧q iffs |=p and s |=q ,s |=¬p iffnot (s |=p ),(S3)s |=Ep ifffor some fullpath x starting at s ,x |=p .For a fullpath x =(s 1,s 2,...),(P1)x |=p iffs 1|=p for any state formula p ,(P2)x |=p ∧q iffx |=p and x |=q ,x |=¬p iffnot (x |=p ),(P3)x |=X s p iffx 2is defined and x 2|=p ,x |=(p U w q )ifffor all i ∈[1:|x |],if for all j ∈[1:i ]x j |=¬q ,then x i |=p .We say that state formula p is valid ,and write |=p ,if for every structure M and every state s in M ,M,s |=p .We say that state formula p is satisfiable ifffor some structure M and some state s in M ,M,s |=p .In this case we also say that M defines a model of p .We define validity and satisfiability for path formulae similarly.We write f .=g to mean that formula f abbreviates formula g .Other connectives can then be defined as abbreviations in the usual way:p ∨q .=¬(¬p ∧¬q ),p ⇒q .=¬p ∨q ,p ⇔q .=(p ⇒q )∧(q ⇒p ),Ap .=¬E ¬p ,Gp .=p U w false ,and F p .=¬G ¬p .Further operators may also be defined as follows:X w p .=¬X s ¬p is the weak nexttime,pU s q .=(pU w q )∧F q is the strong until,∞F p .=GF X s p means infinitely often p ,∞G p .=F GX s p means almost everywhere p ,inf .=GX s true means the path is infinite,and fin .=F X w false means the path is finite.2.1.2.Propositional dynamic logic plus repeat.As opposed to CTL ∗,in which the models represent behaviors of the programs,in PDL-delta the programs are explicit in the models.The modalities in PDL-delta quantify the states reachable by programs explicitly stated in the modality.Thus,for a program B (which is obtained from atomic programs and tests using regular expressions), B p ([B ]p )states that there is an execution of B leading to p (after all executions of B ,p holds).Also included is the infinite repetition construct delta (△)which makes PDL-delta much more expressive than PDL.△B states that it is possible to execute B repetitively infinitely many times.PDL-delta formulae are interpreted over structures M =(S,R,L ),where S is a set of states,R :P rog →2S ×S is a transition relation,P rog is the set of atomic programs,and L is a labeling of S with propositions in P rop .For more details see [33].2.1.3.Propositional Mu-calculus.A least fixpoint construct can be used to increase the power of simple modal logics.Thus,by adding this construct to PDL,we get Lµ,the propositional Mu-calculus [19],a logic which subsumes PDL-delta.A variant formulation of the Mu-calculus,which we use here,adds the least fixpoint construct to a simple subset of CTL ∗,including just nexttime (AX s ),the boolean connectives,and propositions (cf.[7]).The least fixpoint construct has the syntax µY.f (Y ),where f (Y )is any formula syntactically monotone in the propositional vari-able Y ,i.e.,all occurrences of Y in f (Y )fall under an even number of negations.It is interpreted as the smallest set S of states such that S =f (S ).By the well-known Tarski–Knaster theorem,µY.f (Y )= i f i (false),where i ranges over all ordinals and f i (intuitively)denotes the i -fold composition of f with itself;when the domain136 E.ALLEN EMERSON AND CHARANJIT S.JUTLAisfinite we may take i as ranging over just the natural numbers.Its dual,the greatest fixpoint,is denotedνY.f(Y)(≡¬µY.¬f(¬Y)).Thus,e.g.,µY.[B]Y is equivalent to ¬△B of PDL-delta.Similarly,using temporal logic,µY.P∨AX s Y is equivalent to AF P(i.e.,along all paths P eventually holds).Many correctness properties of con-current programs can be characterized in terms of the Mu-calculus,including all those expressible in CTL∗and PDL-delta.For more details,see,for example,[7,19,35,12].The formulae of the(propositional)Mu-calculus are(1)propositional constants P,Q,...,(2)propositional variables Y,Z,...,(3)¬p,p∨q,and p∧q,where p and q are any formulae,(4)EX s p and AX s p,where p is any formula,(5)µY.f(Y)andνY.f(Y),where f(Y)is any formula syntactically monotone in the propositional variable Y,i.e.,all occurrences of Y in f(Y)fall under even number of negations.In what follows,we will useσas a generic symbol forµorν.In afixed point expressionσY.f(Y),we say that each occurrence of Y is bound toσY.If an occurrence of Y is not bound,then it is free.A sentence(or closed formula)is a formula containing no free propositional variables,i.e.,no variables unbound by aµor aνoperator.Sentences are interpreted over structures M=(S,R,L)as for CTL∗.As usual we will write M,s|=p to mean that in structure M at state s sentence p holds true. To give the technical definition of|=we need some preliminaries.The power set of S,2S,may be viewed as the complete lattice(2S,S,φ,⊆,∪,∩). Intuitively,we identify a proposition with the set of states which make it true.Thus, false,which corresponds to the empty set,is the bottom element,true,which cor-responds to S,is the top element,∪is join,∩is meet,and implication(for all s∈S(P(s)⇒Q(s))),which corresponds to simple set-theoretic containment(P⊆Q), provides the partial ordering on the lattice.Letτ:2S→2S be given;then we say thatτis monotonic provided P⊆Q implies τ(P)⊆τ(Q).A monotonic functionalτalways has both a leastfixpointµX.τ(X) and a greatestfixpointνX.τ(X).For a formula or function p(Y),we write p0(Y)=false,p1(Y)=p(Y), p i+1(Y)=p(p i)(Y)for successor ordinal i+1,and p j(Y)= k<j p k(Y)for limit ordinal j.Theorem2.1(Tarski–Knaster).Letτ:2S→2S be a given monotonic functional. Then(a)µY.τ(Y)= {Y:τ(Y)=Y}= {Y:τ(Y)⊆Y},(b)νY.τ(Y)= {Y:τ(Y)=Y}= {Y:τ(Y)⊇Y},(c)µY.τ(Y)= i≤|S|τi(false),and(d)νY.τ(Y)= i≤|S|τi(true).A formula p with free variables Y0,Y1,...,Y n is thus interpreted as a mapping p M from(2S)n+1to2S,i.e.,it is interpreted as a predicate transformer.We write p(Y0,Y1,...,Y n)to denote that all free variables of p are among Y0,Y1,...,Y n.Let V0,V1,...,V n be subsets of S;then a valuationΥ=V0,V1,...,V n is an assignment of V0,V1,...,V n to the free variables Y0,Y1,...,Y n,respectively.Υ[Y i←V′i]denotes the valuation identical toΥ,except that Y i is assigned V′i.We use p M(Υ)to denote the value of p in structure M on the arguments V0,V1,...,V n.We drop M when it is understood from context.We then let M,s|=p(Υ)iffs∈p M(Υ),and we define |=inductively as follows:(1)s|=P(Υ)iffP∈L(s),COMPLEXITY OF TREE AUTOMATA137(2)s|=Y(Υ)iffs∈Υ(Y),(3)s|=(¬p)(Υ)iffs|=p(Υ),s|=(p∨q)(Υ)iffs|=p(Υ)or s|=q(Υ),s|=(p∧q)(Υ)iffs|=p(Υ)and s|=q(Υ),(4)s|=(EX s p)(Υ)iff∃t(s,t)∈R and t|=p(Υ),s|=(AX s p)(Υ)iff(a)∃u(s,u)∈R and u|=p and(b)for all t(s,t)∈R implies t|=p(Υ),(5)s|=(µY.f(Y))(Υ)iffs∈ {S′⊆S|S′={t:t|=f(Y)(Υ[Y←S′])}},s|=(νY.f(Y))(Υ)iffs∈ {S′⊆S|S′={t:t|=f(Y)(Υ[Y←S′])}}.2.1.4.Conventions.To avoid a proliferation of unnecessary parentheses,we order the connectives from greatest to lowest binding power as follows:¬binds tighter than F,G,X w,X s,∞F,∞G,which bind tighter than∧,which binds tighter than∨,which binds tighter than⇒,which binds tighter than U w,U s,which bind tighter than A,E, which bind tighter thanµ,ν,which bind tighter than⇔.If we write M,s|=p,it is implicit that s is a state of M.That is,s∈S where M=(S,R,L).A convenient abuse of notation is to write s∈M in some places.If p is a formula,then p M denotes{s:M,s|=p},the set of states s in M at which p is true.We can write M,s1,...,s k|=p to abbreviate M,s1|=p and...and M,s k|=p.We write p≡q for|=p⇔q.In the context of a structure M,we can also write p≡M q for p M=q M.If M is understood,then we can drop the M and write just p≡q.It should be clear from context whether equivalence over all structures or over M is meant.We use p1≡p2≡···≡p k as shorthand for p1≡p2and...and p k−1≡p k.Technically,we distinguish between an atomic proposition symbol P and the associated set,viz.,P M,of states which are labeled with it in structure M.It is often convenient notation to use the uppercase sans serif symbol P corresponding to P to denote the set of states that are labeled with P.Remark:We note the following identities:EX w false≡AX w false and asserts that a state has no successors.EX s true≡AX s true and asserts that a state has one or more successors.2.2.Automata on infinite trees.We considerfinite automata on labeled, infinite binary trees.1The set{0,1}∗may be viewed as an infinite binary tree,where the empty stringλis the root node and each node u has two successors:the0-successor u0and the1-successor u1.Afinite(infinite)path through the tree is a finite(respectively,infinite)sequence x=u0,u1,u2,...such that each node u i+1is a successor of node u i.IfΣis an alphabet of symbols,an infinite binaryΣ-tree is a labeling L which maps{0,1}∗−→Σ.Afinite automaton A on infinite binaryΣ-trees consists of a tuple(Σ,Q,δ,q0,Φ), whereΣis thefinite,nonempty input alphabet labeling the nodes of the input tree, Q is thefinite,nonempty set of states of the automaton,δ:Q×Σ→2Q×Q is the nondeterministic transition function,1We consider here only binary trees to simplify the exposition and for consistency with the classical theory of tree automata.CTL∗and the other logics we study have the property that their models can be unwound into an infinite tree.In particular,in[13]it was shown that a CTL∗formula of length k is satisfiable iffit has an infinite tree model withfinite branching bounded by k,i.e.,iffit is satisfiable over a k-ary tree.Our results on tree automata apply to such k-ary trees as explained at the end of the proof of Theorem4.1.138 E.ALLEN EMERSON AND CHARANJIT S.JUTLAq0∈Q is the start state of the automaton,andΦis an acceptance condition described subsequently.A run of A on the inputΣ-tree L is a functionρ:{0,1}∗→Q such that forall v∈{0,1}∗,(ρ(v0),ρ(v1))∈δ(ρ(v),L(v))andρ(λ)=q0.We say that A acceptsinput tree L iffthere exists a runρof A on L such that for all infinite paths x startingat the root of L if r=ρ◦x is the sequence of states A goes through along path x,then the acceptance conditionΦholds along r.For a pairs automaton(cf.[23,30])acceptance is defined in terms of afinite list((RED1,GREEN1),...,(RED k,GREEN k))of pairs of sets of automaton states(whichmay be thought of as pairs of colored lights where Aflashes the red light of thefirstpair upon entering any state of the set RED1,etc.):r satisfies the pairs conditioniffthere exists a pair i∈[1..k]such that RED iflashesfinitely often and GREEN iflashes infinitely often.We assume the pairs acceptance condition is given formallyby a temporal logic formulaΦ= i∈[1..k](GF GREEN i∧¬GF RED i).2Similarly,a complemented pairs(cf.[33])automaton has the negation of the pairs condition as itsacceptance condition;i.e.,for all pairs i∈[1..k],GREEN iflashes infinitely often impliesthat RED iflashes infinitely often,too.The complemented pairs acceptance conditionis given formally by a temporal logic formulaΦ= i∈[1:k]GF GREEN i⇒GF RED i.3.Small model theorems.3.1.Tree automata running on graphs.Note that an infinite binary tree L′may be viewed as a“binary”structure M=(S,R,L),where S={0,1}∗,R=R0∪R1 with R0={(s,s0):s∈S}and R1={(s,s1):s∈S},and L=L′.We could alternatively write M=(S,R0,R1,L).We can also define a notion of a tree automaton running on certain appropriatelylabeled binary,directed graphs that are not binary trees.Such graphs,if accepted,arewitnesses to the nonemptiness of tree automata.We make the following definitions.A binary structure M=(S,R0,R1,L)consists of a state set S and labeling L asbefore,plus a transition relation R0∪R1decomposed into two partial functions:R0:S−→S,where R0(s),when defined,specifies the0-successor of s,and R1:S−→S,where R1(s),when defined,specifies the1-successor of s.We say that M is a fullbinary structure iffR0and R1are total.A run of automaton A on binary structure M=(S,R0,R1,L),if it exists,is amappingρ:S→Q such that for all s∈S,(ρ(R0(s)),ρ(R1(s)))∈δ(ρ(s),L(s)),andρ(s0)=q0.Intuitively,a run is a labeling of M with states of A consistent withthe local structure of A’s transition diagram.It will turn out that if an automatonaccepts some binary tree,there does exist somefinite binary graph on which there isa run that is accepting:all of the paths through the graph define state sequences ofthe automaton meeting its acceptance condition.3.2.The transition diagram of a tree automaton.The transition diagram of A can be viewed as an AND/OR-graph,where the set Q of states of A comprises the set of OR-nodes,while the AND-nodes define the allowable moves of the automaton. Intuitively,OR-nodes indicate that a nondeterministic choice has to be made(depend-ing on the input label),while the AND-nodes force the automaton along all directions. For example,suppose that for automaton A,δ(s,a)={(t1,u1),...,(t m,u m)}and δ(s,b)={(v1,w1),...,(v n,w n)};then the transition diagram contains the portion shown in Figure3.1.2We are assuming that each proposition symbol,such as GREEN i,of formulaΦis associatedCOMPLEXITY OF TREE AUTOMATA 139b b a a Cs ¡¡¡¡ e e e e ¡¡¡ ¡¡¡ ¡¡¡ ¡¡¡ e e e e e e e e e e e e ......00001111s t 1t m u 1u m v 1w 1v n w n=OR-nodes (states of A)a =AND-nodes (transitions on a)Fig.3.1.Formally,given a tree automaton A =(Σ,Q,δ,q 0,Φ)with transition function δ:Q ×Σ−→2Q ×Q :(q,a )−→{(r 1,s 1),...,(r k ,s k )},we may view it as defining a transition diagram T ,which is an AND/OR-graph (D,C,R DC ,R CD 0,R CD 1,L ),whereD =Q is theset of OR-nodes;C = q ∈D a ∈Σ{((q,a ),(r,s )):(r,s )∈δ(q,a )}is the set of AND-nodes.Each AND-node corresponds to a transition.If δ(q,a )={(r 1,s 1),...,(r k ,s k )},then the corresponding AND-nodes are essentially the pairs (r 1,s 1),...,(r k ,s k ).How-ever,since each transition is associated with a unique current state/input symbol pair (q,a ),we formally define the corresponding AND-nodes to be pairs of pairs:((q,a ),(r 1,s 1)),...,((q,a ),(r k ,s k )).R DC ⊆D ×C specifies the AND-node successors of each OR-node.For each q ∈D as above,R DC (q )= a ∈Σ{((q,a ),(r,s )):(r,s )∈δ(q,a )};3R CD 0,R CD 1:C −→D are partial 4functions giving the 0-successor and 1-successor states,respectively:R CD 0(((q,a ),(r,s )))=r and R CD 1(((q,a ),(r,s )))=s ;L is a labeling of nodes.For an AND-node L (((q,a ),(r,s )))={a },where a ∈Σ.For an OR-node,the labeling assigns propositions associated with the acceptance condition Φso that all OR-nodes in the set GREEN i (respectively,RED i )are labeled with the corresponding proposition GREEN i (respectively,RED i ).with exactly the set of states of the corresponding name,in this case GREEN i .3We identify a relation such as R DC ⊆D ×C with the corresponding function R ′DC :D −→2C defined by R ′DC (d )={c ∈C :(d,c )∈R DC }for each d ∈D .4For classically defined tree automata,the functions R CD 0,R CD 1are total so that there is always a 0-successor and 1-successor automaton state.For technical reasons it is convenient to allow R CD 0,R CD 1to be partial.140 E.ALLEN EMERSON AND CHARANJIT S.JUTLAThus,we may write a tree automaton A in the form(T,d0,Φ),where T is the diagram,d0is the start state,andΦis an acceptance condition.3.3.One symbol alphabets.For purposes of testing nonemptiness,without loss of generality,we can restrict our attention to tree automata over a single letter al-phabet and,thereby,subsequently ignore the input alphabet.Let A=(Q,Σ,δ,q0,Φ) be a tree automaton over input alphabetΣ.Let A′=(Q,Σ′,δ′,q0,Φ)be the tree automaton over one letter input alphabetΣ′={c}obtained from A by,intuitively, taking the same transition diagram but now making all transitions on symbol c.For-mally,A′is identical to A except that the input alphabet isΣ′and the transition functionδ′is defined byδ′(q,c)= a∈Σδ(q,a).Observation3.1.The set accepted by A is nonempty iffthe set accepted by A′is nonempty.Henceforth,we shall therefore assume that we are dealing with tree automata over a one symbol alphabet.3.4.Generation and containment.It is helpful to reformulate the notion of run to take advantage of the AND/OR-graph organization of the transition diagram of an automaton.Intuitively,there is a run of diagram T on structure M provided M is“generated”from T by unwinding T so that each state of M is a copy of an OR-node of T.Formally,we say that a binary structure M=(S,R0,R1,L)is generated by a transition diagram T=(D,C,R DC,R CD0,R CD1,L T)(starting at s0∈S and d0∈D) iff∃is a total function h:S−→D such that for all s∈Sif s has any successors in M,then∃c∈R DC(h(s))for all i∈{0,1}R CDi(c)is defined iffR i(s)is defined andR CDi(c)=h(R i(s))when both are defined and L(s)=L T(h(s))(such that h(s0)=d0).We say that a binary structure M=(S,R0,R1,L)is contained in transition diagram T(starting at s0∈M and q0∈T)provided M is generated by T(starting at s0∈M and q0∈T),where the generation function h is the natural injection h:S−→D:s∈S−→s∈D,so that all states of M are OR-nodes of T.Note that if M is a structure generated by(respectively,contained in)T,there is an associated AND/OR-graph H generated by(respectively,contained in)T ob-tained from M by inserting between each state and its successors in M a copy of the AND-node that determines the successors of state via the generation function for M. We write H=ao(M).Conversely,if H is an AND/OR-graph generated by(respec-tively,contained in)T,there is an associated structure M generated by(respectively, contained in)T obtained from H by eliding AND-nodes.Here we write M=o(H).3.5.Linear size model theorems.The following theorem(cf.[6])is the basis of our method of testing nonemptiness of pairs automata.It shows that there is a small binary structure contained in the transition diagram and accepted by the automaton.Theorem3.2(linear size model theorem).Let A be a tree automaton over a one symbol alphabet with pairs acceptance conditionΦ= i∈[1:k](∞F Q i∧∞G P i).Then automaton A accepts some tree T iffA accepts some binary model M of size linear in the size of A,which is a structure contained in the transition diagram of A.。
我想要数学的作文英语
我想要数学的作文英语Mathematics is like a puzzle that never ends. It challenges our minds and pushes us to think in new ways. Whether it's solving equations, calculating probabilities, or exploring geometric shapes, math is always full of surprises.Numbers are the building blocks of math. They can be added, subtracted, multiplied, and divided to create endless possibilities. From counting apples to measuring distances, numbers help us make sense of the world around us.Geometry is all about shapes and space. It's about understanding the relationships between lines, angles, and surfaces. Whether it's finding the area of a circle or constructing a triangle, geometry helps us see the beautyin the world through a mathematical lens.Algebra is like a secret code waiting to be cracked. Itinvolves using symbols and variables to represent unknown quantities. By solving equations and inequalities, we can unlock the mysteries hidden within the numbers and find solutions to complex problems.Statistics is the art of making sense of data. It involves collecting, analyzing, and interpreting information to make informed decisions. From calculating averages to predicting trends, statistics helps us understand the world around us in a quantitative way.Mathematics is not just about numbers and formulas.It's about creativity, problem-solving, and critical thinking. It's about seeing patterns where others see chaos and finding beauty in the complexity of the world. So let's embrace the challenge of math and explore the endless possibilities it has to offer.。
适合复杂网络分析的最短路径近似算法
软件学报ISSN 1000-9825, CODEN RUXUEW E-mail: jos@Journal of Software,2011,22(10):2279−2290 [doi: 10.3724/SP.J.1001.2011.03924] +86-10-62562563 ©中国科学院软件研究所版权所有. Tel/Fax:∗适合复杂网络分析的最短路径近似算法唐晋韬+, 王挺, 王戟(国防科学技术大学计算机学院,湖南长沙 410073)Shortest Path Approximate Algorithm for Complex Network AnalysisTANG Jin-Tao+, WANG Ting, WANG Ji(College of Computer, National University of Defense Technology, Changsha 410073, China)+ Corresponding author: E-mail: tangjintao@Tang JT, Wang T, Wang J. Shortest path approximate algorithm for complex network analysis. Journal ofSoftware, 2011,22(10):2279−2290. /1000-9825/3924.htmAbstract: The tremendous scale of the social networks mined from Internet is the main obstacle of a socialnetwork analysis application. The bottleneck of many network analysis algorithms is the extortionate computationalcomplexity of calculating the shortest path. Real-World networks usually exhibit the same topological features ascomplex networks such as the “scale-free” and etc, which indicate the intrinsic laws of the shortest paths in complexnetworks. Based on the topological features of real-world networks, a novel shortest path approximate algorithmwhich uses an existent short path passing through some local center nodes to estimate the shortest path in complexnetworks, is proposed. This paper illustrates the advantage and feasibility of incorporating the proposed algorithmwithin the network properties, which suggests a new idea for complex social network analysis. The proposedalgorithm has been evaluated both on synthetic network stage and real world network stage. Experimental resultsshow that the proposed algorithm can largely reduce the computational complexity and remain highly effective incomplex networks.Key words: social network; approximation algorithm; network property; shortest path problem摘要: 基于互联网抽取的社会网络往往具有较大的规模,这对社会网络分析算法的性能提出了更高的要求.许多网络性质的度量都依赖于最短路径信息,社会网络等现实网络往往表现出“无标度”等复杂网络特征,这些特征指示了现实网络中最短路径的分布规律.基于现实网络的拓扑特征,提出了一种适合于复杂网络的最短路径近似算法,利用通过局部中心节点的一条路径近似最短路径,该算法能够方便地用于需要最短路径信息的社会网络性质的估算,为复杂网络的近似分析提供了一种新的思路.在各种生成网络与现实网络上的实验结果表明,该算法在复杂网络上能够大幅降低计算复杂性并保持较高的近似准确性.关键词: 社会网络;近似算法;网络性质;最短路径问题中图法分类号: TP301文献标识码: A∗基金项目: 国家自然科学基金(60873097); 国家重点基础研究发展计划(973)(2005CB321802); 新世纪优秀人才计划(NCET-06-0926)收稿时间:2009-08-19; 修改时间: 2010-06-09; 定稿时间: 2010-07-282280 Journal of Software软件学报 V ol.22, No.10, October 2011随着Web 2.0的蓬勃发展,互联网正逐步融入人们的日常生活之中,深刻地改变着人们工作和生活的方式,这使得面向互联网的社会网络分析成为新的研究热点.随着数据挖掘技术的进步,研究者从互联网上挖掘的数据规模也在快速地增长.与其他领域的网络研究一样,社会网络分析也面临着数据规模急剧扩张的挑战.研究者通常将社会网络视为一个图,利用基于图的算法来分析社会网络的性质.而这些分析算法大都依赖于一个基本问题——节点间的最短路径的计算.如20世纪60年代Milgram[1]提出的“六度分离”性质,就是对社会网络最短路径长度的假设;而近年在Internet中流行的“Bacon数”和“Erdös数”[2]游戏,以及对Internet等大规模网络的网络直径的研究[3],都是典型的最短路径查找问题;社会学家提出的度量网络元素重要性的两个性质——接近中心性、介数中心性[4]——也是通过元素对最短路径的贡献程度来度量的;许多聚类算法也需要节点之间的距离或最短路径信息[5],如Girvan-Newman算法[6]等.但最短路径的计算具有很高的复杂性,使得这些分析方法在面向规模较大的现实网络时存在性能问题.在串行计算机上,目前主要有两种解决思路:利用优化算法结构等方法降低算法的计算复杂性;利用启发式等方法限定搜索空间,近似计算最短路径.研究者们提出了各种不同形式的最短路径算法[7−9],由于问题本身的复杂性,目前最快的串行最短路径算法只能将计算复杂性降到O(n2.376)[10].因此,如何快速而高效地近似最短路径成为研究者们关注的热点.在社会网络的研究中,研究者们发现了不同于规则网络或随机网络的一些拓扑特征.如社会网络中往往具有较短的平均路径长度和较高的顶点集聚系数,Watts[11]提出了小世界模型来刻画这种现象,利用该模型可以较好地解释“六度分离”性质;Albert等人[12]则发现了在大规模现实网络中度分布的无标度现象.研究者们将具有这些特性的现实网络称为复杂网络,并对复杂网络的拓扑特性、构造模型、传播动力学等方面都进行了深入的研究[13],也将其成果广泛应用于软件工程等领域[14].现实网络往往都具备复杂网络特征,本文利用复杂网络的拓扑特征推导现实网络中最短路径的可能分布.在此基础上,本文提出了基于区域中心点距离的最短路径(centers distance of zone,简称CDZ)近似方法,利用复杂网络拓扑特征寻找一条实际存在的路径作为可能的最短路径,能够有效地应用于介数中心性等需要最短路径信息的社会网络分析算法的近似计算.实验结果表明,在具有复杂网络特征的网络上,我们的近似分析方法极大地提高了计算速度,而且保持了较高的有效性.本文第1节回顾相关工作.第2节分析复杂网络拓扑特征对最短路径的影响,在此基础上提出针对复杂网络的最短路径近似算法CDZ.第3节将CDZ算法应用到计算机生成网络和真实网络上,以检验CDZ算法的性能和正确性.第4节阐述如何结合CDZ算法近似计算中心性等社会网络性质的方法,并检验网络性质近似的有效性.最后总结全文,提出一些有待探讨的问题,并展望未来的工作.1 相关工作目前,面向互联网的社会网络挖掘和分析成为了一个新的研究热点.研究者们针对人们在互联网的活动进行挖掘和分析,如邮件交互[15]、科研合作[16]等;也研究了面向Web 2.0的社会网络挖掘方法[17,18];并将社会网络分析广泛应用于恐怖袭击分析[19]、犯罪核心挖掘[20]等问题.这些研究与其他现实网络分析一样,面临着网络规模急剧增大的挑战.中心性等网络性质度量方法由于复杂性太高而不能在大规模现实网络上有效应用,其中,最短路径的计算带来的复杂性最为显著.因此,如何快速而有效地近似最短路径,从而高效地分析网络性质,成为目前研究的一个热点.Chow等人[21]提出了利用构建A*算法的启发式来快速搜索最短路径的方法.Slivkins等人[22]提出了Rings of Neighbors方法搜索最邻近节点,并在此基础上提出了基于环的距离近似算法.Rattigan等人[23]则提出了图结构索引(network structure indices,简称NSI)算法,利用保存的预处理结果快速近似节点间的距离,文献[24]将该算法用于图聚类算法的近似,取得了较好的结果.Zwick[25]提出了t-最短路径近似算法的定义,一个算法被称作是t-近似的,是指该算法估算的最短路径都不超过实际最短路径长度的t倍.Cohen等人[26]O n e的预处理时间.Thorup等设计了一种面向加权无向图的近似算法,该算法在2-近似的情况下仅需3(人[27]提出了Approximate Distance Oracle数据结构,对于(2k−1)-近似需要O(kn1+1/k)的空间和O(n1/k)的预处理时间,并能在O(k)的时间内给出任意节点对之间的近似最短路径.Baswana等人[28]设计了两种随机近似算法,在非加权无向图最短路径的2-近似问题上具有O(e2/3n log n+n2)的时间复杂度.唐晋韬 等:适合复杂网络分析的最短路径近似算法2281上述方法的设计目标往往面向所有类型的网络,并没有针对复杂网络的拓扑特征进行优化.研究结果[29,30]表明,最短路径算法在具有不同拓扑特征的网络上效率差异很大,通用算法很难在各种网络形式下均有较好的效率.本文在分析复杂网络拓扑性质的基础上,提出了一种适用于现实网络的近似算法.该算法利用符合复杂网络拓扑特征的一条可能的最短路径估算距离,适用于现实世界中基于最短路径的网络分析方法的近似. 2 CDZ 最短路径近似方法大规模网络中的所有节点对之间最短路径(all-pairs shortest paths,简称APSP)问题一直是研究者面临的一个挑战.本节分析了现实网络的复杂网络特性,由此推导了关于复杂网络节点间最短路径特征的一个假设.在此基础上,提出了基于区域中心点的最短路径近似算法,并研究了适合于复杂网络的区域中心点选择策略.2.1 CDZ 算法现实世界中,较大规模的网络在结构上往往表现出复杂网络特征,如社会网络、生物网络、Internet 物理网络等等[16].复杂网络特征包括小世界特征和无标度特征;小世界特征[11]说明,在复杂网络中,任意节点之间的距离均较短,且具有较高的聚集系数.而无标度特征[12]是指度分布较为符合幂律(power-law)定律,即复杂网络中存在着少量的占支配地位的中心节点,以及大量的不够活跃的普通节点.如在Internet 网页链接结构中,绝大部分网页的链接数不超过4个,而不到0.01%的网页占有了80%以上的链接[12].本文统计了实验采用的两种现实网络是否同样具有复杂网络拓扑特征,包括科研文献引用网络Cora 和Blogger 社会网络(参见第3.1节).Cora 网络为30 000节点规模,Blogger 网络则包含1 000多个节点.本文利用E-R 模型[31]分别生成与这两种网络规模基本相同的随机图进行比较,统计结果表明,这些现实网络的确具有复杂网络拓扑特征.如图1所示,不同于随机网络的正态分布,Blogger 网络和Cora 网络的度分布都表现出了一定的幂律分布特征.而Blogger 网络和Cora 网络平均距离仅为3和5,明显小于相同规模随机网络的平均距离(6和13).Fig.1 Degree distribution curve of real-world networks and random network图1 现实网络与相同规模的随机网路的度分布曲线复杂网络拓扑特征体现了现实网络中最短路径的一些内在规律.不同于随机网络,复杂网络的大部分节点都只在小范围内相互连接,呈现出一定的高聚集系数特性.不同于规则网络,复杂网络任意两个节点间的距离都较短.复杂网络直径较小的原因在于少量连接不同簇的“长边”,社会学家Granovetter 提出了弱链接的强度[32],描述了在人际关系中少量跨越交际圈的较弱关系对交际网络的巨大贡献.这说明,最短路径通过“长边”的可能性非常大.而复杂网络的无标度特征说明节点的度数分布不均衡,存在少量具有很高度数的中心节点以及大量度数很低的普通节点.这说明“长边”属于少数的中心节点的概率更大,任意节点之间的最短路径很有可能通过中心节点.因此,本文提出了在现实网络中关于最短路径规律的一个假设:假设1. 在具有复杂网络特征的现实网络中,大部分节点都是经过中心节点连接在一起的,任意节点之间的最短路径有较大的可能会经过中心节点.该假设在很多现实网络中可以找到佐证,如在Internet 网络中,绝大部分的节点是个人电脑终端,它们之间E-R random graph Blogger 3002001000N u m b e r o f v e r t i c e s 0 20 40 60 80 100Degree N u m b e r o f v e r t i c e s 0 20 40 60 80 100Degree E-R random graph Cora2282 Journal of Software 软件学报 V ol.22, No.10, October 2011主要通过路由器连接.在性接触网络[33]和科研合作网络[16]中也发现了类似的特点.根据假设1,在NSI 方法[23]的基础上,本文提出了一种基于区域中心点的最短路径近似方法——CDZ 方法.在预处理时,该方法查找中心节点并记录各个节点到最邻近中心节点的最短路径;在估算最短路径时,该方法利用通过中心节点的一条路径近似最短路径.在无向图情况下,CDZ 方法的预处理包括以下几个步骤:(1) 根据某种节点选择策略(本文策略见第2.2节)选取d 个可能的中心节点,表示为C 1,C 2,…,C d ;(2) 从中心节点集合开始,宽度优先遍历整个图,记录每个节点到最临近中心节点的最短路径、相邻区域(两 个区域有节点直接相连)中心节点之间的最短路径.该步骤将图划分为d 个区域,记为12,,...,.d C C C Z Z Z(3) 新构造一个仅包含d 个中心点的图,如果原图中两个中心点所在区域相邻,在新图中添加一条连接这两个中心节点的边,边的权值为步骤2得到的在原图中两个相邻区域的中心节点之间的距离.计算新图中所有节点之间的最短路径,通过映射可以得到原图任意两个中心节点之间的最短路径.CDZ 方法利用通过中心节点的一条实际存在的路径近似跨区域节点之间的最短路径.任意两个属于不同区域的节点s ,t 之间的距离,可以近似为这两个节点到各自区域中心节点的距离与中心节点之间的距离之和.d (s ,t )=d (s ,C s )+d (C s ,C t )+d (C t ,t ) (1) 其中,C s ,C t 分别为距节点s ,t 最近的中心节点,函数d (s ,t )为节点s 和节点t 之间的距离.属于不同区域的两个节点s ,t 之间的距离d (s ,t ),CDZ 方法利用一条通过中心节点的路径长度来近似:从节点s 到其中心节点C s 的距离d (s ,C s )、从节点t 所在区域中心节点C t 到t 的距离d (C t ,t )以及中心节点之间的距离d (C s ,C t )之和.如果两个节点属于同一区域,通过两个节点到中心节点的路径信息可以快速地发现它们的最近公共祖先(least common ancestors).本文利用两个节点通过其最近公共祖先的一条路径,近似它们之间的最短路径.对于属于同一区域的节点s ,t ,C st 为区域的中心节点,LCA st 为s ,t 的最近公共祖先,s ,t 之间的距离可以近似为d (s ,t )=d (s ,LCA st )+d (LCA st ,t ) (2) 如果s ,t 的最近公共祖先是它们中间的一个,那么近似公式(2)给出的近似路径即为最短路径.与常见的随机方法不同,CDZ 方法利用复杂网络的高聚集特性来划分图的区域.在最短路径的近似上,该算法利用了复杂网络的小世界特性和无标度特性,认为复杂网络中最短路径有较大可能会经过中心节点.近似公式(1)、近似公式(2)在给出节点距离的一个近似值的同时,也提供了一条图中存在的可能最短路径.2.2 区域中心点的选择策略影响CDZ 近似方法有效性的一个核心因素是区域划分,CDZ 方法的准确性很大程度上取决于划分的区域是否符合网络的拓扑结构.CDZ 方法利用基于中心节点集合的宽度优先算法划分区域,如何构造适合复杂网络的中心点选择策略成为CDZ 方法需要解决的一个核心问题.在社会网络的常用分析手段中,局部中心性(local centrality)[34]通过统计与节点相连的边数来度量节点的重要性.该性质能够度量在局部环境中处于“核心”位置的点,测量方法也只需要利用到节点的度数,计算复杂度较低.因此,我们选取局部中心性最高的一系列节点作为CDZ 算法的区域中心点.在此度量方法下,中心点选择策略还需要考虑区域的划分粒度,即中心点的数目.选择合适的中心点数目能够将网络划分为符合实际拓扑结构的区域,进而能够有效地拟合节点间的最短路径,对CDZ 方法的性能也会产生较大的影响.复杂网络一般都具有无标度特征,即度的分布较为符合幂律分布.在具有无标度特征的网络中,存在少量有着较高度数的活跃节点,而大部分节点往往只有一两个邻居节点;如在科研文献引用网络Cora 中,度数最高的20%的节点的度数之和就达到了网络总度数的75.6%.因此,在复杂网络中,只需选择局部中心性最高的少量节点就能使划分的区域很好地符合网络拓扑特征.节点的度数是由与之相连的边的数目来决定的,我们认为,在所选取的中心点的度数之和接近或达到全图度数之和的50%时,绝大部分边都会与中心点相连接.如在Cora 网络中,当选择的中心点集合度数达到全图的50%时,与中心点集合相连的边占到了全部边的83%以上;而在图1所示的随机网络中,这个比例仅仅达到51%.此时,CDZ 算法在遍历中心点时就覆盖了复杂网络的绝大部分边,构建的结构索引更符合实际的网络结构.根据复杂网络的无标度特性,大部分复杂网络的度数均符合或接近幂律分布,即y =cx −r ,而社会网络的幂率r 往往在2~3之间[12].如果中心点集合的度数大于总度数的50%,则需要选择唐晋韬等:适合复杂网络分析的最短路径近似算法2283的节点数目一般不超过总节点数的10%.因此,CDZ方法的中心节点选择策略如下:(1) 将节点按照局部中心性大小进行排序,得到排序后的节点队列Q;(2) 取出队列Q中的第1个元素,加入中心点集合C;(3) 如果中心点集合C中所有节点的度数之和大于全图度数之和的50%,或中心点集合的大小超过了全图节点总数的10%,则终止循环;否则,继续执行第2步;(4) 输出中心点集合C,此时,C中所有元素就是本文策略选择的中心节点.在近似节点间的距离时,CDZ方法仅需要常数时间.但预处理步骤中的图遍历需要O(e+n log n)的开销,其中, e为网络边的数目,n为节点数目.预处理步骤3将所有中心点抽取成一个加权网络,利用经典的最短路径算法计算中心点之间的距离需要O(d3)的时间,其中,d为中心点数目;选择中心节点需要O(n log n)的时间.因此,CDZ方法预处理的计算复杂性为O(e+n log n+d3),其中,e为网络边的数目,n为节点数目,d为选择的中心节点数目.在具有无标度特性的网络中,高度数节点的数目非常少,即d远远小于n.因此,在具有复杂网络特征的网络中,CDZ方法的计算复杂性仅为O(e+n log n).如果图的规模较大或无标度特征不明显,则仍可能由于d较大而使得精确计算所有中心点之间最短路径的时间开销过大.在中心点规模大于500的情况下,我们同样采用CDZ方法近似计算中心点之间的最短路径,以取得性能和正确性之间更好的平衡.3 最短路径近似评测作为很多网络性质的度量基础,近似算法对最短路径估算的准确性和效率直接影响到网络近似分析的性能.在本节中,我们在各种网络上评估了CDZ近似算法的有效性,并分析了影响算法正确性与性能的因素.3.1 数据集本文使用了科研文献引用网络Cora[35]和搜狐博客(/)社会网络Blogger来评测算法在现实网络中的有效性.作为一种常用的关系数据,Cora包含了在信息处理等领域的近37 000篇科研文献以及文献之间的100 000多个引用关系.我们将每篇文章作为一个节点,如果文章之间有引用关系,则在对应节点之间添加一条边.通过这些步骤,我们得到了一个包含30 751个节点及134 996条边的科研文献引用网络,本文称其为Cora网络.此外,我们也抓取了搜狐博客的部分数据,共收集到了1 327个博客的20 166篇文章.将每个博客表示为图中的一个节点,如果博客之间存在着表示阅读、评论、引用、交友的链接,就在对应的节点之间添加一条边.去除了孤立节点后,生成了规模为1 113个节点和3 685条边的无向图,本文称其为Blogger网络.为了全面评测CDZ方法的近似效果,本文利用经典的网络模型生成了3种具有不同结构特征的网络:根据Erdös模型[31]生成的随机网络,根据Eppstein幂律模型[36]生成的幂律网络以及根据Barabási模型[12]生成的无标度网络.随机网络属于简单网络,而后两种生成网络都有着显著的无标度特征.为了便于统计性质的直观比较,3个生成网络的规模与Cora网络基本相当.这些网络的统计性质见表1.Table 1 The statisitical features of the networks used in the expermiments表1实验所用网络的统计性质Power-LawRandomScale-Free Network CoraBloggerNodes 30 751 1 113 29 999 30 000 30 000Average degree 8.78 6.62 9.01 6.0 8.361032 24 26Diameter 19Average distance 5.42 3.36 12.6 5.98 7.513.2 评测方法本文采用了Dijkstra算法的Fibonacci实现[30]作为距离的基准算法,该实现具有O(en+n2log n)的时间复杂度.本文采用该算法计算的距离作为标准答案评测近似算法的准确率,根据它的计算时间评测近似算法的实际性能.作为对比,本文还实现了两种知名的最短路径近似方法,包括Baswana提出的随机化近似方法[28](简称Baswana方法)和NSI近似方法中近似效果最好的DTZ方法[23],以验证我们提出的近似方法的有效性.平均路径比(PathRatio)[23]常用于度量距离近似方法的正确性.给定图G,从中随机选择r对节点,对于任意2284 Journal of Software 软件学报 V ol.22, No.10, October 2011节点对i ,分别计算出精确距离i o P 和近似距离i f P .在此基础上,可以定义平均路径比P :11.i i r rf o i i P P P ===∑∑ 由定义可知,平均路径比P 的值越接近1,最短路径近似算法的准确性就越高.P 的值与1的差距越大,说明近似结果和实际距离的偏差越大.为满足实际应用需求(如在路径导航问题中,用户能够接受比最短路径偏大的实际路径,而不能接受小于最短路径的不存在的一个近似解),常见最短路径近似方法(包括本文提到的几种方法)都要求近似结果不小于实际距离,所以平均路径比不会小于1.CDZ 方法使用通过中心节点的一条实际存在的路径近似最短路径,这条路径的长度也不会小于最短路径的长度,其平均路径比同样不小于1.3.3 结果与分析首先,我们测试了几种近似方法的准确性.CDZ 方法利用复杂网络结构特性划分区域,不需要输入参数. DTZ 方法需要确定划分的区域数目和区域划分次数,本文中设定为10%和5.Baswana 方法需要指定概率p 将节点加入样本集,本文中,p 设定为0.2.几种近似方法在各种类型网络上的正确性评测结果见表2.Table 2 The PathRatio measure of the approximate algorithms in different networks表2 近似算法在不同网络上的PathRatio 值Algorithm Random Power-Law Scale-Free Cora BloggerDTZ 6.412 6.246 6.600 5.549 5.648Baswana 1.124 1.211 1.222 1.160 1.092如表2所示,CDZ 近似方法和Baswana 方法相对于DTZ 方法更为精确.如在估算随机网络中节点的距离时, CDZ 方法和Baswana 方法的平均路径比分别为1.454和1.124,而DTZ 高达6.412.这是因为DTZ 方法利用泛洪算法随机划分区域;为了避免随机划分引入的距离偏置,DTZ 方法需要多次划分区域,并叠加每一种划分情况下的距离近似值.这在消除了随机偏置的同时,也使得估算距离远大于实际的最短路径长度.CDZ 近似方法和Baswana 方法在各种网络上均达到较高的近似水平;但CDZ 方法在Cora 网络和Blogger 网络中的近似准确性明显高于Baswana 算法;而在具有无标度生成网络中,CDZ 方法也要好于Baswana 算法.如在Barabási 无标度网络上,CDZ 方法的平均路径比达到了1.172,而Baswana 算法为1.222.这是因为Baswana 利用随机化的方法挑选“Sample”节点,具有较好的通用性,却没有针对现实网络的特征进行优化;而CDZ 方法是以复杂网络的结构特征为假设基础,认为在复杂网络连通性方面起重要作用的“长边”往往与中心节点相连.在具有无标度特征的网络中,少量的中心节点占有了大部分的边,符合CDZ 方法的假设.而现实网络大都具有无标度等复杂网络特征,所以CDZ 方法更适合于现实复杂网络的最短路径的近似. 本文也在2 000个节点规模的Cora 子网络上测试了CDZ 方法中心节点选择策略对近似正确性的影响.本文采用随机方法作为对比策略,以2为间隔,从20~400设置中心点数目,计算不同的中心点情况下CDZ 方法的准确性.如图2所示,基于局部中心性的选择策略在CDZ 方法上整体表现出较好的近似准确性,而随机选择策略则有着较大的偏置.这说明,基于局部中心性划分的区域更符合现实网络的拓扑结构特征.而选择不同的中心点数目,对距离估算的准确性也有较大的影响.在随机选择策略中,CDZ 算法的近似准确率随着中心点数目的变化出现了较大的随机波动.基于局部中心性的选择策略在中心点数目很少时,对距离的估计偏大;而随着中心点数目的增加,估算距离快速地逼近实际距离.在中心节点数Local centrality Random selection 0 100 200 300 4002.52.01.51.00.50.0P a t h R a t i o Our strategyFig.2 Influence of center selection strategy on CDZ 图2 中心节点选择策略和对CDZ 方法的影响。
一种基于扩展规则的_SAT求解系统
ISSN 1000-9825, CODEN RUXUEW E-mail:************.cnJournal of Software, Vol.20, No.7, July 2009, pp.1714−1725 doi: 10.3724/SP.J.1001.2009.03320 Tel/Fax: +86-10-62562563© by Institute of Software, the Chinese Academy of Sciences. All rights reserved.∗一种基于扩展规则的#SAT求解系统殷明浩1,2,3+, 林海1,2, 孙吉贵1,21(吉林大学计算机科学与技术学院,吉林长春 130012)2(吉林大学符号计算与知识工程教育部重点实验室,吉林长春 130012)3(东北师范大学计算机学院,吉林长春 130117)Solving #SAT Using Extension RulesYIN Ming-Hao1,2,3+, LIN Hai1,2, SUN Ji-Gui 1,21(College of Computer Science and Technology, Jilin University, Changchun 130012, China)2(Key Laboratory of Symbolic Computation and Knowledge Engineering of Ministry of Education, Changchun 130012, China)3(College of Computer Science, Northeast Normal University, Changchun 130117, China)+ Correspondingauthor:E-mail:**************.cnYin MH, Lin H, Sun JG. Solving #SAT using extension rules. Journal of Software, 2009,20(7):1714−1725./1000-9825/3320.htmAbstract: #SAT problem is the extension of SAT problem. It involves counting models of a given set ofproposition formulae. By using the inverse of resolution and the inclusion-exclusion principle to circumvent theproblem of space complexity, this paper proposes a framework for both model counting and weighted modelcounting. It suggests a complementary method for current model counting methods. These methods are proved to besound and complete. A model counting system, namely JLU-ERWMC, is built based on these methods.JLU-ERWMC outperforms the most efficient model counting methods in some cases.Key words: extension rule; model counting; knowledge compilation; weighted model counting摘要: #SAT问题是SAT问题的扩展,需要计算出给定命题公式集合的模型个数.通过将问题求解沿着归结的反方向进行,并利用容斥原理解决由此带来的空间复杂性问题,提出了一种基于扩展规则的模型计数和加权模型计数问题求解框架,可以看作是目前所有模型计数问题求解方法的一种补方法.证明了该方法的完备性和有效性,设计了基于扩展规则的#SA T求解系统:JLU-ERWMC.实验结果表明,JLU-ERWMC在有些问题中优于目前最为高效的#SAT问题求解系统.关键词: 扩展规则;模型计数;知识编译;加权模型计数中图法分类号: TP18文献标识码: A∗ Supported by the National Natural Science Foundation of China under Grant Nos.60573067, 60773097 (国家自然科学基金); theSpecialized Research Fund for the Doctoral Program of Higher Education of China under Grant No.20050183065 (国家高等学校博士学科点专项科研基金); the Science Foundation for Young Teachers of Northeast Normal University of China under Grant No.20070601 (东北师范大学青年基金)Received 2007-05-31; Accepted 2008-02-20殷明浩 等:一种基于扩展规则的#SAT 求解系统1715随着命题可满足问题(SAT)的研究的日益成熟,求解SAT 问题的能力近年来有了很大程度的提高.目前Zchaff,Survey Propagation 等高效的SAT 求解系统已经可以求解含有100 000个以上变量的SAT 问题实例[1−3].另一方面,SAT 领域的成功也使得其他研究领域受益匪浅,例如在经典智能规划研究领域,SATPLAN 和BLACKBOX 等经典智能规划系统通过将规划问题编译为SAT 问题实例,借助高效SAT 求解系统,在近年来的国际智能规划竞赛中屡次取得优异的成绩,获得了多项冠军[4,5].事实上,对于几乎所有的NP 完备问题,基于SAT 的求解方法大多效果显著,这是因为它们总存在到SAT 问题的多项式归约.然而,在人工智能研究领域存在着很多计算复杂性高于NP 的问题,例如将概率推理问题[6]、一致性概率规划问题[7]转换为命题公式集合后,仅仅判断给定公式集合是否是可满足的往往是不够的,这时还需要计算出该公式集合中所有模型(可满足赋值)的个数.#SAT 问题即是这样一类问题,它需要计算出给定命题公式集合的模型的个数,其计算复杂度要高于SAT 问题,是#P 完备的[8].近年来,#SAT 问题受到研究人员的广泛关注.Birnbaum 和Lozinskii 证明,只要子问题不含不可满足子句,则可以直接扩展Davis-Putnam(DP)过程来求解模型计算问题,并提出了基于DP 的模型计算算法CDP(counting models using Davis-Putnam procedure)[9].算法CDP 的基本思想如下:设M (Σ)表示给定公式集合Σ的模型个数,由于子公式(Σ∧a )和(Σ∧¬a )的模型交集为空,所以M (Σ)=M (Σ∧a )+M (Σ∧¬a ).若Σ中有n 个变量,其中Σ∧a 中有n 1个变量出现,Σ∧¬a 有n 2个变量出现,则M (Σ)=M (Σ∧a )×12n n −+M (Σ∧¬a )×22n n −.Bayardo 和Pehoushek 利用连接图来描述变量之间的关系:连接图的节点为出现在公式集合中的变量,若两个变量出现在同一子句中,则代表这两个变量的节点之间就存在一条边.通过这种方式可以将Σ中的所有变量分成多个不相连的组件,进而将Σ分成多个子公式单独求解.Sang 等人设计的Cachet 系统在DP 过程中混合使用了子句学习和组件缓存的策略,通过记录已经出现的冲突和子公式的模型个数来避免重复计算[10,11].在文献[12]中,Sang 等人在Cachet 的基础上设计了Cachet-WMC 系统,该系统可以处理加权模型计算问题.Selman 等人提出了一种近似的模型计算和加权模型计算方法,该方法通过采样的方法来估计模型的个数[13].Darwiche 等人则提出可以通过知识编译的方法来求解模型计算问题.通过将给定命题公式转换为DNNF 范式后,可以在多项式过程内求解模型计算问题[14−16].无论对于SAT 问题还是#SAT 问题,归结原理都是最重要也是最基本的推理方法.它的基本思想是通过推出空子句的方法来判定某个给定子句集的不可满足性.我们提出了一种与归结方法对称的SAT 求解方法——扩展规则方法[17].该方法的主要思想是,沿着归结的逆向求解SAT 问题,并且借助容斥原理解决由此带来的空间复杂性问题.我们还提出一种基于扩展规则的知识编译方法,可以在多项式时间内求解编译后的SAT 问题[18].在此基础上,我们将扩展规则方法推广到模态逻辑中,并优化了基于扩展规则的求解方法[19,20].本文的目的在于将扩展规则方法推广到#SAT 问题求解中,并介绍基于扩展规则的#SAT 问题求解器——JLU-ERWMC.本文第1节简单回顾扩展规则.第2节介绍基于扩展规则的#SAT 问题求解方法.第3节介绍基于扩展规则的加权模型计算方法.第4节给出实验结果.最后给出全文的总结和未来的相关工作.本文相关定理的证明详见附录.1 扩展规则为了讨论方便,先来介绍本文需要的相关概念和命题.首先引入扩展规则,它是本文其他工作的基础.关于扩展规则的详细定义,可以参照文献[17].扩展规则定义如下:定义1[17]. 给定一个子句C 和一个原子的集合M :D ={C ∨a ,C ∨¬a |a ∈M 并且a 和¬a 都不在C 中出现},我们把从C 到D 中元素的推导过程叫做扩展规则,D 中的元素叫做应用扩展规则的结果.例如,给定子句A ∨B 和集合{A ,B ,C },对子句A ∨B 应用扩展规则的结果就是A ∨B ∨C ,A ∨B ∨¬C .下面来看一下子句C 及其扩展后的结果D 之间的关系.定理1[17]. 子句C 及其扩展后的结果D 是等价的.1716Journal of Software 软件学报 V ol.20, No.7, July 2009这样,我们可以对子句集中的子句应用扩展规则.定理1保证了应用扩展规则后的子句集和原子句集等价,因此,扩展规则可以被看作是一条推理规则.定义2. 一个非重言式子句是集合M 上的极大项当且仅当它包含集合M 上的所有原子或其否定.例如,给定原子集合M ={A ,B ,C },A ∨B ∨C 就是M 上的极大项,A ∨B 则不然.定理2[17]. 给定一个子句集Σ,它其中所有原子的集合是M (|M |=m ),若Σ中的子句都是M 上的极大项,则子句集Σ不可满足当且仅当Σ中含有2m 个互不相同的子句.2 基于扩展规则的模型计数方法本节介绍如何利用扩展规则来求解#SAT 问题,包括两部分内容:第2.1节介绍如何利用扩展规则直接求解#SAT 问题,第2.2节介绍如何通过知识编译将给定子句集合转换成易于求解#SAT 问题的形式.我们首先对本文中一些符号做出约定:用Σ,Σ1,Σ2,…表示CNF(conjunctive normal form)形式的子句集.用C ,C 1, C 2,…表示单个的子句,有时也把子句理解成文字集合的形式.通常,M 表示一个子句集Σ中所有原子的集合.2.1 利用扩展规则求解模型计数问题定理3. 给定一个子句集Σ,其中所有原子的集合是M (|M |=m ),若Σ中的子句都是M 上的极大项,则子句集Σ的模型个数为2m −S 当且仅当Σ中含有S 个互不相同的子句,其中S ≤2m .定理3实际给出了赋值和极大项的对应关系,对于每个赋值,如果它使得子句集为真当且仅当它的“非”形式的极大项不出现在子句集中.这样,如果要计算一个子句集的模型个数,首先要用扩展规则把原来的子句集扩展成与其等价的极大项组成的集合,再根据定理3:如果扩展后的子句集里面有S 个互不相同的子句,则原来的子句集就含有2m −S 个模型.定理4. 在命题逻辑中,基于扩展规则的模型计数方法是正确的和完备的.显然,直接应用扩展规则最坏情况下的空间复杂性是呈指数级的.实际上,我们并不需要把所有的极大项都扩展出来,只需要计算它们的个数就足够了.如果极大项的个数是S ,则子句集含有2m −S 个模型.包含排斥原理恰好能够帮助我们做到这一点.定理5[17]. 两个子句扩展出的极大项的集合不含交集当且仅当这两个子句含有互补对.定理6(包含排斥原理). 集合A 1,A 2,…,A n 并集的元素个数可以用如下公式计算:|A 1∪A 2∪…∪A n |=1||n i i A =∑−1||i j i j n A A ≤<≤∩∑+…+(−1)n +1|A 1∩A 2∩…∩A n |.包含排斥原理的简单形式为大家所熟知:|A ∪B |=|A |+|B |−|A ∩B |,|A ∪B ∪C |=|A |+|B |+|C |−|A ∩B |−|A ∩C |−|B ∩C |+|A ∩B ∩C |.我们在文献[17]中已经介绍了如何利用包含容斥原理计算出极大项的个数:给定一个子句集Σ={C 1,C 2,…, C n },M 是其原子的集合且|M |=m .记P i 为C i 扩展出的所有极大项的集合,i =1,…,n .令S 为Σ能够扩展出的所有极大项的集合的元素个数,则S =|P 1∪P 2∪…∪P n |,由包含排斥原理容易得到公式(1):S =1||n i i P =∑−1||i j i j n P P ≤<≤∩∑+1||i j l i j l n P P P ≤<<≤∩∩∑−…+(−1)n +1|P 1∩P 2∩…∩P n | (1)其中,|P i |=||2i m C −. |P i ∩P j |=||0, 2, i j i j m C C i j C C C C −∪⎧⎪⎨⎪⎩和中含有互补文字和中不含有互补文字. 例1:利用公式(1)计算子句集Σ={¬A ∨B ∨¬C ,A ∨C ,¬A }的模型个数.Σ能够扩展出的极大项的数目:S =20+21+22−0−20−0+0=6,因此,Σ中的模型个数为23−6=2.殷明浩等:一种基于扩展规则的#SAT求解系统1717利用公式(1)可以设计出直接利用扩展规则求解模型计数问题的算法,在附录中给出了算法CER(counting models using extension rules)的具体流程.显然,该算法的效率依赖于公式(1)中需要计算的非零项的数目.一般情况下,算法CER的复杂性是呈指数级的,效率比较低.但有些情况下,算法CER的效率会很高.考虑子句集中任意两个子句都含有互补对的情况,在这种情况下,只需计算公式(1)的前n项就可以判定子句集的可满足性了,因为从第n+1项开始所有的项都为0.直观上考虑,这种情况下使用基于归结的方法效率会比较低,因为可能潜在地有很多归结需要做.尽管上面的情况非常特殊,但我们总可以通过知识编译的方法使它得到满足.我们在第 2.2节中将详细介绍这种方法.2.2 利用知识编译求解模型计数问题简单地说,知识编译的过程就是把知识转换成易于推理的表示形式的过程,转换的结果被称作是目标语言(target language).在文献[18]中我们介绍了EPCCL(each pair of clauses contains complementary literal(s))理论.定义3[18]. EPCCL理论是其中任意两个子句都含有互补对的子句集.我们已经证明了EPCCL理论是在“可满足可控制类”中的,它的可满足性可以在线性时间内用扩展规则得到判定.定理7[18]. 对任何一种EPCCL理论的可满足性判定可以在多项式时间内完成.但一种理论是在“可满足性可控制”的类中,并不意味着它也在“模型计数可控制”的类中,下面给出一个例子来说明这个问题.例2:假定Σ={C1,C2,…,C n}是一个难解的模型计数问题,但Σ′={C1∨L,C2∨L,…,C n∨L}的可满足性非常容易判定:任何含L以正的方式出现的解释都是Σ′的模型.因而,Σ′在“可满足性可控制”的类中.但计算“Σ′的模型个数”就等于计算Σ的模型个数,是非常困难的.因此,Σ′不在“模型计数可控制”的类中.定理8指出,EPCCL理论是在“模型计数可控制”类中的.定理8. 对于一种EPCCL理论的模型计算过程可以在多项式时间内完成.根据定理8,就可以设计基于知识编译的模型计数算法,附录B中给出了算法KCCER(knowledge compilation for counting models using extension rules)的具体流程.算法KCCER在计算模型个数时,首先需要调用算法KCER(knowledge compilation using extension rules),将给定的命题集合通过知识编译转换为一个等价的EPCCL理论.再利用公式(1)计算出给定EPCCL理论的模型个数即可.算法KCER的核心思想是基于“桶删除(bucket elimination)”的思想.初始时,Σ中的每一个子句相当于一个桶(bucket),算法依次处理每一个桶,当处理一个桶的时候,其相应的子句被从Σ1移到Σ2,用扩展规则和删除规则来保证每一个含Σ1中的一个子句和Σ2中的一个子句的子句对含互补对,这样,Σ2中的子句就可以作为编译结果的一部分被从Σ2移到Σ3中.所有的桶都被处理完之后算法也就终止,Σ3作为其输出.需要指出的是,在利用算法KCER进行知识编译时,编译后的子句集比编译前的子句集规模要有所扩大,最坏情况下,这种扩大是呈指数级的,算法KCER的时间代价在最坏情况下也呈指数级.但由于知识编译实际上属于离线推理,因此,用户实际关心的是在线求解模型计数的时间.而且,知识编译所花费的时间可以通过对同一个知识库的多次询问得到补偿.定理9. 算法KCCER是正确和完备的.3 加权模型计算在第2节中我们介绍了利用扩展规则求解模型计算的一般方法,本节进一步介绍如何使用扩展规则求解加权模型计算问题.定义4. 设Σ为任意逻辑子句集合,Σ中的每个文字l有一个权值,记做w(l),设ω为Σ的一个模型,则ω的权为W(ω),被计算为W(ω)=|() lw lω=∏. Σ的权为满足Σ的所有模型的权之和,记作WMC(Σ),被计算为1718Journal of Software 软件学报 V ol.20, No.7, July 2009WMC (Σ)=|()W ωΣϖ=∑.显然,在第2节中讨论的模型计算可以被看作是加权模型计算的特例.这时,Σ中的每个文字l 的权值都是0.5.在很多文献中,若某个文字l 的权为w (l ),则¬l 的权值为1−w (l ),即w (l )+w (¬l )=1,本文并不作这种假设.命题10. 设Σ为子句集合,如果其中任意两个子句含有互补文字,则对Σ的任意赋值都不会使这两个子句同时为假.命题11. 设M 为原子集合,M ={l 1,…,l m },设Π={Σ1, Σ2,…, Σn },其中Π中的每个元素Σi 为一个子句集合,Σi 包含且只包含M 中的所有原子;设Π中权最大的子句集合为ΣT ,则(1) ΣT |=T ;(2) WMC (ΣT )=1[()()]mi i i w l w l =+¬∏.事实上,如果给定子句集合Σ,M ={l 1,…,l m }为Σ中出现的所有原子集合,则Σ的所有可能的赋值的权之和即为 1[()()]mi i i w l w l =+¬∏.我们用Σ(l k )来表示在Σ中限定l k 取值为真得到的新的子句集合,用WMC (Σ(l k ))表示限定l k 取 值为真后所有可能的赋值的权和,则WMC (Σ(l k ))=111()[()()][()()]k mk i i i i i i k w l w l w l w l w l −==+×+¬×+¬∏∏. 类似地,可以计算出Σ(¬l k ),Σ(l k ∧l s )的值.对于任意子句C ,如果要使该子句为假,则必须使C 中所有的文字都赋值为假,因此很容易得到如下引理:引理12. 设Σ为子句集合,C 1和C 2为任意两个不含任何互补文字的子句,其中,C 1=l 1∨…∨l r ,C 2=1l ′∨…∨s l ′,设M 为Σ中出现的所有原子集合,|M |=m ,设L ={l 1,…,l r }∪{1l ′,…,s l ′}={1l ′′,…,t l ′′},则 (1) W (¬C 1)=WMC (Σ(¬l 1∧¬l 2∧...∧¬l k ));(2) W (¬C 2)=WMC (Σ(¬1l ′∧¬2l ′∧...∧¬s l ′)); (3) W (¬C 1∧¬C 2) = WMC (Σ(¬1l ′′∧¬2l ′′∧...∧¬t l ′′)). 这里,W (¬C 1)是指所有使C 1为假的赋值的权和,W (¬C 1∧¬C 2)表示同时使C 1和C 2为假的赋值的权和. 下面用一个例子来说明上述命题和引理.例3:给定子句集合Σ={C 1:¬p ∨q ,C 2:¬r ∨¬q ,C 3:¬r },w (p )=w (¬p )=0.5;w (q )=0.3,w (¬q )=0.7;w (r )=0.8,w (¬r )=0.2.计算W (¬C 1∧¬C 2),W (¬C 1),W (¬C 1∧¬C 3),WMC (¬C 2∧¬C 3)的值.由于C 1和C 2中含有互补文字,因此,W (¬C 1∧¬C 2)=0.根据引理11,W (¬C 1)=WMC (Σ(p ∧¬q ))=w (p )×w (¬q )×(w (r )+w (¬r ))=0.35,W (¬C 1∧¬C 3)=WMC (Σ(p ∧¬q ∧r ))=0.28,WMC (¬C 2∧¬C 3)=WMC (Σ(q ∧r ))=0.24.给定一个子句集Σ={C 1,C 2,…,C n },M 是其原子的集合且|M |=m .记P i 为C i 扩展出的所有极大项的集合, i =1,…,n ,由于Σ中所有可能的赋值的权和为WMC (ΣT ),基于扩展规则计算加权模型计数问题的思想就是计算出所有使Σ为假的模型权和WMC (¬Σ),这样使Σ为真的模型权和WMC (Σ)即为WMC (ΣT )−W (¬Σ).计算W (¬Σ)的基本思想类似于算法CER,利用包含容斥原理,公式(2)给出了计算加权模型的一般方法.利用公式(2)就可以设计计算加权模型计数问题的算法CWER(counting weighted models using extension rules),其具体流程详见附录B.WMC (Σ)=WMC (ΣT )−W (¬Σ)=1[()()]mi i i w l w l =+¬∏−WMC (¬Σ) (2)其中,殷明浩 等:一种基于扩展规则的#SAT 求解系统171912111()(...)()()()...(...).n i i j i j l i i j n i j l n i j n i j l n WMC W C C C W C W C C W C C C W C C C Σ≤<≤≤<<≤≤<<≤¬=¬∨¬∨∨¬=¬−¬∧¬+¬∧¬∧¬++¬∧¬∧∧¬∑∑∑∑例4:考虑例3中的子句集合,其加权模型数计算如下:WMC (Σ)=WMC (ΣT )−[W (¬C 1)+W (¬C 2)+W (¬C 3)]+[W (¬C 1∧¬C 2)+W (¬C 2∧¬C 3)+W (¬C 1∧¬C 3)] −W (¬C 1∧¬C 2∧¬C 3)=1−(0.5×0.7+0.3×0.8+0.8)+(0+0.5×0.7×0.8+0.3×0.8)−0=0.13.同样,我们可以利用知识编译的方法来求解加权模型计算问题.根据命题11,当两个子句含有互补对时,不 存在使这两个子句同时为假的赋值,因此,当给定一个含有n 个子句的EPCCL 理论Σ={(1111...n l l ∨∨),…, (1...n n nn l l ∨∨)}时,公式(2)被简化为WMC (Σ)=111111[()()](...)...(...)n mi i n n nn i w l w l WMC l l WMC l l =+¬−¬∧∧¬−−¬∧∧¬∏ (3)根据公式(3),可给出基于知识编译求解加权模型计算问题的算法KCCWER(knowledge compilation for counting weighted models using extension rules),该算法的详细流程见附录B.定理13. 给定EPCCL 理论,我们可以在多项式时间求解加权模型计算问题.证明:公式(3)显然可以在多项式时间内求解,得证.例5:给定EPCCL 理论Σ={p ∨q ,p ∨¬q ,¬p ∨r };w (p )=w (¬p )=0.5;w (q )=0.3,w (¬q )=0.7;w (r )=0.8,w (¬r )=0.2.计算WMC (Σ).WMC (ΣT )=(0.5+0.5)×(0.3+0.7)×(0.2+0.8)=1,WMC (Σ(¬p ∧¬q ))=0.5×0.7×(0.2+0.8)=0.35,WMC (Σ(¬p ∧q ))=0.5×0.3×(0.2+0.8)=0.15,WMC (Σ(p ∧¬r ))=0.5×(0.3+0.7)×0.2=0.1,因此,WMC (Σ)=1−0.35−0.15−0.1=0.4.4 实验结果我们使用Visual C++实现了上述4种算法:算法CER 、算法CWER 、算法KCCER 、算法KCCWER,并将上述4种算法嵌入JLU-WMCER 系统中.所有的实验都在一台CPU 主频为2.8G 、内存512M 的PC 机上测试.实验1的目的在于说明基于扩展规则的模型计算方法和基于归结的模型计算方法由于互补因子大小的不同而导致的性能上的差异.我们用Visual C++实现了文献[17]中介绍的CDP 算法,由于CDP 不能处理加权模型计算问题,因此只给出了算法CER 和算法CDP 的比较.问题样例由一个随机产生器产生,这个随机产生器有3个输入参数:变量的个数n 、子句的个数m 以及每个子句的最大长度k .每个子句都是随机地从n 个变量中选不大于k 个得到的,并且每个变量为正或为负的概率都等于0.5,子句的值为(0,1)之间的随机数.事实上,目前几乎所有的模型计算方法都是在归结原理的基础上求解的,这里可以比较基于扩展规则的方法和基于归结原理的方法.考虑公式(1)和公式(2),当给定子句集中含有的互补文字较多时,显然,我们的算法这时效率一般会更高,因为这时要计算的项的值为0;反之,如果互补文字较少,则这时基于归结的方法效率应该会更高,因为这时可选的归结较少.这样,假设所有的模型计算问题都在一个光谱上,光谱的一端(比如左端)是任意两个子句都含有互补对的情况,在光谱的另一端(右端)是任意两个子句都不含互补对的情况.在光谱的左端应该用基于扩展规则的方法效率更高;在光谱的右端用基于归结的方法效率更高.然而,实际的问题往往都在这两种极端情况之间,决定对于一个实际的问题哪种方法效率更高就变得尤其重要.为此引入如下定义:定义5. 给定一个子句集Σ={C 1,C 2,…,C n },互补因子(complementary factor)是含有互补对的子句对的个数1720 Journal of Software 软件学报 V ol.20, No.7, July 2009 与所有子句对的个数的比值.即S /(n ×(n −1)/2),其中,S 表示含有互补对的子句对的个数.虽然很难用互补因子精确地描述出上述问题的复杂性,但直观上说,互补因子越高,问题离光谱的左端就越近,基于扩展规则的算法的效率就越高.在实验1中,为了只考察算法性能和互补因子的关系,我们固定了子句长度为5,变量个数为50,子句个数为200,通过限定部分变量在子句中的正负形式来限定互补因子的大小,实验结果是50次实验的平均结果.图1显示了算法CER 和算法CDP 的性能随着互补因子的改变的变化曲线.从图中可以看出,当互补因子较大时,算法CER 的性能要优于算法CDP.反之,当互补因子较小时,算法CDP 的性能要优于算法CER.在计算加权模型计算问题时,CWER 的变化曲线与图1类似.Fig.1 Experimental comparisons of CER and CDP图1 算法CER 和算法CDP 实验结果比较 实验2的目的在于比较基于扩展规则的模型计算方法和基于知识编译的模型计算方法,实验结果见表1,时间单位均为秒.我们使用了知识编译问题的一些Benchmark 问题对算法进行测试,并混合使用了一些随机生成的样例,问题样例同样由实验1中的随机生成器生成.图中的第4列表示的知识编译后生成的新子句集的大小,第5列为知识编译的时间,第6列和第7列为知识编译后计算模型和加权模型的时间,第8列和第9列给出了利用扩展规则直接进行模型计算和加权模型计算的时间.从表1中可以看出,经过知识编译后,无论是模型计算还是加权模型计算的时间都在0.2s 以内,远小于直接使用扩展规则进行模型计算的时间.但需要注意的是,在知识编译的过程中依然需要花费较长时间,总的来说,编译时间和在线推理时间的总和大约等于直接进行模型计算的时间.不过,由于知识编译实际属于离线推理,用户实际关心的还是在线推理的时间.而且,知识编译所花的时间可以通过对同一个知识库的多次询问得到补偿.Table 1 Comparison of offline model counting and online model counting表1 离线模型计数求解方法和在线模型计数方法比较Problem No. of variables No. of clauses No. of results Compile time Online time (MC) Online time (WMC) Offline time (CER) Offline time (CWER)Adder-3 13 43 169 0.13 <0.01 <0.01 0.12 0.12 Adder-4 17 57 681 0.13 <0.01 <0.01 0.14 0.14 Adder-5 21 71 2 729 0.21 0.07 0.03 0.26 0.27 Two-Pipes 15 54 208 0.13 <0.01 <0.01 0.31 0.29 Three-Pipes 21 82 483 13.12 0.03 0.02 11.19 11.17 Four-Pipes 27 110 767 101.040.05 0.04 79.27 82.11 Pigeon-4-5 20 74 4 430 63.1 0.07 0.07 67.11 65.39 Random problems 30 100 8 862 31.19 0.1 0.09 33.02 32.99 Random problems 30 200 14 61227.91 0.07 0.08 23.63 23.61 Random problems 50 300 127 093130.270.13 0.13 112.813 114.732 虽然基于扩展规则的方法在互补因子较高时,其性能要优于一般的基于归结的方法,但在另外一些Benchmark 问题中,由于互补因子较低,算法性能要差于基于归结的方法.例如,与Cachet 系统比较,在logistic 域问题中,算法CER 的平均运行时间大约是Cachet 的3.7倍;在Grid 域算法CWER 的运行时间大约是Cachet- WMC 的2.3倍.因此在JLU-ERWMC 系统中,在求解模型计算或加权模型计算时,并不直接调用算法CER 和算CER CDP 250200150100500C P U t i m e (s ) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Complementary factor殷明浩等:一种基于扩展规则的#SAT求解系统1721法CWER,而是首先计算问题的互补因子.当互补因子超过某个阈值(比如0.7)时,才调用算法CER或算法CWER,否则调用Cachet或Cachet-WMC进行求解.表2给出嵌入Cachet和Cachet-WMC算法后JLU-ERWMC 系统在另一些Benchmark问题中的实验结果.我们还在一些随机问题上测试了嵌入了Cachet系统后的JLU- ERWMC.实验结果表明,JLU-ERWMC的效率要远高于CDP.例如子句数为300,变量数为50,JLU-ERWMC的速度是CDP的5.1倍;当子句数为500,变量数为100时,JLU-ERWMC的速度是CDP的7.3倍.Table 2 Results of CER-Cachet and CWER-Cachet表2 CER-Cachet和CWER-Cachet实验结果Problems(s)CWER-CachetProblems CER-Cachet(s)log-0010.11 log-002 11log-00211 log-003 14log-00312 log-004 57log-00451 Grid-002 3log-005401 Grid-003 24log-012377 Grid-004 575 总结本文在扩展规则的基础上设计了求解#SAT问题的一般方法,提出了求解模型计数问题和加权模型计数问题的新的求解框架.与传统的模型计算方法需要找出哪些赋值是给定命题公式集合的模型不同,我们的方法需要找出哪些赋值不是命题公式的集合,可以看作是目前#SAT问题求解方法的一种补方法.我们证明了该方法的完备性和有效性,并设计了基于扩展规则的#SAT求解系统:JLU-ERWMC.实验结果表明,当互补因子较高时,基于扩展规则的方法一般要优于基于归结的方法;反之,当互补因子较低时,基于扩展规则的方法要差于基于归结的方法.致谢感谢Henry Kautz教授提供的Cachet和Cachet-WMC的源代码,使得我们可以将它们嵌入到系统中,使得系统的效率得到了很大的提升.感谢Martin Davis教授对本文中工作的讨论并提出了一些具体的建议.同时,也把这份感谢送给Sharad Malik,Alvaro del Val,Hantao Zhang以及Joe Hurd等人.感谢Marquis和Mazure等人提供的一些知识编译问题的Benchmarks.References:[1] Zhang LT, Madign CF, Moskewicz MH, Malik S. Efficient conflict driven learning in a Boolean satisfiability solver. In: Pileggi LT,Kuehlmann A, eds. Proc. of the ACM/IEEE ICCAD 2001. New York: ACM Press, 2001. 279−285.[2] Zecchina R, Mezard M, Parisi G. Analytic and algorithmic solution of random satisfiability problems. Science, 2002,297:812−815.[3] Zecchina R, Monasson R, Kirkpatrick S, Selman B, Troyansky L. Determining computational complexity from characteristic ‘phasetransitions’. Nature, 1999,400:133−137.[4] Kautz H, Selman B. Unifying SAT-based and graph-based planning. In: Gottlob G, Walsh T, eds. Proc. of the Int’l Joint Conf. onArtificial Intelligence (IJCAI). Seattle: Morgan Kaufmann Publishers, 1999. 318−325.[5] Kautz HA. Deconstructing planning as satisfiability. In: Zilberstein S, Koehler J, Koenig S, eds. Proc. of the 21st National Conf. onArtificial Intelligence (AAAI 2006). Menlo Park: AAAI Press, 2006. 178−183.[6] Majercik SM, Littman ML. Contingent planning under uncertainty via stochastic satisfiability. Artificial Intelligence, 2003,147(1-2):119−162.[7] Palacios H, Bonet B, Darwiche A, Geffner H. Pruning conformant plans by counting models on compiled d-DNNF representations.In: Biundo S, Myers KL, Rajan K, eds. Proc. of the ICAPS 2005. Menlo Park: AAAI Press, 2005. 141−150.[8] Bacchus F, Dalmao S, Pitassi T. Algorithms and complexity results for #SAT and Bayesian inference. In: Blum A, Randall D,Upfal E, eds. Proc. of the FOCS 2003. Washington: IEEE Computer Society, 2003. 340−351.[9] Birnbaum E, Lozinskii E. The good old Davis-Putnam procedure helps counting models. Journal of Artificial Intelligence Research,1999,10(1):457−477.1722 Journal of Software软件学报 V ol.20, No.7, July 2009[10] S ang T, Bacchus F, Beame P, Kautz H, Pitassi T. Combining component caching and clause learning for effective model counting.In: Hans KB, Zhao XS, eds. Proc. of the SAT 2004. Berlin, Heidelberg: Springer-Verlag, 2004. 20−28.[11] Sang T, Beame P, Kautz H. Heuristic for fast exact model counting. In: Hans KB, Zhao XS, eds. Proc. of the SAT 2005. Berlin,Heidelberg: Springer-Verlag, 2005. 226−240.[12] Sang T, Beame P, Kautz H. Solving Bayesian networks by weighted model counting. In: Zilberstein S, Koehler J, Koenig S, eds.Proc. of the 20th National Conf. on Artificial Intelligence (AAAI 2005). Menlo Park: AAAI Press, 2005. 475−482.[13] Wei W, Selman B. A new approach to model counting. In: Hans KB, Zhao XS, eds. Proc. of the SAT 2005. Berlin, Heidelberg:Springer-Verlag, 2005. 324−339.[14] Chavira M, Darwiche A. Compiling Bayesian networks with local structure. In: Gottlob G, Walsh T, eds. Proc. of the Int’l JointConf. on Artificial Intelligence (IJCAI). Seattle: Morgan Kaufmann Publishers, 2005. 211−219.[15] Chavira M, Darwiche A. On probabilistic inference by weighted model counting. Artificial Intelligence, 2008,172(6-7):772−799.[16] Darwiche A. On the tractability of counting theory models and its application to belief revision and truth maintenance. Journal ofNon-Classical Logics, 2001,11(1-2):11−34.[17] L in H, Sun JG, Zhang YM. Theorem proving based on extension rule. Journal of Automated Reasoning, 2003,31(1):11−21.[18] Lin H, Sun JG. Knowledge compilation using extension rule. Journal of Automated Reasoning, 2004,32(2):93−102.[19] Wu X, Sun JG, Lin H, Feng SS. Modal extension rule. Progress in Natural Science, 2005,15(6):550−558.[20] S un JG, Li Y, Zhu XJ, Lu S. A novel theorem proving algorithm based on extension rule. Journal of Computer Research andDevelopment, 2009,46(1):9−14 (in Chinese with English abstract).附中文参考文献:[20] 孙吉贵,李莹,朱兴军,吕帅.一种新的基于扩展规则的定理证明算法.计算机研究与发展,2009,46(1):9−14.附录A. 相关定理证明定理3的证明:当S=2m时,定理3可以被描述为:子句集Σ不可满足当且仅当Σ中含有2m个互不相同的子句.我们在文献[9]中的定理2.1中已经证明了这个结论.下面我们只需要讨论S<2m的情况.充分性:在Σ中最多只含有2m个子句,从中抽取出任何一个子句得到一个新的子句集合Σ1,根据文献[9]中的定理 2.1,Σ1是可满足的.事实上,缺少的那个子句的“非”就是该子句集的一个模型,这是因为对于子句集中子句都是极大项的情况,一个子句只有和它的否定放在一起才是不可满足的.若子句集Σ中缺少子句C i,¬C i只有和C i放在一起才不可满足,而Σ当中恰好没有C i,因此Σ可满足,¬C i是Σ的一个模型.由于每个极大项的“非”都是子句集合的一个模型,同时Σ中最多有2m个模型,因此,若Σ中含有S个子句,则Σ含有2m−S个模型.必要性:显然,由m个原子组成的子句共有2m个不同的赋值.对于子句集中的每个赋值,它的“非”是一个极大项.而对于Σ中的每个赋值,它只能使其“非”形式的子句为假.因此,如果一个赋值不是Σ的模型,则它的“非”形式的子句一定出现在Σ中.如果Σ中含有2m−S个模型,则剩下的S个不可满足赋值的“非”形式子句一定都在Σ中,因此Σ中含有S个子句.定理4的证明:正确性:如果一个子句集经过扩展后被判定为含有2m−S个模型,那么它扩展后得到的极大项的集合一定含有S个互不相同的全子句.由定理3,该极大项的集合一定含有2m−S个模型,再由扩展规则的等价性可知,原子句集一定含有2m−S个模型.完备性:如果一个子句集含有2m−S个模型,那么它扩展后得到的极大项的集合也一定含有2m−S个模型.再由定理3可知,其中一定含有S个互不相同的全子句.定理8的证明:给定一个EPCCL理论,利用公式(1),我们可以在线性时间内计算出它的极大项个数,因为这时只需要计算公式(1)的前n项.因为根据定理5,从第n+1项开始所有的项都为0.因而根据定理3,我们可以在多项式时间内计算出EPCCL理论的模型个数.。
电脑的起源英文作文
电脑的起源英文作文示例1:The Origin of ComputersComputers have become an integral part of our lives, but have you ever wondered about their origins? The history of computers dates back to the early 19th century when the concept of a programmable machine was first introduced.The first known mechanical computer was the Analytical Engine, designed by Charles Babbage in the 1830s. Although it was never built during his lifetime, Babbage's invention laid the foundation for modern computers. The Analytical Engine was capable of performing complex calculations and had a memory system similar to today's computers.However, it wasn't until the mid-20th century that electronic computers were developed. During World War II, scientists and engineers worked on building machines that could assist in military calculations. One such machine was the Electronic Numerical Integrator and Computer (ENIAC), which was completed in 1945. ENIAC was the world's first general-purpose electronic computer andmarked a significant milestone in computer history.Following the success of ENIAC, computer technology continued to evolve rapidly. The introduction of transistors in the late 1940s and early 1950s paved the way for smaller and more efficient computers. Transistors replaced bulky vacuum tubes and allowed for the creation of the first generation of computers, known as mainframes.In the 1960s, the concept of time-sharing emerged, enabling multiple users to access a single computer simultaneously. This led to the development of minicomputers, which were smaller and more affordable than mainframes. The 1970s saw the birth of microprocessors, which further revolutionized the computer industry. Microprocessors allowed for the creation of personal computers, making computing accessible to individuals for the first time.The 1980s and 1990s witnessed a rapid advancement in computer technology, with the introduction of graphical user interfaces and the internet. Computers became more user-friendly, and the World Wide Web opened up a whole new world of information andcommunication.Today, computers are an indispensable part of our daily lives, used in various fields such as education, business, entertainment, and research. They have become smaller, faster, and more powerful, thanks to continuous advancements in technology.In conclusion, the origin of computers can be traced back to the 19th century, with the development of the Analytical Engine. From mechanical computers to electronic machines and the advent of microprocessors, computers have come a long way. They have revolutionized the way we work, communicate, and access information, making them an essential tool in the modern world.示例2:The Origin of ComputersComputers have become an integral part of our daily lives, from personal use to professional applications. However, have you ever wondered about the origin of these incredible machines? Let's delve into the fascinating history of computers.The concept of a computer can be traced back to ancient times when humans used tools like the abacus for calculations. However, the modern computer as we know it today originated in the mid-20th century.The first electronic computer, known as the ENIAC (Electronic Numerical Integrator and Computer), was developed during World War II by John W. Mauchly and J. Presper Eckert. This massive machine, weighing around 30 tons, was built for the United States Army to calculate artillery firing tables. Although the ENIAC was an impressive invention, it was far from being a personal computer due to its size and complexity.The real breakthrough in computer history came with the development of the transistor. In 1947, three scientists at Bell Laboratories, John Bardeen, Walter Brattain, and William Shockley, invented this small electronic device that could amplify and switch electronic signals. Transistors replaced the bulky and unreliable vacuum tubes used in early computers, making computers smaller, faster, and more reliable.The next significant milestone in computer history was thedevelopment of integrated circuits, also known as microchips. In the late 1950s and early 1960s, engineers began to integrate multiple transistors onto a single silicon chip, revolutionizing the computer industry. This advancement further reduced the size of computers and increased their processing power.The 1970s witnessed the emergence of the personal computer (PC). Companies like Apple and Microsoft played crucial roles in making computers accessible to individuals. The introduction of the Apple II and the IBM PC in the late 1970s and early 1980s made personal computers popular among the general public. These machines were smaller, more affordable, and user-friendly, paving the way for the computer revolution.Over the years, computers have continued to evolve rapidly. The development of the internet and the World Wide Web in the 1990s brought computers into every household, connecting people globally and transforming the way we communicate, work, and access information.In conclusion, the origin of computers can be traced back to the innovative minds of scientists and engineers who revolutionizedtechnology throughout history. From the massive ENIAC to the modern-day smartphones, computers have come a long way, making our lives easier and more efficient. The continuous advancements in computer technology promise an exciting future with endless possibilities.示例3:The Origin of ComputersComputers have become an integral part of our daily lives, revolutionizing the way we work, communicate, and access information. However, the origin of computers can be traced back to several key developments in history.One of the earliest precursors to computers was the abacus, which was developed in ancient China around 2000 BCE. The abacus allowed for simple arithmetic calculations by manipulating beads on rods. Although primitive by today's standards, the abacus laid the foundation for the concept of counting and calculating.Fast forward to the 19th century, and we see the emergence of mechanical calculators. Charles Babbage, an English mathematician,is often credited with designing the first mechanical computer called the Analytical Engine. Although this machine was never built during Babbage's lifetime, it incorporated many key elements of modern computers, such as a central processing unit (CPU) and memory.The true birth of modern electronic computers can be attributed to the efforts of Alan Turing and his team at Bletchley Park during World War II. Turing, a British mathematician and computer scientist, played a crucial role in breaking the German Enigma code by developing the Bombe machine. This machine helped decipher encrypted messages and significantly contributed to the Allied victory.Following the war, the development of computers accelerated with the invention of the transistor in 1947. Transistors replaced bulky vacuum tubes, making computers smaller, faster, and more reliable. Subsequently, the integrated circuit, or microchip, was invented in the late 1950s, further advancing computer technology.The 1970s marked the beginning of the personal computer revolution. Companies like Apple and IBM introduced affordable anduser-friendly computers, bringing computing power to the masses. The invention of the graphical user interface (GUI) by Xerox PARC in the 1980s made computers even more accessible by allowing users to interact with them using icons and menus.Today, computers have become an indispensable tool in every aspect of our lives. From smartphones to supercomputers, the evolution of computers has been remarkable. The relentless pursuit of innovation and advancements in technology continues to shape the future of computing, promising even more exciting possibilities.In conclusion, the origin of computers can be traced back to ancient counting devices, the visionary ideas of Charles Babbage, the breakthroughs during World War II, and subsequent inventions like the transistor and microchip. The journey from the abacus to modern computers is a testament to human ingenuity and our constant quest for knowledge and progress.。
cloc 统计方法数量
cloc 统计方法数量Writing code is an essential part of software development, and code quality is crucial for the success of any project. One way to measure the quality of code is to analyze the number of methods in a codebase using tools like cloc. Cloc is a command-line tool that counts lines of code, but it can also be used to count the number of methods in a codebase. Counting the number of methods in a codebase can help developers understand the complexity of the code and identify potential areas for improvement.编写代码是软件开发的重要组成部分,代码质量对于任何项目的成功至关重要。
测量代码质量的一种方法是使用工具如cloc分析代码库中方法的数量。
Cloc是一个命令行工具,用于计算代码行数,但也可以用于计算代码库中方法的数量。
统计代码库中方法的数量可以帮助开发人员了解代码的复杂性,并识别潜在的改进方向。
Counting the number of methods in a codebase can also help teams estimate the effort required to maintain and enhance the code. By understanding the number of methods in a codebase, teams can better plan their development efforts and allocate resourceseffectively. Additionally, knowing the number of methods in a codebase can help teams identify potential areas of technical debt that need to be addressed to ensure the long-term maintainability of the code.统计代码库中方法的数量还可以帮助团队估计维护和加强代码所需的工作量。
数能融合 英语
数能融合英语Mathematics is a fundamental discipline that underpins many aspects of our lives. It is a language that allows us to understand and describe the world around us, from the smallest subatomic particles to the vast expanse of the universe. At the heart of mathematics lies the concept of numbers, which have been the focus of human inquiry and exploration for centuries.Numbers are the building blocks of mathematics, and they have the power to transform our understanding of the world. They can be used to measure, quantify, and analyze phenomena, enabling us to make sense of the complex and often unpredictable nature of the universe. From the simple counting of objects to the intricate calculations of advanced scientific theories, numbers are the foundation upon which we construct our understanding of the world.One of the key ways in which numbers can be integrated into our lives is through the study of mathematics. By learning and applying mathematical principles, we can gain a deeper appreciation for the patterns and structures that underlie the world around us. Whetherwe are working with simple arithmetic or delving into the realms of calculus and linear algebra, the study of mathematics allows us to develop critical thinking skills, problem-solving abilities, and a deeper understanding of the world.Moreover, the integration of mathematics into our lives extends far beyond the confines of the classroom or the laboratory. In our daily lives, we encounter numerous situations where the application of mathematical principles can be invaluable. From budgeting our finances to navigating the complexities of modern technology, the ability to think mathematically can be a powerful tool for navigating the challenges of the modern world.One area where the integration of mathematics is particularly evident is in the field of science and technology. From the development of complex algorithms to the analysis of large datasets, the application of mathematical principles is essential for advancing our understanding of the natural world and driving technological innovation. Whether we are studying the behavior of subatomic particles, the dynamics of planetary motion, or the intricacies of biological systems, the integration of mathematics is a crucial component of scientific inquiry and discovery.In the realm of engineering, the integration of mathematics is equally essential. Engineers rely on a deep understanding of mathematicalprinciples to design and build the structures, machines, and systems that shape our modern world. From the construction of bridges and buildings to the development of advanced robotics and transportation systems, the ability to apply mathematical principles is a fundamental skill for engineers and technicians.Beyond the realms of science and technology, the integration of mathematics can also be found in the arts and humanities. In music, for example, the underlying structure of musical compositions is often based on mathematical principles, such as the patterns of rhythm and harmony. Similarly, in the visual arts, the use of mathematical concepts like proportion, symmetry, and perspective can be seen in the creation of beautiful and compelling works of art.Even in the social sciences, the integration of mathematics can be a powerful tool for understanding and analyzing complex human behaviors and social phenomena. From the statistical analysis of demographic data to the modeling of economic and political systems, the application of mathematical principles can provide valuable insights into the workings of human society.In conclusion, the integration of mathematics into our lives is a multi-faceted and far-reaching phenomenon. Whether we are working in the fields of science, technology, engineering, the arts, or the social sciences, the ability to think mathematically and applymathematical principles is a crucial skill for navigating the complexities of the modern world. By embracing the power of numbers and the integration of mathematics into our lives, we can unlock new possibilities for discovery, innovation, and understanding, and ultimately, a deeper appreciation for the remarkable world in which we live.。
英文文本信息量的计算流程图
英文文本信息量的计算流程图Calculating text informativeness in English is a process that requires a series of steps. First off, you need to identify the key words and phrases in the text. These are the building blocks of information. After that, you'll analyze the complexity of the sentences. Long, convoluted sentences tend to carry more detail and nuance.Next, consider the topic and context of the text. Is it a technical manual or a casual conversation? The formality and specificity of the language affect the perceived informativeness.Don't forget to look at the frequency of certain words or phrases. Repetition can either emphasize a point or indicate redundancy, both affecting the overall informativeness.Another crucial aspect is the novelty of the information. Is this something new or just a rehash ofwhat's already known? New insights and perspectives add to the text's informativeness.Lastly, consider the intended audience. What level of knowledge do they have? Texts that are tailored to a specific audience with the right level of detail tend to be more informative.In summary, calculating text informativeness isn't just about counting words. It's about analyzing the language, context, novelty, and audience to get a true sense of how much new information is being communicated.。
叙事医学英文作文
叙事医学英文作文I remember the first time I witnessed a medical emergency. It was a chaotic scene, with people shouting and running around in panic. I could feel my heart racing as I tried to make sense of what was happening. The patient, a middle-aged man, was lying on the ground, pale and unresponsive. It was clear that he needed immediate medical attention.Without thinking, I rushed to his side and checked for a pulse. There was none. I immediately started performing CPR, pushing hard and fast on his chest. The adrenaline was coursing through my veins as I focused on the task at hand.I could hear the sound of my own voice counting the compressions, urging myself to keep going.Suddenly, there was a gasp from the patient. His eyes fluttered open, and he started breathing again. It was a moment of relief and triumph. The paramedics arrivedshortly after and took over, but I couldn't help but feel asense of pride for being able to help save a life.Another memorable experience in my journey through medical school was witnessing a surgery for the first time. The operating room was sterile and filled with the sound of beeping monitors and the smell of disinfectant. I stood in awe as the surgeon skillfully maneuvered his instruments, his hands steady and precise.As I watched the surgery unfold, I couldn't help but marvel at the complexity of the human body. The surgeon's movements were like a dance, each step carefully choreographed to ensure the best possible outcome for the patient. It was a humbling experience, a reminder of the immense responsibility that comes with being a doctor.One of the most challenging moments I faced during my medical training was breaking bad news to a patient. I had to deliver the diagnosis of a terminal illness, knowingthat it would shatter their world. It was a heavy burden to bear, and I struggled to find the right words.I sat down with the patient and their family, trying my best to convey empathy and compassion. It was a difficult conversation, filled with tears and heartbreak. But in that moment, I realized the importance of being there for someone during their darkest times. It was a lesson in the power of human connection and the impact that a caring presence can have on a person's journey towards healing.Throughout my medical education, I have encountered countless moments that have shaped me as a future physician. From the adrenaline rush of saving a life to the awe-inspiring complexity of surgery, and the heart-wrenching task of delivering bad news, each experience has taught me valuable lessons about the human condition.As I continue on this path, I am reminded of the privilege and responsibility that comes with being a doctor. It is not just a profession, but a calling to serve and heal. And I am grateful for every opportunity to make a difference in the lives of my patients, no matter how bigor small.。
问题的复杂度complexity
問題的複雜度(complexity)●問題的複雜度中之「問題」(problem)所指的並非「單一問題」,而是「某類問題」,例如:加法「問題」、乘法「問題」、排序「問題」…等。
In theory of computational complexity, “problem” means a kind of problem, instead of an instance of problem. For example, “1 + 1” is an instance of addition problem.●問題的「複雜度」,係指要解決該類問題,需要花多少演算時間(步驟)。
Problem complexity is a measurement of time (steps) to solve a kind of problem. There are two assumptions:⏹假設有充足的記憶體空間。
There is sufficient (unlimited) memory space.⏹假設演算法採用順序性處理(sequential processing),而非平行處理(parallelprocessing)。
Algorithm uses sequential processing, instead of parallel processing.●問題的類型(type of problem s):●有關undecidable problems(paradox)的例子:Examples of undecidable problems (paradox):⏹例1.「有個理髮師,只為不為自己理髮的人理髮。
」那麼,請問該理髮師的頭髮是誰理的?Ex1. The barber is a man in town who shaves those and only those men in townwho do not shave themselves. Who shaves the barber?⏹例2.「我說的話都是謊話」,請問我說的話是真的嗎?Ex.2. This statement is false.●有關unsolvable與solvable的例子:Examples of unsolvable and solvable problems:⏹solvable例子:1.「任一地圖,是否可以用3個顏色塗填不同區域而使相鄰兩區域顏色不會重覆?」這問題已被証明是不可能的。
The Complexity of Kings
a r X i v :c s /0506055v 1 [c s .C C ] 14 J u n 2005The Complexity of Kings 1Edith Hemaspaandra 2Department of Computer Science Rochester Institute of Technology Rochester,NY 14623USA Lane A.Hemaspaandra 3Department of Computer Science University of Rochester Rochester,NY 14627USA Osamu Watanabe 4Department of Mathematical and Computing Sciences Tokyo Institute of Technology Tokyo,152-8552,Japan June 13,20051This report will appear as a technical/research report at U.R.,T.I.T.,and the Computing Research Repository.2Supported in part by grant NSF-CCR-0311021.Work done in part while on sabbatical at the University of Rochester and while visiting the Tokyo Institute of Technology.3Supported in part by grant NSF-CCF-0426761and JSPS Invitational Fellowship S-05022.Work done in part while visiting the Tokyo Institute of Technology.4Supported in part by “New Horizons in Computing”(2004–2006),an MEXT Grant-in-Aid for Scientific Research on Priority Areas.AbstractA king in a directed graph is a node from which each node in the graph can be reached via paths of length at most two.There is a broad literature on tournaments(completely oriented digraphs),and it has been known for more than half a century that all tournaments have at least one king[Lan53].Recently,kings have proven useful in theoretical computer science,in particular in the study of the complexity of the semifeasible sets[HNP98,HT05] and in the study of the complexity of reachability problems[Tan01,NT02].In this paper,we study the complexity of recognizing kings.For each succinctly specified family of tournaments,the king problem is known to belong toΠp2[HOZZ].We prove that this bound is optimal:We construct a succinctly specified tournament family whose king problem isΠp2-complete.It follows easily from our proof approach that the problem of testing kingship in succinctly specified graphs(which need not be tournaments)isΠp2-complete.We also obtainΠp2-completeness results for k-kings in succinctly specified j-partite tournaments,k,j≥2,and we generalize our main construction to show thatΠp2-completeness holds for testing k-kingship in succinctly specified families of tournaments for all k≥2.1Introduction1.1General Introduction and OverviewWe study the complexity of recognizing kings.Throughout this paper,unless otherwise stated,Σ={0,1},and each graph will be simple(no self-loops)and directed,and will have at least one node.A node v of a graph G=(V G,E G)is said to be a king exactly if each node in G can be reached from v via a path of length at most two.In the1950s,Landau noted the simple but lovely result that every tournament—i.e.,every graph G such that for each pair of distinct nodes a,b∈V G,exactly one of the directed edges a→b and b→a occurs in E G—contains at least one king[Lan53]. (Throughout this paper“a→b occurs in E”and“(a,b)∈E”will be synonymous.In the former form,we will sometimes simply write“a→b”when the edge set E is clear from context.)When tournaments are specified explicitly in the natural way,it is not hard to see that the king problem isfirst-order definable,and so by Lindell[Lin92]is in AC0 (see[Tan01,NT02],which have analogous discussions for reachability—and which involve kings in their proofs;we also mention that a number of papers interestingly study king-respecting sequencing in nonsuccinctly specified tournaments,see,e.g.,[SSW03,HC03]and the references therein).Thus,in this paper we focus mostly on the case that actually arises in the study of the semifeasible sets,namely,succinctly specified tournament families,though we will also resolve the general case of succinctly specified graphs(which is in some sense an easier result,since the lower bound is the challenging part).In particular,we focus on families of tournaments that are defined,uniformly,by a P-time function.To formalize this,we in effect adopt the existing formalism(though,for clarity,not the naming scheme)that is already provided by the theory of semifeasible sets. In particular,we say a function f is a tournament family specifier exactly if1.f is a polynomial-time computable function.2.(∀x,y∈Σ∗)[f(x,y)=f(y,x)].3.(∀x,y∈Σ∗)[f(x,y)=x∨f(x,y)=y].We interpret this as specifying,in the following way,a family of tournaments,one per length. At each length n,the nodes in the length n tournament specified by f will be the strings in Σn.For each two distinct nodes among these,x and y,the edge between them will go from x to y if f(x,y)=x and will go from y to x if f(x,y)=y.Since our function f always chooses one of its inputs and is commutative,this indeed yields a family of tournaments. We will call the tournament just described the length n tournament induced by f.This formalism is precisely the one that plays an important role in the study of the semifeasible sets,and in Section1.2we will explain what the connection is,and why we were motivated to study the complexity of kings.1For f a tournament family specifier,the set whose complexity we willfirst study is Kings f={x|x is a king in the length|x|tournament induced by f}.Πp2=coNP NP is the“Π-side”second level of the polynomial hierarchy[MS72,Sto76].It is already known that for each tournament family specifier f,Kings f∈Πp2[HOZZ].The central result of this paper shows that that result is optimal:We prove that there is a tournament family specifier f such that Kings f isΠp2-complete(i.e.,is≤p m-complete for Πp2).We will note that if one changes one’s notion of tournament family specifier to an analogous one that specifies an infinite family of graphs,Πp2-completeness still holds.(Since the difficult part here is theΠp2-hardness lower bound,proving our result for the special case of tournaments is in fact harder than proving it in the general case.But we undertake the greater challenge of tournaments both because it yields easily the other cases,and because it better connects to the motivating issue from the theory of semifeasible sets.) It is easy to see from our proof that we also obtainΠp2-completeness for the following problem,which some mayfind more natural as it deals not with uniform families of problems but just with individual inputs:“Given a succinctly specified(via a circuit following the Galperin–Wigderson model2)graph G and a node x∈V G,is x a king of G?”Note that we do not require that G be a tournament.Recall that the central result of this paper is that there is a tournament family specifier f such that Kings f isΠp2-complete.Can one in some broad cases do better thanΠp2-completeness?We note that for tournament family specifiers that are associative,the king problem in fact is always in coNP,yet for associative specifiers we also prove that the king problem cannot be coNP-complete unless P=NP.On the other hand,we show that various natural complexity levels are precisely the complexity of the king problem of some tournament family specifiers:There are tournament family specifiers f for which Kings f is coNP-complete,and there are tournament family specifiers f for which Kings f is NP-complete.The results mentioned above,about the complexity of kings in tournaments(and graphs),appear in Section2.Recall that kings are nodes that cover the whole graph via paths of length at most two.The notion has been generalized as follows.For eachfixed k,a k-king in a digraph is a vertex that can reach all other vertices in the digraph viapaths of length at most k.The existence of k-kings has been intensely studied,especially with respect to multipartite tournaments,e.g.,it is known that no multipartite tournament that has two or more nodes of indegree zero can have a k-king for any k,and it is known that every multipartite tournament having at most one vertex of indegree zero does have a 4-king([Gut86,PT91],see also[BG98]and the references therein).Section3studies the complexity of testing k-kingship in tournaments(and graphs)for values of k other than the k=2case handled in Section2.We will show that for k=1 the problem is simpler,but for k>2it remainsΠp2-complete,via a proof that rather interestingly is not a perfect analog of the k=2case.Section4studies the complexity of testing k-kingship in multipartite tournaments, which as mentioned above is the domain in which k-kingship,k>2,has primarily been studied previously(though to the best of our knowledge never regarding the computational complexity of recognizing k-kings).This section is in the model of studying succinct graphs (not graph families via a specifier),which seems the most natural model for that study. We completely capture the complexity in each case as either belonging to P or beingΠp2-complete.Section5presents some open issues for further study.1.2Connections to Semifeasible SetsSelman initiated the study of the semifeasible sets in a series of papers starting in 1979[Sel79,Sel81,Sel82b,Sel82a].A set A is P-selective(or semifeasible)exactly if there is a polynomial-time computable function f(called a P-selector function for A)such that,for each x,y∈Σ∗,(a)f(x,y)=x or f(x,y)=y,and(b){x,y}∩A=∅=⇒f(x,y)∈A.(For a discussion of the motivation for,and examples and applications of,the semifeasible sets, see[HT03],especially[HT03,Preface].)It was soon observed by Ko[Ko83]that whenever there exists such a function for A,then there exists such a function that in addition is commutative,i.e.,(∀x,y)[f(x,y)=f(y,x)].However,note that(aside from the connection with A)such functions are precisely tournament family specifier functions.Indeed,this connection between commutative P-selector functions and families of tournaments has been very useful in obtaining results about the P-selective sets.More particularly,this connection has been used—starting with the important work of Ko[Ko83]establishing that all P-selective sets have small circuits—to get results on the advice complexity of the P-selective sets.In the rest of this subsection,we will speak a bit about advice classes.So we now quickly define those,although we assume the reader is generally familiar with the notion.However, readers who are interested just in our completeness results,or who are unfamiliar with the notion of advice classes,can safely skip to Section1.3.Advice classes,introduced by Karp and Lipton[KL80],ask what class of sets a given complexity class can accept when given a small amount of extra information that depends only on the length of the string whose membership is being asked about.These classes have been the subject of extensive study,and are key tools in showing that certain complexity assumptions would collapse the polynomial hierarchy.The classes are formally defined as3follows(we copy this definition from[HT03],but it is faithful to the exact notion of Karp and Lipton).Definition1.1 1.Let f:N→N be any function.Let C be any collection of sets.Define C/f={A|(∃B∈C)(∃h:N→Σ∗)[(∀n)[|h(n)|=f(n)]∧(∀x∈Σ∗)[x∈A⇐⇒ x,h(|x|) ∈B]]}.2.Let F be any class of functions mapping from N to N.DefineC/F={A|(∃f∈F)[A∈C/f]}.3.“linear”(“poly”)will denote all functions from N to N where the value of the outputis linearly bounded(polynomially bounded)in the value of the input.For example,P/n is the class of sets that are,informally put,so simple that with just n extra bits of help at each length n they can be accepted by deterministic polynomial-time machines.And Ko’s[Ko83]result mentioned earlier can be stated as{L|L is a P-selective set}⊆P/poly.Let us return to the P-selective sets.When seeking to prove an advice result for a P-selective set,the standard approach is to take a commutative P-selector function for the set and view it as a tournament family specifier function,and then to exploit some properties of the tournament to construct algorithms that show that the set can be accepted with surprisingly little advice.(Sometimes the focus of the arguments is not on the entire tournament at a given length but rather is on the subtournament consisting of just the strings of that length that happen to belong to the P-selective set.However,that is not of crucial interest to us.And in the key motivating example,the focus in fact is on all the strings of a given length.)Due to this close connection between advice results and tournaments,it is hardly surprising that Landau’s result that all tournaments(by which we always mean all nonempty tournaments)have at least one king has proven useful in the study of P-selective sets and their advice.For example,Landau’s result underpins the proof that all P-selective sets belong not merely to NP/linear[HT96]but even to NP1/linear[HNP98],where NP1is the class of all sets accepted by NP machines using only linearly many nondeterministic guess bits(this class forms thefirst level of the limited nondeterminism hierarchy of[KF77], cf.[KF80]).The particular use of Landau’s result that brought our interest to this topic is related but somewhat different.As mentioned earlier,it has recently been noted(this is clear by brute force)that for any tournament family specifier f the problem Kings f belongs toΠp2. However,note that in a tournament,induced by any commutative P-selector function for a P-selective set A(in our terminology,the P-selector function serves as an appropriate tournament family specifier),we have that for each length n it holds that:If any string belongs to A at length n,then all kings in the tournament at length n belong to A.And4by Landau’s result,there always is at least one king in each such tournament.This led Hemaspaandra and Torenvliet to the following observation.Theorem1.2([HT05])The class of P-selective sets is notΠp2/1-immune.(That is,each infinite P-selective set has an infinite subset belonging toΠp2/1.)A natural way to seek to improve that nonimmunity upper bound would be to improve theΠp2upper bound on the complexity of Kings f.However,the core result of this paper precisely shows that that particular line of attack is essentially hopeless,since we prove that there exists a tournament family specifier f such that Kings f isΠp2-complete.It however remains conceptually possible that some other attack might lower theΠp2/1bound.Also, as mentioned earlier,the core result of this paper directly shows that theΠp2upper bound of[HOZZ]has a matching lower bound.1.3Comparison with Other WorkWe now mention another paper that exploits Landau’s king result,and we compare and contrast that other paper to the work of Section2of the current paper.Tantau([Tan01], see also the more general conference version by Nickelsen and Tantau[NT02])critically uses Landau’s king result in proving that nonsuccinct tournament reachability isfirst-order definable.That same paper proves(not via the king result)that in the Galperin–Wigderson model succinct tournament reachability isΠp2-complete.This is a lovely result,but differs from our core result(i.e.,our Theorem2.1:There is a tournament family specifier f such that Kings f isΠp2-complete)in multiple ways.First,for Tantau,theΠp2upper bound is critically dependent on the graphs being tournaments.In contrast,for us and the king problem,theΠp2upper bound easily holds for both tournaments and general graphs,and for each of those,in both the family-specifier model and in the Galperin–Wigderson model of inputting individual graph instances as a circuit.Second,though this is less a difference than a caution,it is true that a node v is a king exactly if for each other node w one can reach w from v via some path of length at most two.But that connection in no way implies that hardness results for reachability(or even reachability via paths of length at most two)imply hardness results for the king problem in our model.Third,we stress that our core result is in the model where we study a tournament family specifier.In this model,for the tournament family specifier f,there is just one tournament at each length.Thus,one might perhaps expect merely collective≤p m-hardness for TALLY∩Πp2(i.e.,one might expect merely that TALLY∩Πp2⊆{L|(∃tournament family specifier f)[L≤p m Kings f]}),rather than having outrightΠp2-hardness hold.In fact,in our most central proof—that of Theorem2.1—one main obstacle is to show how an exponential number of separate kingship problems can be embedded all into a single tournament in such a way that they do not cross-pollute each other.In contrast,in the Galperin–Wigderson model this difficult issue does not exist,as there the input is a(node whose kingship we are interested in,and a succinctly specified)single graph or tournament.5Why do we in Theorem2.1seek to clear this higher bar of studying families?Because we find it interesting,because our proof will be so general as to in effect give all the other cases easily,and because this is the model of the existingΠp2upper bound of[HOZZ]and so,to show that that upper bound cannot be improved,we cannot validly cheat by changing to an easier-to-resolve issue.On the other hand,Tantau’s[Tan01](and Nickelsen–Tantau’s[NT02])work does share with this paper one important property.Both their work and ours—in contrast with the many earlier papers showing that a wide variety of properties of succinctly specified graphs are PSPACE-hard[Wag84,Wag86,PY86]—pinpoints succinctly specified graph problems whose complexity falls at a substantially lower level,namely,Πp2(see also[GW83,Wag86]).Finally,we mention that the generalization achieved in the transition from Tantau’s paper[Tan01]to the Nickelsen–Tantau paper[NT02],namely,moving from tournaments to graphs of bounded independence number,is not particularly interesting in our case.For the king problem in our setting,ourΠp2-hardness lower bounds are immediately inherited by the moreflexible case of independence numbers beyond two(i.e.,beyond the number possessed by tournaments),and though theΠp2upper bound doesn’t automatically transfer, it is for those problems in our case immediately obvious,directly,that it holds.2The Complexity of Kingship(i.e.,2-Kingship)in Tournaments and GraphsWe now prove our core result.Theorem2.1There is a tournament family specifier f such that Kings f isΠp2-complete.The proof has two parts.First,we show how a singleΠp2-type formula can be converted to a king problem.Then—since Kings f speaks of just one tournament per length—we show how one can in effect embed an exponential number of king problems into a single length without creating any damaging cross-pollution.Proof of Theorem2.1It is easy to see that for every tournament family specifier f,Kings f is inΠp2[HOZZ].We will in this proof define a tournament family specifier f such that Kings f isΠp2-hard.For this tournament family specifier f,we will showΠp2-hardness for Kings f by a reduction from∀∃SAT,the set of true fully quantified Boolean formulas where all universal quantifiers precede all existential quantifiers.It is well known that∀∃SAT isΠp2-complete[SM73,Wra76].Without loss of generality,we will assume that all formulas in∀∃SAT have the same number of universally quantified variables as existentially quantified variables and that the number of universally quantified variables is greater than0.We will call formulas of the right form∀∃-formulas,i.e.,we say thatφis an∀∃-formula if and only if there exists an integer n>0and a propositional formulaφ′such thatφ=∀x1···∀x n∃y1···∃y nφ′(x1,...,x n,y1,...,y n).Using this terminology,for us ∀∃SAT will denote the set of true∀∃-formulas.We will define our tournament family specifier f in two stages.First we will define for every∀∃-formulaφa tournament Tφ=(Vφ,Eφ)such that a specific“‘potential king”6n +2 φ,100n φ,110n φ,101n φ,111n iffφ′(1n 1n )iffφ′(0n 0Figure 1:First stage of the 2-Kings f Πp 2-hardness constructionnode in V φis a king in T φif and only if φis true.We will then show how to combine all these tournaments into one family of tournaments (specified by f )without disturbing the king-ness of the potential king in T φfor all ∀∃-formulas φ.To make sure that all tournaments T φcan be combined in the desired way,we will use a binary pairing function ·,· that is polynomial-time computable and polynomial-time invertible (by the latter we mean that the range of the function is in P,and that there exist two polynomial-time computable functions that,given a string in the range of the function,return the first and the second component,respectively)such that for all strings x,x ′,y,y ′∈Σ∗,if |x |=|x ′|and |y |=|y |then | x,y |=| x ′,y ′ |and such that for all x,y ∈Σ∗, x,y ∈0∗.It is easy to see that such a pairing function exists,for example by defining x 1x 2···x n ,y as 0x 10x 2···0x n 1y for all x 1,x 2,...,x n ∈Σand y ∈Σ∗.Let φbe an ∀∃-formula.Let n >0and let φ′be a propositional formula such that φ=∀x 1···∀x n ∃y 1···∃y n φ′(x 1,...,x n ,y 1,...,y n ).We will define tournament T φ=(V φ,E φ)in such a way that φ,0n +2 is a king in T φif and only if φis true.Figure 1gives a pictorial representation of T φ.The nodes in V φare arranged in three layers.The first layer consists of the potential king φ,0n +2 .The second layer contains a node φ,10y for every y ∈Σn .These 2n nodes correspond to the 2n possible assignments to the y -variables in φ′.The third layer contains a node φ,11x for every x ∈Σn .These 2n nodes correspond to the 2n possible assignments to the x -variables in φ′.In the figure,we use the convention that missing edges between nodes at different levels go “up,”and that missing edges between nodes at the same level go “right.”Formally,T φ=(V φ,E φ)is defined as follows.V φ={ φ,0n +2 }∪{ φ,10y |y ∈Σn }∪{ φ,11x |x ∈Σn }.Note that all strings in V φhave the same length by the properties of the pairing function.(There will be strings in Σ∗at that length that are not in V φ;this will be handled in the second stage of our construction.)For all z,z ′∈Σn +2such that φ,z , φ,z ′ ∈V φand z <z ′(i.e.,z <lexicographic z ′),let ( φ,z , φ,z ′ )∈E φif and only if•(z =0n +2and z ′=10y for some y ∈Σn ),or7•(z=10y for some y∈Σn and z′=11x for some x∈Σn andφ′(xy)),or•(z=10y for some y∈Σn and z′=10y′for some y′∈Σn),or•(z=11x for some x∈Σn and z′=11x′for some x′∈Σn).For all z,z′∈Σn+2such that φ,z , φ,z′ ∈Vφand z>z′,let( φ,z , φ,z′ )∈Eφif and only if( φ,z′ , φ,z )∈Eφ.It is clear that Tφis a tournament.It is immediate from the construction that• φ,0n+2 is a king in tournament Tφif and only if for all x∈Σn, φ,0n+2 reaches φ,11x in two steps,•for all x∈Σn, φ,0n+2 reaches φ,11x in two steps if and only if there exists a y∈Σn such that( φ,10y , φ,11x )∈Eφ,and•for all x,y∈Σn,( φ,10y , φ,11x )∈Eφif and only ifφ′(xy).From these observations,the following claim follows immediately.Claim2.2 φ,0n+2 is a king in tournament Tφif and only ifφis true.We will now show how to combine the Tφtournaments into a family of tournaments specified by f in such a way that for every∀∃-formulaφ, φ,0nφ+2 is a king in Tφif only if φ,0nφ+2 ∈Kings f,where nφis the number of universally quantified variables inφ.For every∀∃-formulaφand for all x,y∈Vφ,let f(x,y)=x if and only if(x,y)∈Eφ. Note that by definition of ·,· ,all elements in Vφhave the same length.We need to ensure that the rest of f is specified in such a way as to not disturb the king-ness of φ,0n+2 . Note that it is unavoidable that there exist different∀∃-formulasφandψsuch that strings in Vφand Vψhave the same length.Figure2gives a pictorial representation of of the tournament induced by f at length m.In thefigure,φ1,φ2,...,φk are all∀∃-formulas such that Vφi ⊆Σm.Theφi’s are orderedlexicographically,in ascending order.For readability,we write T i for Tφi and n i for nφi.Notethat for all formulasφ,0m∈Vφ(by properties of the pairing function)and φ,010nφ ∈Vφ. We use the convention that all missing arrows between T i and T j go right,that all missing arrows between φi,010n i and φj,010n j go right,that all missing arrows between nodes in“all other strings”go from lexicographically smaller strings to lexicographically larger strings,and that all other missing arrows go up.This completely specifies the tournament on strings of length m.Formally,we define f as follows.LetOther=Σ∗− 0∗∪{ φ,010nφ |φis a∀∃-formula}∪ {Vφ|φis a∀∃-formula} .The set Other is clearly in P,since the pairing function is polynomial-time invertible.For all m and all z,z′∈Σm,let f(z,z′)=z if and only if•z=z′,or8m......all other strings inlexicographic ordern 2 Figure 2:Second stage of the 2-Kings f Πp 2-hardness construction•z =0m and z ′= φ,010n φ for some ∀∃-formula φ,or•z =0m and z ′∈Other ,or•z = φ,010n φ for some ∀∃-formula φand z ′= ψ,010n ψ for some ∀∃-formula ψand φ<ψ,or•z = φ,010n φ for some ∀∃-formula φand z ′∈V φ,or•z = φ,010n φ for some ∀∃-formula φand z ′∈Other ,or•z ∈V φfor some ∀∃-formula φand (z ′=0m or z ′∈Other ),or•z ∈V φfor some ∀∃-formula φand z ′= ψ,010n ψ for some ∀∃-formula ψand φ=ψ,or•z ∈V φfor some ∀∃-formula φand z ′∈V φand (z,z ′)∈E φ,or•z ∈V φfor some ∀∃-formula φand z ′∈V ψfor some ∀∃-formula ψand φ<ψ,or •z,z ′∈Other and z <z ′.For all z,z ′∈Σm ,if f (z,z ′)=z ,then let f (z,z ′)=z ′.The definition of f on strings of different lengths is irrelevant (as long as f remains a tournament family specifier).To be complete,we define f (z,z ′)=z if |z |<|z ′|and f (z,z ′)=z ′if |z |>|z ′|.9It is immediate that for all x,y∈Σ∗,f(x,y)=f(y,x)and that f(x,y)=x or f(x,y)= y.Since the pairing function is polynomial-time invertible,it is easy to see that f is computable in polynomial time.Thus f is a tournament family specifier.Tofinish the proof,letφbe a∀∃-formula and let n=nφ.It remains to show that φ,0n+2 ∈Kings f if and only ifφis true.By Claim2.2,it suffices to show that φ,0n+2 ∈Kings f if and only if φ,0n+2 is a king in Tφ.Let m=| φ,0n+2 |.First suppose that φ,0n+2 is a king in Tφ.It is easy to see from the definition of f at length m that φ,0n+2 reaches all strings inΣm−Vφin one or two steps.(Strings of length m that are in Vψfor some∀∃-formulaψ=φare reached in two steps via ψ,010nψ .)It follows that φ,0n+2 is a king in the tournament induced by f on strings of length m,i.e., φ,0n+2 ∈Kings f.For the converse,suppose that φ,0n+2 is a king in the tournament induced by f on strings of length m.Then every string of length m can be reached from φ,0n+2 in at most two steps.In particular,every element from Vφcan be reached from φ,0n+2 in at most two steps.By the construction of f,there do not exist length two paths v→w→v′such that v,v′∈Vφand w∈Vφin the tournament induced by f on length m.This implies that every node in Vφcan be reached from φ,0n+2 by a path of length at most two such that all nodes of the path are in Vφ.It follows that φ,0n+2 is a king in the tournament induced by f on Vφ,and thus φ,0n+2 is a king in Tφ.To be explicit,our≤p m-reduction g from∀∃SAT to Kings f is as follows.Note that Other=∅and no element of Other belongs to Kings f.Let out be anyfixed element of Other.Our reduction g on an arbitrary inputφwill output out ifφis not a∀∃-formula, and otherwise will output φ,0nφ+2 .u We mention briefly that our proof approach clearly also yieldsΠp2-completeness for general graph families specified by the general-graph analog of tournament family specifiers, and for individual graphs specified in the Galperin–Wigderson formalism(see footnote2). We now give the definitions and theorems to state this explicitly.We say a function f is a graph family specifier exactly if1.f is a polynomial-time computable function.2.(∀x,y∈Σ∗)[f(x,y)=1∨f(x,y)=0].We interpret this as specifying,in the following way,a family of(simple,directed)graphs. At each length n,the nodes in the graph specified by f will be the strings inΣn.And for each two distinct nodes among these,x and y,there is an edge from x to y exactly if f(x,y)=1.We will call the graph just described the length n graph induced by f.We also define two sets to capture the complexity of kingship in tournaments and graphs in the Galperin–Wigderson model.The second of these sets,similarly to[Tan01,NT02], places into the complexity of the set the check(of coNP-type complexity,and easily handled) that the input circuit indeed is a tournament.Here,“the graph specified by c”of course refers to the Galperin–Wigderson model.Kings GW={ c,x |c has2|x|inputs and x is a king in the graph specified by c}.10。
英文数字合集
英文数字合集In the realm of mathematics, numbers are the building blocks of equations and calculations. They are universal, transcending language and culture.From the earliest days of learning, children are introduced to numbers as a means to count and measure. They learn to recognize one through ten, and then progress to the tens and hundreds.As we grow older, numbers take on a more complex role. They become part of algebraic expressions and geometric proofs, revealing the beauty of patterns and sequences.In the world of finance, numbers are crucial. They help us understand the value of assets, the growth of investments, and the fluctuations of the market.In literature, numbers can also be poetic. They can symbolize time, distance, or even the depth of emotions, adding a layer of depth to the narrative.Numbers are also a tool for measurement in science. They help us quantify the world around us, from the speed of light to the mass of a galaxy.In our daily lives, numbers are omnipresent. They are in the dates we mark on calendars, the times we set on ourclocks, and the temperatures we check on our weather apps.Whether it's in the simplicity of counting or the complexity of scientific formulas, numbers are an integral part of our existence, connecting us to the world in countless ways.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
a rXiv:089.1836v1[cs.CC]1Se p28The complexity of counting solutions to Generalised Satisfiability Problems modulo k ∗John Faben †September 10,2008Abstract Generalised Satisfiability Problems (or Boolean Constraint Satis-faction Problems),introduced by Schaefer in 1978,are a general class of problem which allow the systematic study of the complexity of satis-fiability problems with different types of constraints.In 1979,Valiant introduced the complexity class parity P,the problem of counting the number of solutions to NP problems modulo two.Others have since considered the question of counting modulo other integers.We give a dichotomy theorem for the complexity of counting the number of solutions to Generalised Satisfiability Problems modulo in-tegers.This follows from an earlier result of Creignou and Hermann which gave a counting dichotomy for these types of problem,and the dichotomy itself is almost identical.Specifically,counting the number of solutions to a Generalised Satisfiability Problem can be done in polynomial time if all the relations are affine.Otherwise,except for one special case with k =2,it is #k P-complete.1IntroductionThe complexity classP (pronounced ‘parity P’)was first introduced by Valiant in [9].It formalises the question of counting the parity of the numberof solutions to NP problems.Formally,it is the class of languages S such that there is a polynomial time Turing Machine which on input x∈S has an odd number of accepting computations and on x∈S has an even number. In this paper,we will also deal with the problem of counting the number of solutions to NP problems modulo other integers.We will give details of the complexity classes used to deal with this problems in section2.There have been some interesting recent results in this area,with Valiant proving that there exist problems which are complete for P but for which counting the number of solutions modulo7can be done in polynomial time[10].Generalised Satisfiability Problems(also referred to as Boolean Con-straint Satisfaction Problems)are a very general class of problem,which provide the base cases for the reductions in a wide variety of complexity the-oretic proofs.They werefirst studied by Schaefer in[8],where he proved a dichotomy theorem for the decision version of these problems(assuming P=NP).The Generalised Satisfiability Problem is this:given a set S of boolean relations,the S-satisfiability problem is the question of determining whether or not a given S-formula is satisfiable,where an S-formula is a con-junction of S-relations.The set of all satisfiable S-formulae is denoted by SAT(S).For example,if S were the set of all eight3-ary boolean relations, SAT(S)would be the well-known3-SAT language.Schaefer showed that the decision versions of Generalised Satisfiability Problems can be divided into two classes-those which are NP-complete,and those which can be solved in polynomial time,depending on what type of logical relations is contained in the set S.This is in contrast with a result of Ladner that,under the assumption P=NP,there is an infinite hierarchy of problems of increasing complexity between problems in P and problems which are NP complete[4].A dichotomy theorem for the counting version was proved by Creignou and Hermann in[2].They show that the counting version of a Generalised Satisfiability Problem#SAT(S)can be solved in polynomial time if the all the relations in S are affine;if not,#SAT(S)is#P-complete.A revised version of their proof appears in the monograph[6],results from which are used in section4.Given this counting dichotomy,we are motivated to pose the question: among those Satisfiability problems for which the counting problem is known to be#P-complete are there any for which the number of solutions is easy to count modulo some integer k?The answer is almost always no.The dichotomy wefind in this paper is identical to that found in[6]except for one difference for the case k=2.22The classes#k PPrevious work dealing with the complexity of counting modulo integers(e.g.[1][3])has tended to define the relevant complexity class as Mod k P,the set of languages which have non-zero number of accepting paths modulo k for some Turing Machine M.Formally,Mod k P contains for every function f∈#P the language{x∈Σ∗|f(x)≡0(mod k)}For the purposes of the work in this paper,we have chosen to define a slightly different set of classes,which we refer to here as#k P,and which we think more intuitively capture the notion of counting modulo k.Analogous to#P,we define#k P to be class of problems“compute f(x)modulo k”where f(x)is the number of accepting paths of a polynomial time Turing Machine.Like#P,this is a class of function problems rather than a class of decision problems.Formally:be the function mapping from an input x to Definition2.1.Let#acc Mkthe number of accepting paths of the non-deterministic Turing Machine Mfor on input x modulo k.The class#k P consists of all functions#acc Mkall non-deterministic Turing Machines M with polynomial length accepting paths on input x.It seems intuitively that there should be problems for which determining the number of solutions modulo k exactly is harder than determining whether the number of solutions modulo k is non-zero.We have been able to construct artificial examples of such problems,but whether any natural problems with this property exist is an open question.It should be noted that previous papers have used both#k P and Mod k P to refer to the decision class defined above as Mod k P.We will need use the notion of a reduction which is parsimonious modulo k;just as a parsimonious reduction from one counting problem to another is one which preserves the number of solutions exactly,so a reduction which is parsimonious modulo k is one which preserves exactly the number of solutions modulo k.We note in passing that a reduction which is parsimonious is also parsimonious modulo k for all k.Definition2.2.Given two counting problems#A and#B,we say there is a parsimonious reduction from#A to#B if there exists a function f3computable in polynomial time such that for all x,|{y:(x,y)∈A}|={z: (f(x),z)∈B}|.Definition2.3.Given two#k P counting problems,#A and#B,we say there is a parsimonious reduction modulo k(a#k-reduction)from#A to#B if there exists a polynomially computable function f such that|{y:(x,y)∈#B.A}|≡|{z:(f(x),z)∈B}|(mod k).In this case we say#A≤#k Again,in an analogy with#P completeness,we define the notion of#k P-completeness to with respect to Turing reducibility.Essentially,a problem #k A is#k P-complete if every problem in#k P can be solved in polynomial time given an oracle for#k A.Definition2.4.A counting problem#k A∈#k P is#k P-complete if for all other problems#k B∈#k P,#k B can be solved in polynomial time with a #k P oracle for#k A.3PreliminariesIn[6],the counting dichotomy for Generalised Satisfiability Problems is es-tablished via reductions to problems referred to in that paper as#SAT(OR0), #SAT(OR1)and#SAT(OR2).These are the problems of counting the num-ber of satisfying assignments of boolean formulae whose constraints are de-fined by functions of the form x i∨x j,¯x i∨x j and¯x i∨¯x j respectively.In this paper,we will use essentially the same reductions tofind a dichotomy for counting modulo k for all integer k.We therefore begin by proving the following#k-hardness result.Theorem3.1.The problems#k SAT(OR0),#k SAT(OR1)and#k SAT(OR2) are#k P-complete for all k.The proof of this theorem will be in several stages,and will be by re-duction of the satisfiability problems to counting the number of independent sets in various classes of graph.Specifically,to#k INDEPENDENT-SET,the problem of counting the number of independent sets in a general graph mod-ulo k and to#k BIPARTITE-INDEPENDENT-SET,the problem of counting the number of independent sets in a bipartite graph modulo k.We begin by noting that#k SAT(OR2)is trivially reducible to#k SAT(OR0), simply by taking the negation of each literal in the formula.We then make4use of the following lemma,which simply states a well-known equivalence between the two problems:#k SAT(OR2)for all k.Lemma3.2.#k INDEPENDENT-SET≤#kProof.With a graph G on vertices{v1,...,v n}we associate the OR2formulaF on the variables{x1,...,x n}such that the clause¯x i∨¯x j appears in F if and only if there is an edge between vertices v i and v j in G.Then givenan independent set,I in G,the truth assignment,s,which satisfies s(x i)= true⇐⇒v i∈I is a satisfying assignment for F,and vice versa,givena satisfying assignment,the corresponding vertex set is independent.Sothe satisfying assignments of F are in one-to-one correspondence with the independent sets of G,and the reduction is parsimonious.Since the reduction given above is parsimonious,it is parsimonious mod-ulo k for all k.We will also make use of the following lemma.#k SAT(OR1)for Lemma3.3.#k BIPARTITE-INDEPENDENT-SET≤#kall k.Proof.The reduction given by Linial in[5]preserves the number of solutions exactly,and so preserves the number of solutions modulo k for all k.In the rest of this section,we will show that the problems,#k INDEPENDENT-SET and#k BIPARTITE-INDEPENDENT-SET are both#k-complete forall integer k.This will be done by reduction from the problem#k SAT,whichwe define as the problem of counting the number of satisfying assignmentsof a boolean formula in constructive normal form modulo k.This problem is known to be#k-complete since the reduction used in Cook’s Theorem canbe made parsimonious[7].The reductions used in the proofs which follow all have the same basic structure.Given a SAT-formula,we produce a graph in which the indepen-dent sets with a certain property all correspond to satisfying assignmentsof F,and in which the independent sets which do not have this property can be partitioned into k subsets of equal size,the total number of which is therefore zero modulo k.This allows us to produce a formula for the numberof independent sets modulo k,as described in lemma3.4.In the following,I(G),where G is a graph will denote the set of indepen-dent sets of G.We will also use I(G;X),where X is a set of vertices in a5graph G to denote the set of independent sets of G all of whose vertices lie in X.We will also use N(x)to represent the(open)neighbourhood in G of a vertex x and N G(H)to represent the(open)neighbourhood of a subset, X⊂V(G).Lemma3.4.Consider a graph G with the following structure:G consists of a set of vertices X,along with n copies of a graph H, {H1,...,H n},each of which contains distinguished vertex h i.The edges in G either go between vertices in one copy of H,between vertices in X or between some distinguished vertex h i and a vertex in X.Furthermore,H has the property that the total number of independent sets in H is congruent to zero modulo k.The total number of independent sets in G is congruent modulo k to:I0∈I(G;X)ni=1min{|I0∩N G(H i)|,1}×|I(G;H i\{h i})|(1)Proof.The relevant intuition for this proof is that if we have two sets of vertices,say X and Y,satisfying N G(X)∩Y=∅then|I(G;X∪Y)|= |I(G;X)|×|I(G;Y)|.This is because any independent set which lies entirely in X∪Y is the union of an independent set in X and an independent set in Y,and each such union in an independent set by the condition on the neighbourhoods.We note that if J∈I(G)is an independent set in G then I=J∩X is an independent set in X.We partition the independent sets of G according to their intersection with X-we then count the number of independent sets in each partition modulo k and take the sum.Let I be an independent set in X and let[I]denote the set of independent sets in G whose intersection with X is I.Now we consider two cases.First,assume that there is some subgraph H i such that the neighbourhood of H i does not share any vertices with I(i.e.such that I∩N G(H i)=∅).Now, any independent set in[I]can be written as the union of an independent set in H i and an independent set in G\H i the intersection of which with X is I. Furthermore,every such union is an independent set in[I].Then the total number of independent sets in[I]is congruent modulo k to|I(H i)|multiplied by the number of independent sets in G\H i whose intersection with X is I, but since|I(H i)|is congruent to zero modulo k,then|[I]|is congruent to zero modulo k.Note that in this case the product term in the summation6above always evaluates to zero-giving a correct count modulo k of the sizeof[I].Now,assume that for all i,the neighbourhood of H i(and therefore theneighbourhood of h i does contain some vertex in I(I∩N(H i)=∅).Thenany independent set in[I]can be written as the union of I and n different independent sets{J1..,J n}such that J i is entirely contained in V(H i\{h i})and,once again,each such union is an independent set in[I].The total num-ber of such unions is clearly n i=1|I(G;H i\{h i})|,and since the minimum of|I∩N G(H i)|and1is equal to1for all i in this case,this is equal to theproduct given in the theorem.The theorem3.5which we prove next is in fact a consequence of the theorem3.7which we prove below.However,since the reduction used here is probably easier to follow,and is similar in structure to that used in the later proof,we will give the construction of this reduction explicitly. Theorem3.5. INDEPENDENT-SET is P-complete Proof.We precede by reduction from SAT.Given a CNF formula F withclauses{C1,...C m}and variables{x1,...x n},considered as an instance of SAT,we construct a graph,G,with vertices{v i,¯v i,p i|i∈{1,...,n}},cor-responding to each variable in F.There are also vertices{c j|j=1,...,m}, each corresponding to one clause in F.There are three types of edges in the graph.Each pair(v i,¯v i)is linked by an edge,and each vertex p i is linked by an edge to both v i and¯v i.Finally,a vertex v i(¯v i)is linked to a vertex c j if and only if the literal x i(¯x i)appears in the clause C j.An example of the graph derived from the SAT formula with the single clause x1∨¯x2is given infigure3.We claim that the parity of the number of independent sets in G is equal to the parity of the number of satisfying assignments of F.This graph satisfies the conditions of lemma3.4.The special subgraph H is the graph on one vertex,which has2≡0(mod2)independent sets as required.The p i and c j are the copies of H and the set X is the vertices v i,¯v i,i∈{1...n}.It therefore suffices for us to show that the independent sets,I,of G which satisfy I∩N G(p i)=∅and I∩N G(c j)=∅for all i and j are in one-to-one correspondence with the satisfying assignments of F.We note that an independent set,I,with the required property must contain exactly one of v i and¯v i for each i.It must contain at least one in order to ensure that p i has a neighbour in I,and it cannot contain more than one as(v i,¯v i)∈E(G).We now consider the assignment of truth values to7variables in F given by setting s (x i )to true if v i ∈I and setting it to false if ¯v i ∈I .To see that this assignment is satisfying,let C j be a clause in F ,then the vertex c j has some neighbour in I ,which is either v i or ¯v i for some i ,and the literal x i or ¯x i ,which appears in C j ,is set to true by the construction of s .Now using the formula in lemma3.4,we see that the number of indepen-dent sets of G modulo 2is equal to the number of satisfying assignments of F modulo 2,giving the desired reduction.12Figure 1:Graph derived from formula x 1∨¯x 2Theorem 3.6.#k -INDEPENDENT-SET is #k -complete for all kProof.Whilst it is possible to give a construction along the lines of that given above (the special subgraphs being copies of K p ),this theorem is again an immediate consequence of theorem 3.7,so this time we will not detail the construction explicitly.As noted above,the problem of counting independent sets in a bipartite graph is parsimoniously reducible to the problem of counting the number of satisfying assignments of an OR 1formula.In order to use OR 1as a base problem for our counting reduction in the next section,we prove theorem3.7.Theorem 3.7.#k BIPARTITE-INDEPENDENT-SET is #k -complete for all kProof.We begin by noting that it actually suffices to show that the problem of counting modulo p is #p -complete for all prime p ,since counting modulo8k for any composite number k is at least as hard as counting modulo any of the prime factors of k.We proceed by reduction from#p-SAT.Given a SAT formula F with clauses{C1,...C m}and variables{x1,...x n}and a prime number p,we construct a graph as described below.With each variable x i in F,we associate a subgraph of G as follows,the subgraph contains special vertices v i,¯v i the presence or absence of which in an independent set will correspond to the truth or otherwise of the literals x i,¯(x i)of F,there are also vertices p i and¯p i-these are connected to v i and ¯v i respectively,and are both connected by an edge to one vertex,h i in H i. Where H i is a copy of H,a bipartite graph with a distinguished vertex h, having the property that the number of independent sets in H is a multiple of p and that the number of independent sets in H\{h}is non-zero modulop.There is also another copy of the same graph,H∗i ,one vertex of which,h∗i is linked by an edge to each of v i and¯v i.Finally for each clause C j inF we add another copy of this bipartite graph H,denoted C j,one vertex of which,c j is linked to each of the vertices representing the literals present in the clause C j.Formally then,the vertex set of G will be{v i,¯v i,p i,¯p i|i=1...n}. Along with{V(H i),V(H i)∗|i=1...n}and{V(C j)|j=1...m}copies of H.The edge set will be the edges of H i,H∗i and C j along with the edges {(v i,p i),(¯v i,¯p i),(p i,h i),(¯p i,h i),(v i,h∗i),(¯v i,h i)|i=1...n}and the edges (v i,c j),(¯v i,c j)such that the literals x i,¯x i respectively appear in the clause c j.An example of the subgraph associated with a variable x i lying in the clause C j is given infigure3.Using lemma3.4it suffices to show that the independent sets,I,of G which satisfy I∩N(H i)=∅for all i are in one-to-one correspondence with the satisfying assignments of F,and that we can produce a bipartite graph H with the desired property.Since we are able to divide by any non-zero constant modulo p,the formula given in the lemma will then allow us to derive the number of satisfying assignments of F modulo p from the number of independent sets of G modulo p,giving the required reduction.That such H can be constructed for all prime p is shown in lemma3.8below.Let I be an independent set in G with the relevant property.Then for all i,either{v i,¯p i}⊂I or{¯v i,p i}⊂I.To see this,we note that both h i and h∗i have some neighbour in I by assumption,but then the only neighbours of h i in X are v i and¯v i,so one of these two must be in I.Similarly,the9Figure2:Subgraph associated with the variable x i neighbours of h∗i in G are p i and¯p i-so one of this pair must be in I,but then since I is independent and(v i,p i),(¯v i,¯p i)∈E(G)we have the stated result.Let s be the assignment of truth values to variables in F given by s(x i)=true⇐⇒v i∈I.We claim that this is a satisfying assignment of F.Indeed,let C j be a clause of F.Then there is some element of I which is a neighbour of c j,the distinguished node in C j.This is either v i or¯v i for some i,but then the literal x i(¯x i)appears in the clause C j,and this literal is true by construction of s,therefore the clause C j is satisfied.Similarly,if s is a satisfying assignment of F,then the independent set constructed analogously to that above(with{v i,¯p i}⊂I if s(x i)=true and{¯v i,p i}⊂I otherwise)is an independent set of X with the required property.Lemma3.8.For all prime p it is possible to construct a bipartite graph H, containing a distinguished node h,with the following properties.(i)The number of independent sets in H is congruent to zero modulo p.10(ii)The number of independent sets in H\{h}is not congruent to zero modulo p.Furthermore,for p>2,the graph K(p−2),(p−2)is such an H(any node of the graph can be chosen as the distinguished node,since they are indistinguish-able).Example3.9.An example of a subgraph H which would satisfy the above conditions for p=2is the graph on one vertex,where the distinguished ver-tex,h will clearly be the unique vertex in the graph.This graph has precisely 2independent sets(∅and{h}),whereas H\{h}=∅has precisely one. Proof of Lemma3.8.We note that the graph K1provides an example of such a graph for p=2(as explained in example3.9),and therefore restrict our attention to the case p>2.Consider the graph K n,n,the complete bipartite with two classes of n vertices each.This graph has2(n+1)−1independent sets.To see this, simply note that any independent set in K n,n is contained entirely in one of the two vertex classes,and that every subset of one of the vertex classes in independent.Then there are2n independent sets in each class,but the empty set is in both,so there are in fact2n+1−1independent sets in K n,n.Now let n=p−2,then K n,n has2p−1−1independent sets.But by Fer-mat’s little theorem,2p−1≡1(mod p),therefore the number of independent sets of K p−2,p−2is congruent to zero modulo p.Finally,the number of independent sets in K p−2,p−3(which is H with a vertex deleted)is equal to2p−2+2p−3−1,but this is just(2p−1−1)−2p−3, and since2≡0(mod p),we have that2p−3≡0(mod p),and so(2p−1−1)−2p−3≡−2p−3≡0(mod p).Proof of theorem3.1.This follows immediately from the theorems3.6and 3.7along with lemmas3.2and3.3.4The classes#k-SATWe now know that#k SAT(OR0),#k SAT(OR1)and#k SAT(OR2)are#k P-complete for all integer k.We proceed to give reductions from these base problems to Generalised Satisfiability Problems-the reductions are in most cases identical to those used by Creignou et.al.in[6].11We will make use of the functions T and F which are the functions of one variable which evaluate to true and false respectively,as well as XOR(x,y), the function which evaluates to true when exactly one of x and y is true and false otherwise.We will say that a constraint set F is C-closed if every constraint function f in F is such that if f(x)is true then f(1-x)is also true, in other words,such that the set of satisfying assignments of an F-constraint is closed under complement.We will say that a constraint set,F,is0-valid (1-valid)if setting all of the variables in any F-formula to0(1)results in the formula evaluating to true.Finally,a constraint set is affine if each of the constraints in the set can be expressed as a system of linear equations in GF2.Definition4.1.A family of constraints,F,over a set of variables x,y, faithfully implements a boolean function f(x)iffthere exists an F-collection of constraints,C such that there is exactly one way to satisfy each constraint in C whenever f(x)evaluates to true,and no ways to satisfy them all when-ever f(x)evaluates to false.The variables x are called function variables, and the variables y auxiliary variables.We note that for our purposes a slightly weaker definition of faithful implementation would suffice,with“exactly one”replaced with“exactly one modulo k”.However,it turns out that the reductions we need are faithful in the original sense,and therefore we use this definition in order to be able to appeal directly to the results of[6].Example 4.2.The constraint family{OR0,F}faithfully implements the function T(x)through the constraint applications{OR0(x,y),¯y},y is an auxiliary variable.Lemma4.3.Given an integer k and a constraint set F,if#k SAT(F)is #k P-hard and every constraint of F can be faithfully implemented by F′, then#k SAT(F′)is also#k P-hard.Proof.This proof is essentially identical to the proof of theorem5.15in [6].Given an F-collection of constraint applications on a variable set x, say C,we transform this using faithful implementations to an F′-collection of constraint applications on a new variable set,(x,y),say C′.Since the implementations are faithful,each satisfying assignment of C can be extended in a unique way to a satisfying assignment of C′.Therefore there is a one-to-one correspondence between satisfying assignments of C and satisfying12assignments of C′.This gives a parsimonious reduction from#SAT(F)to #SAT(F′),which clearly implies the desired result.We will make use of the following lemmas,taken from[6]and stated here without proof.Lemma4.4.[6]If a constraint family F is not0-valid(1-valid)and (i)if F is C-closed,then F faithfully implements XOR.(ii)if F is not C-closed,then F faithfully implements T(F).Lemma4.5.[6]Take a function f.If f is not affine,then{f,F,T}faith-fully implements at least one of the three functions OR0,OR1and OR2.Fur-thermore,if f is0-valid(1-valid)then{f,F}({f,T})faithfully implements one of OR1or OR2(OR0or OR1).Lemma4.6.Let F be a non-C-Closed family of functions.Then if F is both0-valid and1-valid,F faithfully implements OR1.We also need the following lemmas,which have been adapted from the versions given in[6].Lemma4.7.Let F be a set of C-Closed functions.If p is an odd prime, and if#p SAT(F∪{F,T})is#p P-hard and if F can faithfully implement the XOR function,then#p SAT(F)is#p P-hard.Proof.We will use the following reduction:Let C be an F∪{F,T}-collection of constraint applications on variables x let y0,y1be two new variables,and replace with y0any variable constrained to be false,and replace with y1any variable constrained to be true.Now add the constraint XOR(y0,y1).We now have,C′an F∪XOR collection of constraint applications on variables x,y0,y1.Clearly any satisfying assignment of C can be extended to a satis-fying assignment of C′by setting s′(y0)=0and s′(y1)=1.Conversely,let s′be a satisfying assignment of F′then either s′(y0)=0and s′(y1)=1,in which case s′restricted to x is a satisfying assignment of C or s′(y0)=1and s′(y1)=0,in which case it is easy to check that s(x)=1−s′(x)satisfies all constraints in C.So C′has precisely twice as many satisfying assignments as C.Now since p is prime and p≥2,we can divide by two modulo p,giving a Turing reduction from#p SAT(F∪{F,T})to#p SAT(F.Finally,since F can faithfully implement XOR,we have#p P-hardness of#p SAT(F)by lemma4.3.13Lemma4.8.Let F be a set of C-Closed functions.For all integer k,if #2k−1SAT(F∪{F,T})is#2k−1P-hard and if F can faithfully implement the XOR function then#2k SAT(F)is#2k P-hard.Proof.The reduction used is the same as in the previous proof.Now,given a F∪{F,T}-formula,F,we have constructed a F formula,F′with twice as many satisfying assignments as F.Now,any algorithm which could count the number of solutions of F′modulo2k in polynomial time could clearly be used to count the number of solutions of F modulo2k−1in polynomial time. Therefore#2k−1P-hardness of#2k−1SAT(F∪{F,T})implies#2k P-hardness of#2k SAT(F)as required.Lemma4.9.Let F be a set of C-Closed functions.If p is an odd prime, and if#p SAT(F∪{F})is#p P-hard and if F then#p SAT(F)is#p P-hard.Proof.We construct a F formula from a given F∪{F}formula by replacing all variables which are constrained to be false with a new variable x0.This formula then has twice as many satisfying assignments as the original,and we proceed as in the proof of lemma4.7.Lemma4.10.Let F be a set of C-Closed functions.For all integer k,if #2k−1SAT(F∪{F})is#2k−1P-hard then#2k SAT(F)is#2k P-hard.ing the same reduction as in the proof of the previous lemma,and then the same reasoning as in the proof of lemma4.8we obtain the desired result.Finally,we require the observation that for C-Closed functions,the num-ber of satisfying assignments modulo2is always equal to zero-as for any satisfying assignment s,the assignment1-s is also satisfying.Theorem4.11.Given a constraint set F,and an integer k,the problem #k SAT(F)is in FP if F is an affine family of constraints,or if k=2and F is C-closed,and it is otherwise#k P-complete.Proof.There are several cases to consider,first we note that#k SAT(F)is clearly in#k P.Now,if every constraint in F is affine,then we can consider solving#SAT(F)as the problem of solving a system of linear equations of GF(2),this can be done using Gaussian elimination in polynomial time.Since we can solve#SAT(F)in polynomial time,we can clearly solve#k SAT(F) in polynomial time.Also,if F is C-closed,then clearly F has an even14。