Generating & Interpreting Metaphors with NETMET Eric Steinhart Published in APA Newsletter on Computers and Philosophy (2005) 4 (2). The structural theory of metaphor (STM) uses techniques from possible worlds semantics to generate and interpret metaphors. STM is presented in detail in The Logic of Metaphor: Analogous Parts of Possible Worlds (Steinhart, 2001). STM is based on Kittay's semantic field theory of metaphor (1987) and ultimately on Black's interactionist theory (1962, 1979). STM uses an intensional calculus to specify truth-conditions for many grammatical forms of metaphor. The truth-conditional analysis in STM is inspired in part by Miller (1979) and Hintikka & Sandu (1994). STM is by no means a toy theory. It has been successfully tested on dozens of large texts taken from real authors. Its methods can be applied in very large linguistic databases like WordNet or MindNet. STM is partially implemented in the computer program NETMET ("NETworks and METaphors"). While STM addresses both the syntactic and semantic aspects of metaphor, NETMET implements only the syntactic aspects of STM. On the syntactic level, STM models the lexicon of a language as a network of terms (a conceptual or lexical network). It says that metaphors are based on the interaction of two distinct but analogous subnetworks within the lexicon. The interacting subnets are referred to as the target and the source. Given a database of literal language, NETMET can generate target and source subnets, compute the analogy between them, and use the analogy to generate metaphorical sentences. NETMET can also transfer knowledge from the source net to the target net, thus enriching the target. To interpret metaphors, NETMET uses an expert system to deduce the entailments of a metaphor within the analogically enriched target. The literal entailments thus deduced form a partial literal interpretation of the metaphor. More details on NETMET are given in Steinhart (1994) and Steinhart & Kittay (1994). NETMET is written in the programming language C and runs in DOS mode on Windows systems. All NETMET files, including source code, are available for free download. The source code can be incorporated in non-commercial applications so long as credit to the author is given. NETMET is available via the author's website: <http://www.wpunj.edu/cohss/philosophy/faculty/esteinha/esteinha.htm>. NETMET has a clear interface and is very easy to operate. NETMET is useful in philosophy of language courses to illustrate the generation and interpretation of metaphors. Besides being useful for working with metaphors, NETMET contains both a sophisticated analogical mapping engine and a simple expert system. NETMET is thus able to illustrate how analogies are constructed and interpreted. Because analogies play important roles in science, NETMET is useful in philosophy of science courses as well. NETMET uses both old-fashioned symbolic techniques and newer connectionist techniques. It is therefore useful in cognitive science and philosophy of mind courses. NETMET comes with a list of canned exercises so that students can step through its operations. 2 NETMET takes a list of propositions as its input. They are encoded in NETMET's input file and are written in a canonical form similar to that of the predicate calculus. NETMET comes with 13 input files. These include codings of (1) the SOCRATES IS A MIDWIFE analogy from Plato's Theaetetus; (2) the MEMORY IS A WAX TABLET and MEMORY IS AN AVIARY analogies from Plato's Theaetetus; (3) the SOUND IS A WAVE analogy; (4) the ATOM IS A SOLAR SYSTEM analogy; (5) the COULOUMB'S LAW IS NEWTON'S LAW analogy; (6) the argument by analogy for other minds. Given an input file, NETMET is able to perform several basic functions: (1) display the words and propositions in the file; (2) generate lexical subnets in which a word sits; (3) find subnets analogous to a given subnet; (4) compute analogical mappings across subnets; (5) generate metaphors involving distinct but analogous subnets; (6) transfer information from one subnet to another based on an analogy; (7) produce partial literal interpretations of metaphors generated by analogical transference. NETMET also allows the user to explicitly group propositions into subnets by specifying such groupings in the input file. An explicit subnet has the form FIELD { P1, P2, . . . Pn} where Pi is a proposition (the term "FIELD" indicates NETMET's origin in Kittay's semantic field theory of metaphor). The propositions enclosed in curly braces are all put into the same subnet. Table 1 shows two subnets taken from Plato's (1984) SOCRATES IS A MIDWIFE metaphor. FIELD { S1:contains(mother, womb) S2:goes(womb, thru:cycle) S3:ovulates(womb) S4:menstruates(womb) S5:produces(womb, egg) S6:discards(womb, egg) S7:if S2 then {S3, S4} S8:if S3 then {S5} S9:if S4 then {S6} S10:contains(womb, baby) S11:produce(mother, baby) S12:give-birth(mother, baby) S13:help(midwife, mother) S14:pass(liveborn(baby), physicaltest) S15:opposites(liveborn, stillborn) } FIELD { T1:contains(Theaetetus, mind) T2:produces(mind, idea) T3:discards(mind, idea) T4:forgets(mind, idea) T5:if T3 then {T4} T6:contains(mind, idea) T7:produce(Theaetetus, idea) T8:express(Theaetetus, idea) T9:help(Socrates, Theaetetus) T10:pass(true(idea), cognitivetest) T11:opposites(true, false) } Table 1. Subnets from Plato's SOCRATES IS A MIDWIFE metaphor. Since it claims that metaphors are generated from analogies, STM requires a theory of analogy. NETMET uses theories of analogy developed by Gentner (1983), Falkenhainer, Forbus & Gentner (1989), and Holyoak & Thagard (1989, 1990). An analogy is a triple (S, T, ƒ) where S and T are subnets and the counterpart function ƒ is a structurepreserving function from S to T (i.e. an approximate isomorphism). The generation of an 3 analogy is traditionally divided into two major subphases: (1) the access phase, (2) the mapping phase (Hall, 1989). The access phase generates the source and target subnets S and T; the mapping phase generates the counterpart function ƒ. To generate the target and source subnets, NETMET begins with a cue. The cue is a single word which the user selects from the words in the input file. NETMET generates the subnets of which the cue is a member. Once the subnets of the cue have been generated, the user must select one of these as the target. NETMET then generates subnets that are analogous to the target. These are the candidate source nets. Once the candidate source nets have been generated, the user must select one as the source. For instance, suppose NETMET is given an input file containing the fields in Table 1. Suppose the user picks "idea" as the cue. NETMET displays the subnet of "idea" as the target. NETMET then indicates that the field of "childbirth" is (the only) source subnet. After analogical access has produced target and source subnets, the analogical mapping phase generates the counterpart function ƒ that maps the source S onto the target T. Several matching principles are used to generate ordered pairs that preserve the local relational structure of the source. The counterpart function emerges through the interaction of these local matches. NETMET uses the connectionist technique of constraint satisfaction to find the counterpart map (Holyoak & Thagard, 1989, 1990). A map from the subnet of "childbirth" to the subnet of "idea" is shown in Table 2. mother ! Theaetetus womb ! mind baby ! idea egg ! idea midwife ! Socrates liveborn ! true stillborn ! false S5 ! T2 S6 ! T3 S11 ! T7 S13 ! T9 S14 ! T10 Table 2. Counterpart correspondence ƒ for the subnets in Table 1. STM holds that metaphor is a statement that combines terms from a target subnet with terms from an analogous but distinct source subnet. Terms from the target are subscripted with T while those from the source are subscripted with S. Consider the sentence "Socrates is a midwife". From Table 1, we see that: "Socrates" comes from the target; "midwife" comes from the source. The copula links phrases from distinct but analogous subnets. The copula and the sentence containing it are thus metaphorical. We thus get the syntactically decorated sentence: [[Socrates]T [is]MET [a midwife]S]MET. Metaphors of the form [[x]T [is]MET [y]S]MET are trivial. A great advantage of STM, indeed one that separates it from all other theories of metaphor so far, is that it incorporates metaphors into standard generative grammar. By decorating standard syntactic rules (in Backus-Naur form) with parameters for the situations S and T, and marking phrases as metaphorical when S is not equal to T, STM can handle metaphors of any grammatical complexity. NETMET implements only about a dozen grammatical 4 forms. I list a few of these forms in Table 3. In these forms, brackets indicate phrase groups; subscripts S and T indicate situations; "DET" is a determiner; "NOUN" is a noun; "BE" is a form of the verb "to be"; "ADJ" is an adjective; and so on. [[NOUN1T]T [BE]MET [DET NOUN2S]S]MET Socrates is a midwife. [[NOUN1T]T [BE]MET [DET ADJS NOUN2S]S]MET The mind is an intellectual womb. [[NOUN1T]T [BE DET NOUN2S of]S [DET NOUN3T]T]MET An idea is a child of the mind. [[DET NOUN1T]T [BE]MET [ADJS]S]MET Some ideas are stillborn. [[NOUN1T]T [VERBS]S [PREP NOUN2T]T]MET Students give birth to ideas. [[DET NOUN1T]T [VERBS]S [PREP DET NOUN2S]S] of [DET NOUNT]T]MET A student gives birth to a child of his mind. Table 3. A few grammatical forms handled by NETMET. Besides generating metaphors, NETMET also performs analogical transference. Analogical transference is particularly important for philosophy of science, because it creates a new theory of the target. Using the counterpart function, NETMET moves propositions from the source to the target. NETMET examines every proposition P in the source. If there is no analogous proposition for P in the target, then NETMET (1) makes a copy of P, (2) replaces every noun or adjective in the copy of P with its analogue; and (3) adds the modified copy of P to the target. Analogical transference produces a new target subnet in which many propositions are metaphorical predications (verbpredication metaphors, metaphorical rules, etc.). An example of analogical transference is shown in Table 4. Analogically transferred propositions are in boldface; words (or phrases) used metaphorically are enclosed in square brackets. FIELD { S1:contains(mother, womb) S2:goes(womb, thru:cycle) S3:ovulates(womb) S4:menstruates(womb) S5:produces(womb, egg) S6:discards(womb, egg) S7:if S2 then {S3, S4} S8:if S3 then {S5} S9:if S4 then {S6} S10:contains(womb, baby) S11:produce(mother, baby) FIELD { T1:contains(Theaetetus, mind) T12:[goes(mind, thru:[cycle])] T13:[ovulates(mind)] T14:[menstruates(mind)] T2:produces(mind, idea) T3:discards(mind, idea) T4:forgets(mind, idea) T5:if T3 then {T4} T15:[if T12 then {T13, T14}] T16:[if T13 then {T2}] T17:[if T14 then {T3}] T6:contains(mind, idea) 5 S12:give-birth(mother, baby) S13:help(midwife, mother) S14:pass(liveborn(baby), physicaltest) S15:opposites(liveborn, stillborn) } T7:produce(Theaetetus, idea) T18:[give-birth(Theaetetus, idea)] T8:express(Theaetetus, idea) T9:help(Socrates, Theaetetus) T10:pass(true(idea), cognitivetest) T11:opposites(true, false) } Table 4. Subnets after analogical transference. I deliberately chose an unusual metaphor generated from the SOCRATES IS A MIDWIFE analogy: [[The mind]T [goes through a menstrual cycle)]S ]MET. Reasoning by analogy is a powerful tool for making hypotheses, and NETMET can generate surprisingly novel metaphors. The metaphor is by no means merely poetic, obscene, or surreal. It is true if the mind goes through some kind of creativity cycle. Whether such a cognitive creativity cycle exists is a genuine scientific question. In extreme forms, such a cycle may take the form of manic-depressive syndrome; the relation between manicdepressive syndrome and creativity is an active research topic (Jamison, 1993). NETMET can construct partial literal interpretations of the verb-predication metaphors generated by analogical transference. These interpretations are not truth-conditions; but they are used in the truth-conditional analyses of STM. According to Black (1962, 1979), metaphors are interpreted by generating implication complexes. An implication complex consists of all the entailments of a proposition. Implication complexes are generated by the repeated application of rules. An implication complex has the form of a tree. Those propositions that have no entailments are the leaves of an implication complex. For example, the implication complex of the literal proposition "S2:goes(womb, thru:cycle)" is shown in Table 5. The leaves are S5 and S6. Given a verb-predication metaphor produced by analogical transference, NETMET partially interprets that metaphor by generating its implication complex. For example, the implication complex of T12:[goes(mind, thru:[cycle])] is shown in Table 6. The leaves of an implication complex are of particular interest. The conjunction of the literal leaves of the implication complex constitutes a partial literal interpretation or partial literal paraphrase of the metaphorical predication. S2:goes(womb, thru:cycle) |==> S3:ovulates(womb) | |==> S5:produces(womb, egg) |==> S4:menstruates(womb) |==> S6:discards(womb, egg) Table 5. An implication complex for a literal proposition. T12:[goes(mind, thru:[cycle])] |==> T13:[ovulates(mind)] | |==> T2:produces(mind, idea) |==> T14:[menstruates(mind)] |==> T3:discards(mind, idea) |==> T4:forgets(mind, idea) Table 6. An implication complex for a metaphorical proposition. 6 Although NETMET deals only with the syntactic aspects of STM, it is important to see that these syntactic aspects are grounded in a genuinely semantic analysis of metaphor. STM depicts reality as a logical space carved up into situations. A situation is a Tarskian model. There is a part-whole lattice of situations. Some situations are sufficiently large and complete to be called possible worlds (in the cosmic sense). But possible worlds have parts (submodels). These are like Hintikka's "small worlds" or "scenarios". Some situations are analogous to one another. An analogy is a triple (S, T, ƒ) where S and T are situations and ƒ is a structure-preserving map. Situation S is the source and T is the target. We say x in T is the ƒ-counterpart of y in S iff (S, T, ƒ) is an analogy and ƒ maps x in T onto y in S. The notion of a counterpart is familiar from David Lewis. Truthconditions for metaphors are based on counterpart correspondences. Consider for instance this short text from Shakespeare's Romeo and Juliet, Act II Scene II: "(Juliet appears above at a window) ROMEO: But, soft! what light through yonder window breaks? It is the east and Juliet is the sun!". The text specifies an analogy: Juliet is to the window as the sun is to the east; just as the sun appears in the east, so also Juliet appears in the window. Table 7 lays out the analogy as a triple (S, T, ƒ). Source Situation S Target Situation T Analogy ƒ S1: star( theSun); S2: direction( theEast); S3: appears( theSun, theEast); T1: woman( Juliet); T2: window( aWindow); T3: appears( Juliet, aWindow); theSun ! Juliet theEast ! aWindow Table 7. Juliet is the sun. Metaphors combine terms from distinct but analogous situations. Consider the metaphor "Juliet is the sun". Since "Juliet" denotes an individual in T, I write it as [Juliet]T; since "the sun" denotes an individual in S, I write it as [the sun]S. I thus write: [[Juliet]T [is] [the sun]S]. STM assigns both literal and metaphorical truth-conditions to all sentences. Let [x]T and [y]S denote individuals in the subscripted situations. Literal truth-conditions are as expected from Tarski: [[x]T [is]LIT [y]S]LIT is true iff x = y. Hence [[Juliet]T [is]LIT [the sun]S]LIT is true iff Juliet = the sun; but that is false. The metaphorical truth-conditions are based on counterpart correspondence: [[x]T [is]MET [y]S]MET is true iff (∃S, T, ƒ)((S, T, ƒ) is an analogy & (x in T is the ƒ-counterpart of y in S)). Hence [[Juliet]T [is]MET [the sun]S]MET is true iff there are ƒ-analogous situations S and T such that ([Juliet] in T is the ƒ-counterpart of [the sun] in S)). Table 7 lays out the very analogy that makes [[Juliet]T [is]MET [the sun]S]MET true. STM can assign truthconditions to metaphors of many grammatical forms using standard semantic techniques (popularized by Montague, Davidson, and so on). 7 The analysis of metaphors in terms of counterpart correspondences among analogous parts of possible worlds links metaphors to fascinating (and problematic) issues elsewhere in philosophy. Metaphors are linked to the issues of identity and indiscernibility in modal logics. They are linked to Quinean notions of ontological relativity and ontological reduction. Since analogies are based on isomorphisms, metaphors are made true by certain kinds of symmetries. Thus the use of analogy and metaphor is linked to deep questions about symmetry and symmetry breaking in science. Based on a rich logical theory of the semantics of metaphor, NETMET is able to generate complex metaphors, to perform analogical transference, and to partially interpret verbpredication metaphors. NETMET has served as a laboratory instrument for testing the claims of STM. NETMET is useful both (1) as an example of how the construction of philosophical theories can benefit from computational modeling and (2) as a classroom tool for computer-assisted instruction in the philosophy of language and science. It illustrates the power of what Jim Moor has called "the computational turn" in philosophy. 8 References Black, M. (1962) Metaphor. In M. Black, Models and Metaphors. Ithaca, NY: Cornell University Press. Black, M. (1979) More about metaphor. In Ortony (1979), pp. 19-43. Falkenhainer, B., Forbus, K. D, & Gentner, D. (1989) The structure-mapping engine: Algorithm and examples. Artificial Intelligence, 41, 1-63. Gentner, D. (1983) Structure-mapping: A theoretical framework for analogy. Cognitive Science, 7, 155-170. Hall, R. P. (1989) Computational approaches to analogical reasoning: A comparative analysis. Artificial Intelligence, 39, 39-120. Hintikka, J. & Sandu, G. (1994) Metaphor and other kinds of non-literal meaning. In J. Hintikka (Ed.) Aspects of Metaphor. Dordrecht: Kluwer Academic, 151 188. Holyoak, K., & Thagard P. (1989) Analogical mapping by constraint satisfaction. Cognitive Science, 13, 295-355. Holyoak K., & Thagard, P. (1990) A constraint-satisfaction approach to analogue retrieval and mapping. In K. J. Gilhooly, M. T. G. Keane, R. H. Logie & G. Erdos (Eds.), Lines of Thinking (Vol. 1). New York: John Wiley & Sons. Jamison, K. R. (1993) Touched with Fire: Manic-Depressive Illness and the Artistic Temperament. New York: Free Press. Kittay, E. F. (1987) Metaphor: Its Cognitive Force and Linguistic Structure Oxford: Oxford University Press. Miller, G. A. (1979) Images and models, similes and metaphors. In Ortony (1979), 202250. Ortony, A. (1979) (Ed.) Metaphor and Thought. Cambridge: Cambridge University Press. Plato (1984) Theaetetus. S. Bernardete (Trans.). Chicago: University of Chicago Press. Steinhart, E. (1994) Beyond proportional analogy: A structural model of analogy. Pragmatics and Cognition 2 (1), 95-130. Steinhart, E. & Kittay, E. (1994) Generating metaphors from networks. In J. Hintikka (Ed.), Approaches to Metaphor. Dordrecht: Kluwer Academic, 41-94. 9 Steinhart, E. (2001) The Logic of Metaphor: Analogous Parts of Possible Worlds. Synthese Library Vol. 299. Dordrecht: Kluwer Academic.