
Generative Story Worlds as Linear Logic Programs Chris Martens Joao˜ F. Ferreira Anne-Gwenn Bosser Marc Cavazza Carnegie Mellon University Teesside University ENI Brest Teesside University [email protected] [email protected] Lab-STICC UMR6285 [email protected] [email protected] Abstract (in the sense of designing narratives with richly-interacting processes) and eat it, too (in the sense of predicting and con- Linear logic programming languages have been identi- trolling the consequences of such processes). fied in prior work as viable for specifying stories and analyzing their causal structure. We investigate the use of such a language for specifying story worlds, or set- Related Work tings where generalized narrative actions have uniform Planning systems have been widely adopted for the con- effects (not specific to a particular set of characters or struction of interactive narratives (Young 1999; Porteous, setting elements), which may create emergent behavior Cavazza, and Charles 2010), mostly because of their support through feedback loops. for the representation of causality. It is generally accepted We show a sizable example of a story world specified that LL is a strong candidate for such a representation (Gi- in the language Celf and discuss its interpretation as a story-generating program, a simulation, and an interac- rard and Lafont 1987), and a proof in LL can be equated tive narrative. Further, we show that the causal analysis to a plan (Masseron 1993; Masseron, Tollu, and Vauzeilles tools available by virtue of using a proof-theoretic lan- 1993). Aside from surface differences, such as LL predicates guage for specification can assist the author in reason- having meaningful multiplicity, the main benefit of using LL ing about the structure and consequences of emergent is that planning actions, plan synthesis, and plans themselves stories. can all be accounted for uniformly under a minimal theory of inference and proof. Introduction Standard logic programming approaches to narratives provide evidence for the concise and readable nature of Linear logic (Girard 1987) (LL) has been proposed as a declarative specification (Grasbon and Braun 2001; Lang suitable conceptual framework to specify and reason about 1999) but lack the native ability to model state and causality interactive narratives (Bosser, Cavazza, and Champagnat afforded by LL. One logic programming engine for manag- 2010), which has led to a variety of applications such as ing generativity in games uses the Event Calculus (EC) to narrative analysis (Bosser et al. 2011), narrative genera- overcome this shortcoming (Smith and Mateas 2011). tion (Martens et al. 2013), and authoring and validation LL has previously been explored for game analysis, as tools (Dang et al. 2011). At the same time, the success of a front-end for Petri nets (Colle,´ Champagnat, and Prigent 1 logically-motivated languages such as Inform 7 together 2005). Further development demonstrated the value in using with the documented interest of Interactive Fiction (IF) writ- a constructive formulation of LL to directly correlate the for- 2 ers for emergent narratives suggests that the IF community mal notion of story with the notion of logical proof (Bosser, may welcome a programming language approach to the au- Cavazza, and Champagnat 2010; Bosser et al. 2011). Dang thoring of rule-based, generative story worlds. investigated LL for complete exploration and validation Our work proposes the use of a logic programming lan- of scenarios for educational purposes (Dang, Champagnat, guage for specifying emergent systems representing narra- and Augeraud 2013). However, by relying on a backward- tive worlds. We use a language based on constructive LL, chaining proof search interpretation, these works have fa- which supports action description, use of resources, and vored authorial intent above narrative emergence. Our con- changes imposed on the story world, and offers a basis for tribution is to investigate LL for modeling story scenarios analysis of storylines and causal relationships, all within the which are primarily exploratory and generative, rather than same theory of proof. This approach lets us have our cake purely goal-driven, using forward-chaining proof search. Copyright c 2014, Association for the Advancement of Artificial This duality between intent (backward chaining) and explo- Intelligence (www.aaai.org). All rights reserved. ration (forward chaining) has previously been used for com- 1http://www.inform7.com bining deliberative and reactive behaviour for agent mod- 2See for instance Emily Short’s article on emergence in nar- elling (Harland and Winikoff 2004). Our language of inves- rative interaction design at http://emshort.wordpress. tigation, called Celf (Schack-Nielsen and Schurmann¨ 2008), com/2013/02/14/introducing-versu/ supports both forward and backward chaining through the focusing theory of proof search (Chaudhuri, Pfenning, and Example: A Romantic Tragedy Story World Price 2008). The key to programming with LL is formulating one’s prob- lem in terms of resources, i.e. the components of a story that Contributions may interact and change. Then, the author describes how (through what actions) those components change. In a bit Expanding on our previous work (Martens et al. 2013), we more detail, the process for designing a story world takes demonstrate how to encode more general story settings that the following shape: are parametric over arbitrary world states, settings, and char- 1. Identify the components of story state, such as physi- acters. We demonstrate that these rules create nontrivial cal location and character relationships. Declare a pred- feedback loops in terms of their causal structure, allowing icate (type) for each of these; for example, declare that for long and perhaps unpredictable chains of events to cre- anger C C’ is a well-formed state component when C ate pivotal events in stories. and C0 are characters. We map predicates in our example We further extend our use of tools to this case, including to their intended meanings in the table below. those we get for free from the language Celf as well as the extrinsic graphical tool and query language. These tools il- 2. Identify the narrative actions, i.e. ways that characters lustrate the use of proof term structure in exploring the con- can interact with each other or their environs to cause sequences of rules which may have been conceived in the changes in the state. For instance, a rule for flirting with haphazard, ad-hoc way of first draft designs. a character other than one’s lover may cause anger in the The takeaway point of this paper is that encoding story lover directed at both flirters, which is represented by the worlds in a linear logic programming language allows for rule do/flirt/conflict informative exploration of their consequences. For the re- : eros Flirter Flirtee * eros Other Flirtee mainder of the paper, we will support this claim by describ- -o {eros Flirter Flirtee * eros Flirtee Flirter anger Other Flirter anger Other Flirtee}. ing an example and its semantics, demonstrating how non- * deterministic proof search can be used to generate stories, (The words beginning with capital letters, by convention, and sketching our work in progress on tools for analyzing mark logic variables, and are implicitly quantified at the and interacting with story models. beginning of the rule—the names themselves are arbi- trary.) System Overview A complete story world specification is simply a collec- tion of these predicate and rule declarations. The author may The basis of our framework is the use of LL as a language for then join it with its complementary half, a specification of specifying actions. This setup is similar to the use of plan- setting elements, characters, and initial states, to generate ning languages such as STRIPS (Fikes and Nilsson 1971) in stories or analyze the system we have described. The re- the sense that we model the world as a collection of predi- mainder of this section carries out an example, a case study cates and specify the available actions declaratively in terms of a Shakespeare-inspired romantic tragedy world, follow- of those predicates. ing the aforementioned workflow.3 A world state is an unordered collection of predicates ∆, The state we model includes sentiments between char- and actions are written as state transitions A ( fBg, signi- acters (several forms of love and hate), physical locations fying an action that replaces the state components described and basic movement, possession of key objects (such as by A with those described by B. weapons), relationship states (marriage and being single), The process of execution (or simulation or generation) of desires for objects, and solitary emotions (depression). a story, then, is to take a user-specified initial state ∆0, find Predicate Meaning some rule r in the specification Σ that can apply, and apply at C L C is (alive) in location L it to get ∆1. This process is iterated until no further rules has C O C possesses an object O apply, at which point we say we have reached quiescence. neutral C C’ C feels neutrally toward C0 0 r : A fBg ∆;A philia C C’ C feels affection toward C When a rule ( is applied on state , the 0 ∆;B ∆ anger C C’ C feels anger toward C next state is . The component which is irrelevant to 0 the rule stays the same, solving the frame problem present eros C C’ C feels attraction toward C unmarried C C is unmarried in other settings, such as event and situation calculi (Hayes 0 1971). This property arises from the inference rules defining married C C’ C is married to C depressed C C is depressed ( as the proposition-level internalization of logical entail- ment. suicidal C C is suicidal !dead C C is dead We summarize the connectives and notation used below: 0 abstract syntax concrete syntax meaning !murdered C C’ C murdered C !actor C C is a character in the story A ( fBg A -o {B} replacement A ⊗ B A B * conjunction of resources 3The complete, runnable code for this example can be !A !A persistent resource found at https://github.com/chrisamaphone/ Persistent resources may be regarded as permanent facts interactive-lp/blob/master/examples/tragedy.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-