Complete and Incomplete
Grammar books routinely inform their readers that a sentence is a group of words that expresses a complete thought. The idea is that some groups of words fail to express complete thoughts and hence are not sentences. Do they then express incomplete thoughts? Are we to say that incomplete sentences express incomplete thoughts? But what is an incomplete thought? Not a kind of thought evidently—all thoughts are complete. People can have vague or false thoughts, but not thoughts that fail of completion: for what would such a thought be a thought that? Logicians distinguish between open and closed sentences, and the former don’t express complete thoughts; but there are not two types of thought, the complete (closed) type and incomplete (open) type. The phrase “complete thought” is really a pleonasm: the grammar books could just as well say simply that a sentence is a group of words that expresses a thought.
But this raises further questions. What is a thought in the intended sense? Do questions and imperatives express thoughts? Are intentions or emotions thoughts? Sentences seem to express them, so we presumably need them to round out the definition of a sentence. And why speak of thoughts at all—a psychological category—instead of propositions or facts? Isn’t it equally correct to say that a sentence expresses a proposition (or a “complete proposition”—but is there any other kind?)? A mere word or phrase expresses no proposition, while a sentence does—why get into questions of psychology? Come to that why not say that a sentence is a group of words that states a fact (or purports to)? What about defining a sentence as a group of words that expresses or denotes a state of affairs, or a “complete state of affairs”? Then we have defined a sentence ontologically not psychologically. We will want to insist that there are no incomplete states of affairs, as there are no incomplete propositions or thoughts—there are not in reality complete instances of these categories and beside them incomplete instances. In fact, it is doubtful there are any incomplete sentences, strictly speaking; there are only incomplete expressions of sentences. Sentences in themselves, considered as formal objects, are always whole and entire, but our utterances and inscriptions may not express them completely (this is to understand the ontology of sentences as we understand the ontology of propositions and facts).
Another definition of a sentence that might be proposed is “a group of words that can be true or false”. The trouble with this is that it assumes that all sentences are declarative; it ignores questions and imperatives, which are also sentences. It also assumes that sentences are true or false: maybe only propositions or thoughts are. And what if the ideas of truth and falsity are flawed in some way, destined for elimination? This approach is too narrow and hostage to fortune, though beloved by logicians. But isn’t there also a problem of narrowness for the other definitions too, given the usual understanding of “proposition” and “thought”? The imperative fragment “Go and” is an incomplete sentence just as much as the declarative fragment “He went and”. Should we say that the former does not express a complete thought or proposition, just like the latter? But complete imperatives don’t express such things as complete thoughts either, unless we broaden the notion of a thought. That is presumably the intent of the original definition: imperatives and questions express “thoughts” too, though their parts do not. Some grammar books replace “thought” with “idea”, enabling us to say that an imperative sentence expresses an idea. Here we don’t have the usual association with complete sentences, since ideas can be expressed by individual words and phrases; but we do have the suggestion that sentences correspond to psychological complexes—mental representations of some type. There is what I want you to do and there is what I believe is the case: a sentence is a group of words that expresses such wants and beliefs—though the constituents of a sentence do not. The mind contains psychological units that are “complete”: sentences are the bits of language that express them. The mind does not contain units such as the thought that When John or the desire to Swim under: these are not proper psychological units. The standard textbook definition of a sentence is tacitly working with this kind of philosophy of mind—an implicit commonsense psychological theory. It views the mind is made up of propositional attitudes that are complex psychological unities: sentences are what map onto these unities—as words and phrases do not. We can then define words and phrases as groups of words that express constituents of propositional attitudes.
I would then amend the standard textbook definition to read: a sentence is a group of words that expresses a (complete) propositional attitude. An imperative sentence is a group of words that expresses a (complete) desire, just as a declarative sentence expresses a (complete) thought. We can go on drop the qualifier “complete”, since it has no complement class. This will clarify the grammar books because students will naturally be perplexed by talk of “complete thoughts” and will wonder how the definition works for non-declaratives. It also makes it clear that grammar is not independent of psychology. Sentences are the vehicles of propositional attitudes. 
 There is no need for sentences unless the speaker has beliefs, desires, intentions, and other propositional attitudes; a different kind of psychology will not mandate this type of linguistic structure. Bee language, say, might not consist of sentences properly so-called if bees lack propositional attitudes—as opposed to informational states of some other kind (digital or analogue). Human languages consist of sentences precisely because human minds consist of propositional attitudes. Sentences are linguistic structures that express such attitudes. The categories of grammar are derivative from the categories of psychology.