Specifying and Staging Mixed-Initiative Dialogs with Program Generation and Transformation

Specifying and implementing flexible human-computer dialogs, such as those used in kiosks and smart phone apps, is challenging because of the numerous and varied directions in which each user might steer a dialog. The objective of this research is to…

Authors: Saverio Perugini

Sp ecifying and Staging Mixed-Initiativ e Dialogs with Program Ge neration and T ransformation Sa v erio P erugini Department of Computer Science Univ ersity of Dayton 300 College Park Dayton, Ohio 454 6 9–21 60 USA T el: +001 (937) 229–4 0 79, F ax: +001 (937) 229–21 93 E-mail: s averi o@uda yton. edu WWW: h ttp:/ /acad emic. udayton.edu/SaverioPerugini June 28, 2018 Abstract Spec ifying and implementing flex ible hu man-computer dialog s, suc h as thos e used in kiosks and smart phone apps, is c ha llenging because of the n umer ous and v aried directions in whic h each user might s teer a dialog. The ob jective o f this res earch is to improv e dialo g specifica tion and implementation. T o do so we enr iched a notation based on concepts fr o m pr ogra mming languages , esp ecially partia l ev aluation, for sp ecifying a v ar iety of unsolicited repo rting, mixed- initiative dialogs in a concise repres e nt ation that s erves as a desig n for dialog implementation. W e also built a dialo g mining system that ex tracts a sp ecification in this nota tion from require- men ts. T o demonstrate that suc h a specifica tion pro vides a design for dialog implement ation, we built a system that automatically generates an implementation of the dialog, called a stager , from it. These t wo components constitute a dialog mo deling to olkit that auto mates dialog sp ec- ification and implementation. These results provide a pro of of concept and demonstrate the study o f dialo g sp ecifica tion and implementation from a pro gramming la nguages p ers p e c tive. The ubiquity of dialogs in domains such as trav el, education, and health care combined with the demand for smar t phone a pps provide a landscap e for further in vestigation of these r esults. Keyw ords: currying, h uman-computer dialogs, mixed-initiativ e dialogs, mixed-initiativ e int er- action, partial ev aluation, program generation, program sp ecializa tion, program transform ation, Sc heme. 1 In tro duction F rom in teractiv e teller mac hines ( itm s), airp ort and train k iosks, and smart p hone app s to installa- tion wizards and in telligen t tutoring or training, human-computer dialog s 1 are wo v en into the fabric of our d aily in teractions with computer systems. While supp orting flexibilit y in dialog i s essen tial to deliv er a p ersonalized exp erience to the user, it mak es th e implement ation challe nging due to the numerous and v aried directions in wh ic h a us er might desire to steer a dialog, all of whic h m ust b e captured in an implemen tation. T his problem is d ifficult since dialogs range in complexit y from those mo d eled after a simple, fixed, predefined series of qu estions and answers to those that give the user a great deal of con trol o ver the d irection in which to steer the dialog. In this article, w e discuss a model, b ased on concepts from programming languages, esp eciall y partial ev aluation, for sp ecifying and staging 2 dialogs. The ob jectiv e of th is research is to impro v e dialog sp ecification and implemen tation, and to enrich and demonstrate the feasibilit y of an alt ernate metho d of mod eling h uman-computer dialog s. This article is organized as follo ws. T o int ro du ce the reader to the wide range of dialogs p ossible, and p ro vide a b etter feel for th is p r oblem and its d ifficult y , w e first presen t some illustrativ e examples of dialogs in Section 2 . W e s im p ly s ho w case a v ariet y of dialogs and th eir sp ecificatio n using formal nota tion, rather than discuss their im p lemen tation and r elated issues which are co v ered later. In Section 3, w e describ e a notation, based on concepts from pr ogramming languages, for sp ecifying d ialogs. Section 4 demonstrates ho w dialogs can b e staged with partial ev aluation, wh ile Section 5 outlines ho w to mine dialog sp ecificatio ns in th is notation from dialog requ ir emen ts, and ho w w e automatica lly generate stagers f rom those sp ecifications. Section 6 su m marizes our con trib utions and d iscusses fu tu re w ork. 2 Dialogs Let us consider a v ariet y of d ialogs we might wa nt to mo del. 2.1 Fixed- and Mixed- initiativ e Dialogs Consider a dialog to purchase gasoline using a credit card. The customer m ust fir st swip e the card, then c h o ose a grade of o ctane, and finally indicate whether she desires a receipt. Su c h a dialog is a fixe d dialog due to the fixed ord er of the questions f r om whic h the user is n ot p ermitted to d eviate in her resp onses [1]. An enumer ate d sp e cific ation is a set of episod es, and an episo de is an ordered list of questions to b e p osed and answ er ed from the start of the dialog through dialog completion. In tuitiv ely , a sp ecification is a complete set of all p ossible wa ys to complete a dialog. F ormally , a dialog sp ecification is a set of total ly or der e d sets . W e use a Hasse diagram, a graphical d epiction of a p artial ly or der e d se t , to repr esen t a dialog sp ecification. A r elation R with the set S o ver whose Cartesian pro duct R is defin ed is a strict p artial ly or der e d set (or p oset ) if R is an irreflexive , asymmetric, and trans itiv e relation. Th is means that some of the elemen ts of S m ay b e un ordered based on the relation R . On the other hand, a s et S is a strict total ly or der e d set according to a 1 A dialo g in this context refers to any series of interactions b etw een a u ser and a computer system, not n ecessarily through a verbal modality . F or instance, a u ser completing an online mortgage application participates in a h uman- computer dialog. 2 W e are not referring to st aging as the ‘language construct that allow s a program at one stage of eval uation to manipulate and specialize a p rogram to b e executed at a later stage’ [10]. Rather w e are using the term to refer to ‘staging the p rogressiv e in teraction of a h uman-comput er dialog.’ 2 T able 1 : A sp ectrum of dialogs from fixed (a, second column) to complete, mixed-initia tive dia logs (e, sixth column), encompas sing a v ar iety of uns olicited re p o rting, mixed-initiative dialogs, in thre e repr esentations: enum erated specifica tion (seco nd row), Hasse dia gam (third row), and our notation using concepts from progra mming lang ua ges (fourth row). Last (fifth) r ow gives staging express ion, using partial ev aluatio n ([ [ mix ] ]) , used to stage each dialog. a a The use of ellipses in the expressions in the l ast ro w (e.g. , size=. .. ) indicate that the v al ue of the parameter can b e any v alid resp onse. complete, ← − (most r igid) fixed dial ogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . mixed-initiati ve dialogs (most flexible) − → ID (a) (b) (c) (d) (e) Enumerated Specificatio n {≺ credit-card gra de receipt ≻} {≺ pin transa ction account amount ≻ , ≺ pin a ccount transaction amount ≻} {≺ receipt sa ndwich beverag e dine-in/take-out ≻ , ≺ dine-in/take-out sandwich beverage receipt ≻} {≺ cream suga r eggs toast ≻ , ≺ cream sugar toast eggs ≻ , ≺ (cream su gar) toast eggs ≻ , ≺ (cream su gar) eggs toast ≻ , ≺ sugar cream eggs toast ≻ , ≺ sugar cream toast eggs ≻ , ≺ eggs toa st cream sugar ≻ , ≺ eggs toa st sugar cream ≻ , ≺ toast egg s cream sugar ≻ , ≺ toast egg s sugar cream ≻ , ≺ sugar cream (eggs toast) ≻ , ≺ cream sugar (eggs toast) ≻ , ≺ (eggs toa st) (cream sugar) ≻ , ≺ (cream su gar) (eggs toast) ≻} {≺ (size blend cream) ≻ , ≺ (size blend) cream ≻ , ≺ cream (si ze blend) ≻ , ≺ (blend cream) size ≻ , ≺ size (blend cream) ≻ , ≺ (size crea m) blend ≻ , ≺ blend (si ze crea m) ≻ , ≺ size blend cream ≻ , ≺ size crea m blend ≻ , ≺ blend si ze crea m ≻ , ≺ blend cream size ≻ , ≺ cream b lend size ≻ , ≺ cream si ze blend ≻} Hasse diagram credit card grade receipt account PIN transaction amount receipt sandwich drink sandwich drink dine−in/take−out receipt dine−in/take−out sub−dialog 2 (eggs toast) eggs toast (cream sugar) sugar cream sub−dialog 1 (size blend cream) (size cream) (size blend) (blend cream) size blend cream PL Notation C credit-card g rade receipt C PIN SP E ′ transaction account amount C receipt sandwi ch drink di ne-in/take-out ∪ C dine-in/take-out sandwich drink receipt SP E ′ P E ⋆ cream sugar P E ⋆ eggs toast P E ⋆ size blend cream Implementation [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][ f , size = . . . ] , blend = . . . ] , cream = . . . ] [ [ mix ] ][f , size , blend , cream ], [ [ mix ] ][[ [ mix ] ][ f , size = . . . ] , blend = . . . , cream = . . . ] , [ [ mix ] ][[ [ mix ] ][ f , bl end = . . . , cream = . . . ] , size = . . . ] , [ [ mix ] ][[ [ mix ] ][ f , bl end = . . . ] , cream = . . . , size = . . . ], [ [ mix ] ][[ [ mix ] ][ f , cream = . . . , size = . . . ] , b lend = . . . ], [ [ mix ] ][[ [ mix ] ][ f , cream = . . . ] , size = . . . , blend = . . . ], [ [ mix ] ][[ [ mix ] ][ f , size = . . . , bl end = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][ [ [ mix ] ][ f , size = . . . ] , cream = . . . ] , blend = . . . ], [ [ mix ] ][[ [ mix ] ][ [ [ mix ] ][ f , size = . . . ] , blend = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][ [ [ mix ] ][ f , bl end = . . . ] , size = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][ [ [ mix ] ][ f , bl end = . . . ] , cream = . . . ] , size = . . . ], [ [ mix ] ][[ [ mix ] ][ [ [ mix ] ][ f , cream = . . . ] , size = . . . ] , blend = . . . ], [ [ mix ] ][[ [ mix ] ][ [ [ mix ] ][ f , cream = . . . ] , blend = . . . ] , size = . . . ] relation R if a nd only if for every t w o elemen ts ( x, y ) ∈ S , xRy or yR x . Ev ery totally ordered set is also a p artially ordered set, but t he rev erse is n ot necessarily true. An en umerated sp ecification of this gasoline dialog is {≺ credit-card grade receipt ≻} , and T able 1a illustrates the Hasse d iagram that sp ecifies it. A Hasse diagram is read b ottom-up. Here, th e set S of the p oset is the set of the questions p osed in the dialog and R of the p oset is the ‘must b e answered b efore’ relation denoted with an up w ard arro w b et ween the source and target of the arro w . Flexible dialogs typica lly sup p ort multiple completion paths. F or instance, consider a d ialog for ordering coffee . T he participan t m ust select a size and b lend, and indicate whether r o om for cream is desired. Since p ossible resp onses to th ese questions are completely indep enden t of eac h other, the dialog designer may wish to p ermit the p articipan t to co mmunicat e the answe rs in an y com bin ations and in an y order. F or example, some customers ma y prefer to use a ≺ size blend cream ≻ episo de: system: Pl ease select a size. user: Small. system: Pl ease select a blend. user: Dark. system: Pl ease sp ecify w hether y ou w ant r oom for cream. user: No ro om for cream. Others ma y prefer a ≺ blend cream size ≻ episod e: system: Pl ease select a blend. user: Mild. system: Pl ease sp ecify w hether y ou w ant r oom for cream. user: With ro om for cream. system: Pl ease select a size. 3 T able 2: Sample dialogs in volving p ermutations o r pa r titions o f resp onses t o questions. Map associa ting a concept from programming languages to ea ch element of the cro ss-pro duct of utterance orders in le ftmos t column and utterance s iz es in topmost ro w. Bolded parenthesized letters connect these dialogs to those in T able 1. Only a singl e resp onse Multiple r esponses per utterance per utterance Only o ne Confirmation dialog b oxes Online forms with utterance common in application softw are; multiple fields; int erpretation ( I ) int erpretation ( I ) T otal ly Purch asing gasoline with a Providing a telephone , ordered credit card; buying b ev erages credit card, or pin num b er utterances from a vending machine; through vo ice; currying ( C ) (a) partial function application n ( P F A ⋆ n ) P artia lly itm s, and air p or t or train ki osks; Ordering a coffee or pizza; ordered single-argument partial ev aluation ( P E ⋆ ) (e) utterances partial ev aluation ( S P E ′ ) (b) user: Large. Still others might p r efer to use a ≺ (size blend) cream ≻ episo de, w h ere answ ers to the questions enclosed in paren theses m u st b e c omm unicated in a single u tterance (i.e., all at once): system: Pl ease select a size. user: Small, french roast. system: Pl ease sp ecify w hether y ou w ant r oom for cream. user: No. Therefore, t o acc ommo date all p ossibilities w e sp ecify this dialog a s: {≺ (size blend cream) ≻ , ≺ (size blend) cream ≻ , ≺ cream (size blend) ≻ , ≺ (blend cream) size ≻ , ≺ size (blend cream) ≻ , ≺ (size cream) blend ≻ , ≺ blend (size cream) ≻ , ≺ size blend cream ≻ , ≺ size cream blend ≻ , ≺ blend size cream ≻ , ≺ b lend cream size ≻ , ≺ cream blend size ≻ , ≺ cream size blend ≻} . Notice th at this sp ecification ind icates that answ ers to the set of questions in the dialog m ay b e co mmunicate d in utterances corresp onding to all p ossible set p artitions of th e set of questio ns. Moreo ve r, all p ossible p ermutations of th ose partitions are sp ecified as w ell. The Hasse diagram for this d ialog is giv en in T able 1e. Th e absence of arro ws b et w een the size, blend, cream, (size blend), (size cream), (b lend cream), and (size b lend cream) elemen ts indicates that the times at which eac h of those u tterances ma y b e comm un icated are unordered. Notice that the Hasse diagram is a co mpressed r epresen tation capturin g the requiremen ts in t he sp ecification. Moreo ve r, the compression is lossless (i.e. , the episo des in th e en umerated sp ecification ma y b e reconstructed from t he diagram). Giving the user more fl exibilit y in ho w to p ro ceed through a dialog in cr eases th e num b er of episo des in its en umerated sp ecification. T h is coffee ordering dialog is a mixe d-initiative dialog [1]. There a re m ultiple tiers of mixed-initiativ e int eraction. The tie r considered i n this article is called unsolicite d r ep orting —an in teraction strat egy w here, in resp ons e to a question, at any p oin t in the dialog, the user ma y pro vid e an unsolicit ed resp onse to a forthcoming question. When all p ossible p erm u tations (i.e., order s ) of all p ossible partitions (i.e., combinations) of resp onses to questions are sup p orted, we call the dialog a c omplete , mixed-initiativ e dialog. T able 1 represent s a s pace from fi xed to complete, mixed-initiativ e dialogs, encompassin g a w id e v ariety of 4 dialog mining > mild Okay mild. Please enter a size. > small Please enter a size. ...... Please enter a size. ((size blend cream) (size cream blend) (blend size cream) (blend cream size) (cream size blend) (cream blend size) ((cream blend size))) > no room for cream Okay no room for cream. blend size cream PE* dialog specification enumerated compressed dialog specification programming languages stager (dialog system) Dialog Modeling Toolkit in a notation based on concepts from automatic stager generation Figure 1: Conceptual ov erview of our rese a rch pro ject through an ex a mple. unsolicited rep orting, mixed-initiativ e dialogs. T able 2 iden tifies some p ractical, everyda y dialogs that fall in to the cross pro duct of p ermuta tions and partitions of r esp onses to questions. Fig. 1 pr ovides an o verview of th is researc h pro ject. W e start with an enumerated dialog sp ecification (i.e., a set of episo d es) and mine it for a compressed represent ation of the dialog in a notation based on concepts f rom programming languages that captures the requ iremen ts of the dialog (transition fr om the left to the center of Fig. 1)—a p ro cess we call dialo g mining . F rom that in termediate, implemen tation-neutral repr esen tation w e automaticall y generate a stager —a program capable of realizing and executing the d ialog or, in other words, ‘staging’ the progressiv e in teraction’ (transition fr om th e cente r to the righ t of Fig. 1). 2.2 Sp ectrum of Dialogs Fixed and complete, mixed-initiativ e dialogs represen t opp osite end s of this sp ectrum of dialogs sho wn in T able 1 that encompass sev er al dialogs. F or instance, consid er a sp ecification for an itm dialog where pin and amount m u st b e en tered fir st and last, resp ectiv ely , but the transaction type (e.g., dep osit or withdr a wal) and accoun t t y p e (e.g., chec king or savings) ma y b e comm un icated in an y order (see T able 1b): {≺ pin transaction accoun t amount ≻ , ≺ pin accoun t transaction amount ≻} . This dialog conta ins an embedd ed, mixed-initiativ e sub-dialog [1]: {≺ transaction account ≻ , ≺ accoun t transaction ≻} . Alternativ ely , consid er a dialog for ordering lunch w h ere requesting a r eceipt or indicating whether you are dining-in or taking-out can b e comm unicated either fi rst or last, but sp ecification of sandwich and b ev erage must o ccur in that order: {≺ receipt sandwich beverage dine-in/take-out ≻ , ≺ dine-in/take -out sandwic h b everage receipt ≻} . This d ialog con tains an embedd ed, fixed sub -dialog (i.e., {≺ sandwich b ev erage ≻} ) and, un lik e the pr ior examples, cannot b e captured by a single p oset (see T able 1c). Lastly , consider a dialog cont aining tw o em b edded, complete, m ixed-initiativ e sub-dialogs [17] (see T able 1 d): {≺ cream sugar eggs toast ≻ , ≺ cream sugar toast eggs ≻ , ≺ (cream sugar) toast eggs ≻ , ≺ (cream sugar) eggs toast ≻ , ≺ sugar cream eggs toast ≻ , ≺ sugar cream toast eggs ≻ , ≺ eggs toast cream sugar ≻ , ≺ eggs toast sugar cream ≻ , ≺ toast eggs cream sugar ≻ , ≺ toast eggs sugar cream ≻ , ≺ sugar cream (eggs toast) ≻ , ≺ cream sugar (eggs toast) ≻ , ≺ (eggs toast) (cream sugar) ≻ , ≺ (cream sugar) (eggs toast) ≻} . 5 T able 3 : Specifications of dialogs in a notation based o n concepts from pr o gramming la nguages (second row) and a s enumerated s p ec ific a tions (third row). Last (fourth) row g ives staging expres s ion, using partia l ev aluation ([ [ mix ] ]), us ed to s tage ea ch dialog. ← − . . . dialogs between fixed dialogs and complete, mixed-initiat ive dialogs ( ∆ ) . . . − → ID (f ) (g) (h) (i) (j) PL Not. P F A n size blend cream P F A ⋆ n size blend cream SP E size blend cream SP E ′ size blend cream P E size blend cream Enum. Spec. {≺ (size blend cream) ≻ , ≺ (size (blend cream) ≻ , ≺ (size blend) cream ≻} {≺ (size blend crea m) ≻ , ≺ size (blend cream) ≻ , ≺ (size blend) cream ≻ , ≺ size blend cream ≻} {≺ size (blend crea m) ≻ , ≺ blend (size cream) ≻ , ≺ cream (size b lend) ≻} {≺ size blend cream ≻ , ≺ size cream blend ≻ , ≺ blend size cream ≻ , ≺ blend cream size ≻ , ≺ cream blend size ≻ , ≺ cream size blend ≻} {≺ (size blend cream) ≻ , ≺ size (blend cream) ≻ , ≺ blend (size cream) ≻ , ≺ cream (size blend ) ≻ , ≺ (size blend) cream ≻ , ≺ (size cream) blend ≻ , ≺ (blend cream) size ≻} Impl. [ [ mix ] ][f , si ze = . . . , blend = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . ] , bl end = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . , blend = . . . ] , cream = . . . ] [ [ mix ] ][f , si ze = . . . , blend = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . ] , bl end = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . , blend = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , size = . . . ] , blend = . . . ] , cream = . . . ] [ [ mix ] ][[ [ mix ] ][f , size = . . . ] , cream = . . . , bl end = . . . ] , [ [ mix ] ][[ [ mix ] ][f , bl en d = . . . ] , size = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , cream = . . . ] , size = . . . , bl end = . . . ] [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , size = . . . ] , cream = . . . ] , blend = . . . ], [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , size = . . . ] , blend = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , blend = . . . ] , size = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , blend = . . . ] , cream = . . . ] , size = . . . ], [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , cream = . . . ] , size = . . . ] , blend = . . . ], [ [ mix ] ][[ [ mix ] ][[ [ mix ] ][f , cream = . . . ] , blend = . . . ] , size = . . . ] [ [ mix ] ][f , si ze = . . . , blend = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . ] , cream = . . . , blend = . . . ], [ [ mix ] ][[ [ mix ] ][f , blend = . . . ] , size = . . . , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , cream = . . . ] , size = . . . , blend = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . , blend = . . . ] , cream = . . . ], [ [ mix ] ][[ [ mix ] ][f , size = . . . , cream = . . . ] , blend = . . . ], [ [ mix ] ][[ [ mix ] ][f , blend = . . . , cream = . . . ] , size] Here, the user can sp ecify coffee and breakfast choi ces in any order, and can s p ecify the sub-p arts of coffee and breakfast in any order, but cannot mix the atomic r esp onses of the t w o (i.e., episo des suc h as ≺ cream eggs sugar toast ≻ are n ot p ermitted). There are tw o assump tions we mak e in this article on this sp ectrum of dialogs: i) eac h episo de in a sp ecification has a consistent n umber of qu estions and ii) the p ermissible resp onses for eac h question are completely in dep end en t of eac h other (i.e., no r esp onse to a question ever precludes a particular resp onse to another qu estion). 3 Sp ecifying Mixed-initiativ e Dialog s with Concepts of Languages There is a com binatorial explosion in th e num b er of p ossible dialogs b et wee n the fixed and complete, mixed-initiativ e ends of the sp ectrum in T able 1. S p ecifically , the num b er of dialogs p ossible in this space is 2 |D cmi | − 1 = P |D cmi | r =1  |D cmi | r  (i.e., all p ossible sub sets, sa v e for the emp t y set, of all episo des in a complete, mixed-in itiativ e dialog), w here D cmi represent s the en umerated sp ecification of a complete, mixed -in itiativ e dialog given q , th e num b er of questions p osed in the dialog. In this section we bring stru cture to this space b y viewing these dialogs th r ough a p rogramming languages lens. This approac h also lends insight in to staging them. W e start by describ ing how to s p ecify these dialogs using a notation b ased on a v ariety of concepts fr om p rogramming languages. 3.1 Notation W e dev elop ed a computational mo del for sp ecifying and implemen ting m ixed -in itiativ e dialogs, cen tered around this ‘mo del one path, y et su p p ort man y paths’ theme. Th e fu ndamenta l asp ect of our mo del sup p orting that theme is our n o vel us e of p rogram transformations (e.g., p artial ev aluation) and other concepts fr om p rogramming languages (e.g., functional currying) to sp ecify and stage mixed-initiativ e d ialogs. Our mo del in v olv es a n otation for dialog sp ecification in a compressed mann er us in g these and other concepts [3, 12 ]. In this notation a dialog is sp ecified b y an expression of the form X T , where X r epresen ts a p rogram transformation or language concept and T repr esents a list of terms , where eac h term rep resen ts either a qu estion (of the d ialog) or a sub -dialog (in tro duced b elo w) in the d ialog b eing sp ecified. Eac h expr ession represent s a set of episo des. The m ain thematic idea is th at the set of episo des sp ecified b y an expression of this form corresp ond to all p ossible w a ys that a function parameterized b y the terms (e.g., dialog questions) in the denominator can b e p artially applied, and re-partially applied, and so on progressiv ely , according to the seman tics of the transform ation op erator or language concept in the numerato r. 3 F or in stance, w e use the 3 This notation was introduced in [3] and revised in [12]. Here, we enric h it with additional concep t s and modify its semantics . 6 T able 4: Type signa tures o f functions in the mo del demonstrating that partial ev a luation ([ [ mix ] ]) subsumes the other functions here. Assumes a ternary function f : ( a × b × c ) → d . Concept F unction Ty p e signature λ -calculus I apply : ((( a × b × c ) → d ) × a × b × c ) → d = λ ( f , x, y , z ) .f ( x, y , z ) C curry : (( a × b × c ) → d ) → ( a → ( b → ( c → d ) )) = λ ( f ) .λ ( x ) .λ ( y ) .λ ( z ) .f ( x, y , z ) P F A 1 papply1 : ((( a × b × c ) → d ) × a ) → (( b × c ) → d ) = λ ( f , x ) .λ ( y, z ) .f ( x, y , z ) P F A n papplyn : ((( a × b × c ) → d ) × a ) → (( b × c ) → d ) = λ ( f , x ) .λ ( y, z ) .f ( x, y , z ) ((( a × b × c ) → d ) × a × b ) → ( c → d ) = λ ( f , x, y ) .λ ( z ) .f ( x, y, z ) ((( a × b × c ) → d ) × a × b × c ) → ( {} → d ) = λ ( f, x, y , z ) .λ () .f ( x, y , z ) S P E smix : ((( a × b × c ) → d ) × a ) → (( b × c ) → d ) = λ ( f , x ) .λ ( y , z ) .f ( x, y , z ) ((( a × b × c ) → d ) × b ) → (( a × c ) → d ) = λ ( f , y ) .λ ( x, z ) .f ( x, y , z ) ((( a × b × c ) → d ) × c ) → (( a × b ) → d ) = λ ( f , z ) .λ ( x, y ) .f ( x, y, z ) P E mix : ((( a × b × c ) → d ) × a ) → (( b × c ) → d ) = λ ( f , x ) .λ ( y , z ) .f ( x, y , z ) ((( a × b × c ) → d ) × b ) → (( a × c ) → d ) = λ ( f , y ) .λ ( x, z ) .f ( x, y , z ) ((( a × b × c ) → d ) × c ) → (( a × b ) → d ) = λ ( f , z ) .λ ( x, y ) .f ( x, y, z ) ((( a × b × c ) → d ) × a × b ) → ( c → d ) = λ ( f , x, y ) .λ ( z ) .f ( x, y, z ) ((( a × b × c ) → d ) × b × c ) → ( a → d ) = λ ( f , y, z ) .λ ( x ) .f ( x, y , z ) ((( a × b × c ) → d ) × a × c ) → ( b → d ) = λ ( f , x, z ) .λ ( y ) .f ( x, y, z ) ((( a × b × c ) → d ) × a × b × c ) → ( {} → d ) = λ ( f, x, y , z ) .λ () .f ( x, y , z ) concept of I nterpr etation [5] to sp ecify a dialog where al l the resp onses to all dialog questions must b e comm un icated in a single utterance (e.g., Q: ‘Please select a size.’ A: ‘Small, dark roast, no cream.’), su c h as I blend cream size = {≺ (blend cream s ize) ≻} , b ecause in terpreting a function requires that al l argumen ts b e su pplied at the time of th e call, corresp onding to a complete ev aluation. Similarly , we use the concept of C urrying to s p ecify a fixed d ialog, su c h as C blend cream size = {≺ blend cream size ≻} , where only one fixed episo de is p ermitted. Currying transforms a fu nction f uncur r ied with t yp e signature ( p 1 × p 2 × · · · × p n ) → r to a fu nction f cur r ied with t yp e signature p 1 → ( p 2 → ( · · · → ( p n → r ) · · · ), suc h that f uncur r ied ( a 1 , a 2 , · · · , a n ) = ( · · · (( f cur r ied ( a 1 ))( a 2 )) · · · )( a n ). C urryin g f uncur r ied and ru nning the resulting f cur r ied function has the same effect as p rogressiv ely partially applying f uncur r ied , resulting in a dialog spread across m ultiple stages of int eraction (i.e., qu estions and answ ers), but still in a fixed, p rescrib ed ord er (e.g., Q: ‘Please select a size.’ A: ‘S mall,’ Q : ‘Please select a blend.’ A: ‘Dark roast,’ Q: ‘Please sp ecify w h ether y ou wa nt ro om for cream.’ A: ‘Y es.’). Additional concepts from p rogramming languages in this mo del are partial function app lica- tion ( P F A 1 ), partial function app lication n ( P F A n ), single-argument partial ev aluation ( S P E ), and partial ev aluation ( P E ) [9]. P artial function application, pa pply1 , takes a function and its fi rst argumen t and retur n s a function accepting the r emainder of its p arameters. T he function pa pplyn , on the other hand , take s a fu nction f and all of the first n of m argumen ts to f where n 6 m , and returns a function accepting the remainder of its ( m − n ) parameters. Notice that with single- argumen t partial ev aluation, the input function m a y b e partially ev aluated with only one argumen t at a time. These concepts corresp ond to h igher-order functions that eac h tak e a fun ction and some subset of its parameters as arguments. The t yp e signatures for these fu n ctions are giv en in T able 4. All of these fu nctions except a pply return a fun ction. T able 5 p ro vides definitions of papply1 , papply n , and smix in Sc heme. W e use the sym b ol mi x from [9] to denote the par- tial ev aluation op eration b ecause partial ev aluation in v olv es a mi x ture of interpretation and cod e generation. The mi x op erator accepts t wo arguments: a function to b e partially ev aluated and a static assignment of v alues to any sub set of its parameters. The semant ics of the expression [ [ f ] ] 3 in the n otation from [9] are ‘in v ok e f on 3 ’ or f(3 ) . Consider a fu nction p ow that accepts a base and an exponent , in that ord er, as arguments and return s the base raised to the exponen t . The seman tics of the expression [ [ mix ] ][ pow , exponent = 2 ] are ‘partially ev aluate pow w ith resp ect to exponent equal to t w o,’ an op eration whic h r eturns pow exponent = 2 that accepts only a base (i.e., 7 T able 5: Definitions o f (left) papply 1 , (center) pappl yn , and (right) smi x in Scheme. ( define papply1 ( lambda ( fun arg ) ( lambda x ( apply fun ( co ns arg x ))))) ( define papplyn ( lambda ( fun . args ) ( lambda x ( apply fun ( app end args x ))))) ( define smix ( lambda ( fun static_ arg ) ( mix fun static_arg ))) a squ arin g function). Th erefore, [ [ a partial ev aluation , pow exponent = 2 z }| { [ [ mix ] ][ pow , exponent = 2 ] ] ] 3 = a complete eva luation z }| { [ [ pow ] ][ 3 , 2 ] = 9 . Giv en a ternary function f with integ er parameters x , y , an d z : f y = 2 = [ [ mix ] ][ f , y = 2 ] and [ [ f ] ][ 1 , 2 , 3 ] = [ [[ [ mix ] ][ f , y = 2 ]] ][ 1 , 3 ] . In general, [ [[ [ mix ] ][ f , input static ]] ] input dynamic = [ [ f ] ][ input static , input dynamic ] . These fun ctions are general in that they accept a function of any arit y as inpu t. The f unctions curry , papply1 , papplyn , s mix , and mix are close d op erators ov er their input set (i.e., they tak e a function as inpu t and return a fun ction as outp ut). Here, we are int erested in a progressiv e series of applications of eac h of these functions that terminates at a fi xp oint. Therefore, we su p ers cript a concept mnemonic X in the numerato r with a ⋆ , where applicable, to indicate a pr ogressiv e series of ap p lications of the corresp onding f unction ending in a fixp oin t. F or instance, r ep eatedly applying papp lyn to a tern ary function f as (apply (pappl yn (papplyn f small) m ild) no) realizes the episo de ≺ s ize blend cream ≻ in add ition to the ≺ size (blend cream) ≻ , ≺ (size blend) cream ≻ , and ≺ (size blend cream) ≻ episod es which are realized with only a single application of papplyn . Thus, the exp ression P E ⋆ size blend cream denotes the set of all six p erm utations of { size, b lend, cream } and all p ermutat ions of all set partitions of { size, blend, cream } or, in other w ords, all thirteen, p ossible ep iso des to complete the dialog: {≺ (size blend cream) ≻ , ≺ (size bl end) cream ≻ , ≺ cream (size blend) ≻ , ≺ (blend cream) size ≻ , ≺ si ze (blend cream) ≻ , ≺ (size cream) blend ≻ , ≺ blend (size cream) ≻ , ≺ size bl end cream ≻ , . . . remaining five p ermutat ions of { size, blend, cream } . . . } . This notation also con tains a prime ( ′ ) sup erscript. While the star ( ⋆ ) sup erscript p erm its rep eated applications, but do es not r equire th em, the prime ( ′ ) sup erscrip t r equires rep eated ap- plications of the op erator until a fixp oin t is r eac hed. F or instance, the ep iso de {≺ size (blend cream) ≻ is sp ecified by S P E ⋆ size blend cream , but not by S P E ′ size blend cream . Note that C size blend cream = C ⋆ size blend cream b ecause the fun ction returned from the applicatio n of a curried function is already in curr ied form; there is n o reed to recurr y it. In general, C . . . = C ⋆ . . . for an y denominator . . . common to b oth expressions . When the denominator is irrelev an t to the discussion at hand we drop it and simply use only the concept mnemonic to refer to a set of episo d es. Thus, C = C ⋆ . Also, I = I ∗ since ap ply do es not return a fun ction. Ho w ev er, w e can sup erscript P F A 1 , P F A n , S P E , and P E with a ⋆ sym b ol. The second row of T able 1 and the third ro w of T able 3 sh o w s en umerated sp ecifications of dialogs for ordering coffe e, among others. Eac h dialog is also sp ecified us in g this notation based on these concepts fr om programming languages in the fourth row of T able 1 and the second ro w of T able 3. W e associate a fixed dialog with currying ( C ) (fourth ro w of column (a) in T able 1) and a complete, mixed-initiativ e dialog with p artial evaluation ( P E ⋆ ) (fourth r o w of column (e) in T able 1). Th e concepts from pr ogramming languages in the second row in T able 3 (and com binations of them) within the con text of an exp r ession in this notation help sp ecify dialogs b et w een the fixed and complete, m ixed -in itiativ e en d s of this dialog sp ectrum, sho wn in T able 1. Note that the order of the terms in the d enominator matters (i.e., ( C a b c = {≺ a b c ≻} ) 6 = ( C b a c = {≺ b a c ≻} )) . Also, n ote that w hen the num b er of qu estions p osed in a dialog is less than three, expressions with a C or P F A 1 in th e numerator sp ecify th e same episo d e (e.g., C a b = P F A 1 a b = {≺ a b ≻} ) . Th e concept mnemonic in eac h cell of T able 2 connect th e dialogs in that cells with th e concept fr om p rogramming languages used to sp ecify them. 8 Note that there is alw a ys only one episo d e p ossible in any dialog sp ecified u sing on ly one of the I , C , or P F A 1 mnemonics in the numerator. There are alw a ys q episo d es in any dialog sp ecified using only one of the P F A n or S P E mnemonics in th e n umerator, wh ere q is the num b er of questions p osed in a dialog. The num b er of episo des in an y dialog sp ecified using an y of the P F A ⋆ n , S P E ′ , P E , or P E ⋆ mnemonics in the numerator as a f unction of q is 2 q − 1 , q !, P q p =1  q p  , and P q p =1 p ! × S ( q , p ) 4 , resp ectiv ely . The ep iso des in any dialog sp ecified using only one of the I , C , P F A 1 , P F A n , P F A ⋆ n , S P E , S P E ′ , P E , or P E ⋆ mnemonics in the n umerator are related to eac h other in multi ple w a ys. F or instance, b y defin ition of the ⋆ symb ol here, X ⊆ X ⋆ , wh ere X is any mnemonic corresp ondin g to a concept from programming languages used in this mo d el (e.g., P F A 1 or P E ). O th er relationships include: P F A n ∪ S P E ⊂ P E , (( P F A ⋆ n − P F A n ) ∪ ( S P E ⋆ − S P E )) ∩ P E = ∅ , P F A 1 ⊂ P F A n , I ∪ C ∪ P F A 1 ∪ P F A n ⊂ P F A ⋆ n , and P F A ⋆ n ⊂ P E ⋆ . Lastly , I ∪ C ∪ P F A 1 ∪ P F A n ∪ P F A ⋆ n ∪ S P E ∪ S P E ′ ∪ P E ⊂ P E ⋆ meaning that partial ev aluation su b sumes other all other concepts in this mo del. Th e implication of this, as we see in the follo wing section, is th at an y dialog sp ecified using this n otation can b e supp orted through partial ev aluation. This notation is exp ressiv e enough to also capture dialogs in v olving m ultiple sub-d ialogs, b y nesting these expressions in the denominator. F or in stance, consid er S P E ′ P E ⋆ cream sugar P E ⋆ eggs toa st , wh ere the user can sp ecify coffee an d breakfast c hoices in an y order, and can sp ecify the sub-parts of coffee and breakfast in an y order, b ut cannot mix the atomic resp onses of the t wo (e.g., the ≺ cream eggs sugar toast ≻ episo de is not p ermitted). 3.2 Ev aluation W e den ote the space of dialogs p ossible giv en q , the num b er of questions p osed in a dialog, with the sym b ol U q . Let X denote a concept from p rogramming languages in this mo d el (e.g., C or P E ⋆ ). W e use the symb ol X to denote a class of dialogs (e.g., C or P E ⋆ ), where a class is a set of dialogs where eac h dialog in the set can b e sp ecified with concept mn emonic X in the numerator and q is the num b er of questions p osed in eac h dialog. T he n umber of d ialogs p ossible giv en a v alue f or q is |U q | = 2 | P E ⋆ | − 1 . Of all of those dialogs, th er e are 2 | P E ⋆ | − 3 q ! − q − 5 dialogs 5 that cannot b e sp ecified with a single concept (e.g., dialogs b, c, and d in T able 1). W e refer to the class con taining th ese dialogs as ∆ . There are notable observ ations on any space U q : a ) its classes are totally d isjoin t, b ) the I , S P E , S P E ′ , P E , and P E ⋆ classes alwa y s con tain only one sp ecification given any q , c ) the P F A 1 class alw ays con tains q s p ecifications b ecause there exists one sp ecification p er question, where the resp onse to that question is supplied first and the resp ons es to all remaining qu estions arrive next in one utterance, d ) the C , P F A n , and P F A ⋆ n classes alwa ys con tain q ! sp ecifications as eac h conta ins one sp ecification for eac h episo d e in a d ialog sp ecified u sing the S P E ′ concept, and e ) therefore, the n umber of dialogs sp ecifiable w ith only a single instance of a concept mn emonic is 3 q ! + q + 5 . Ho wev er, this notation for dialog sp ecification is expressiv e enough to sp ecify the dialogs in the ∆ class b ecause those dialog s can b e expressed as either a u nion of th e set of episo d es sp ecified b y more than one dialog s p ecification called a c omp ound expr ession (e.g., dialog c in T able 1, or I x y z ∪ P F A 1 x y z = {≺ (x y z) ≻ , ≺ x (y z) ≻} ) or expressed as dialogs inv olving sub-dialo gs through the use of nesting [3 ] (e.g., dialogs b and d in T able 1), or b oth (e.g., C size S P E blend cre am ∪ C blend S P E cream size ∪ C cream bl en d size ). In dialogs con taining t wo or more terms in the d enominator, wh ere at least one of the terms 4 Let s ( m, n ) be the set of all p artitions of a set of size m into ex actly n non-empty sub sets, where n is a p ositiv e integ er and n 6 m . The Stirling numb er of a set of size m is S ( m, n ) = | s ( m, n ) | . 5 F or q > 3, | ∆ | = |U | − |I| − |C | − |P F A 1 | − |P F A n | − |P F A ⋆ n | − |S P E | − |P E | − |P E ⋆ | . The cases where q = 1 and q = 2 are the only cases where | ∆ | 6 = |U | − |I | − |C| − |P F A 1 | − |P F A n | − |P F A ⋆ n | − |S P E | − |P E | − |P E ⋆ | . This is b ecause when q = 1, the one specification in each of the ind ividual classes is the same in each class. Similarly , when q = 2 some sp ecifications are multi-clas sified. 9 Listing 1: Datat yp e definitions in ml descr ibing the for m o f the expressions in the notation based o n concepts from programming languages use d in this ar ticle. datatype Concept_mn emonic = I | C | PFA1 | PFAN | PFANstar | SPE | SPEpr ime | PE | PEstar ; ( ∗ C oncept m nemonic i s numerat or and Dialog sp ec i s denominator ∗ ) datatype Dialog_spe c = A_Dialog_sp ec o f Concept_mne monic ∗ Dialog_spe c ( ∗ A dialog s p ecification is a either a single expression or a union of single expressions , called a compound expression ∗ ) datatype Dialog_spe cification = A_single _dialog_spe c of Dialog_spe c | A_union_of_dial og_specs of Dialog_spec list ; is a sub -dialog (e.g., dialogs ... a C b c and ... C a b P E ⋆ c d , but n ot ... I a b ), eac h of the I , P F A n , P F A ⋆ n , P E , and P E ⋆ concept m nemonics is n ot a candidate for the n umerator. This is b ecause those concepts require (in th e case of I ) or supp ort multiple resp onses p er utterance and it is not p ossible to complete m ultiple su b-dialogs in a s ingle utterance or complete a sub-dialog and an individual qu estion in a single utterance. Th e P F A 1 and S P E concept m n emonics only suffice for tw o categ ories of d ialogs con taining sub-dialogs: those w ith no more than t wo terms in the denominator, w here one of the terms is a s ub-dialog (e.g., P F A 1 a P E ⋆ b c , P F A 1 P E ⋆ a b P E ⋆ c d , S P E a P E ⋆ b c , and S P E P E ⋆ a b P E ⋆ c d ) and those with more th an t w o term s in the denominator where only the fi rst term is a sub -dialog (e.g., P F A 1 P E ⋆ a b c d e f and S P E P E ⋆ a b c d e f ). This is b ecause when us ed as the numerator in an expr ession whose d enominator con tains more than t wo terms, one of whic h is a sub-dialog n ot in the fi rst p osition, P F A 1 and S P E require multiple resp onses in the second and final utterance. Hence, C is the only concept mnemonic that can alw a ys b e used in the numerator of an expression cont aining any n umber of sub-d ialogs in the d enominator. Ho wev er, C only supp orts fixed ord ers of resp onses. Thus, w e n eed a mnemonic for a concept that restricts utterances to one resp onse and only p ermits one sub -dialog to b e p ursed at a time, but also p ermits all p ossib le completion orders. S uc h a concept could b e used to sp ecify a dialog with more than t wo terms in the denominator, any of w hic h can b e a su b-dialog, that can b e completed in any order. Th e concept represented b y the mn emonic S P E ′ is ideal for this pu rp ose (see column (i) in T able 3). Note that C P E ⋆ a b P E ⋆ c d P E ⋆ e f 6 = S P E ′ P E ⋆ a b P E ⋆ c d P E ⋆ e f , and S P E ′ ⊂ P E ⋆ . The form of th ese expressions in this notation b ased on concepts from p r ogramming languages can b e describ ed by th e d atat yp e definitions in ml in Listing 1. Sp ecifying dialogs in the sp ectrum sh o wn in T able 1 with this n otation b ased on concepts from pr ogramming languages has m ultiple effects: a ) it helps b ring structure to the s p ace b et ween the tw o ends of the sp ectrum, b ) it h elps us losslessly compr ess the episo des in an en umerated sp ecification of a dialog withou t enumerating all of th e episo des to capture the p ossible ord ers and com binations of resp onses therein and, therefore, pro v id es a shorthand n otation for dialog sp ecification, akin to the Hasse diagram m etho d, and c ) a dialog sp ecified in this notation pro vides a design for implemen ting the d ialog, as we see b elo w. W e currently ha v e nine language concepts in our mo d el. Eac h concept en ric h es the expressivity of the notation at capturing dialog sp ecificatio ns from which to mo del dialogs. An attractiv e consequence of this n otation for d ialog sp ecification is th at the (nested) structure of the expression, and the language concepts us ed th erein, provides a bluepr in t for staging (i.e., implemen ting) the dialog. In other w ord s, the concepts fr om p rogramming languages are n ot just helpful metaphors for d ialog sp ecification (as w e harn ess th e ph ilosophical analogs b et ween pr ogramming languages and natural languages), but also lend insight into op erationalizing th e dialog. 10 4 Staging M ixed-initiativ e Dialogs b y P artial Ev aluation Our notation f or sp ecifying mixed-initiativ e dialogs lend s itself to t wo metho ds of dialog implemen- tation: i) using partial ev aluation to stage the inte raction [9], or ii) u sing a set of rewrite rules to stage the in teraction [2]. W e use an example to illustrate ho w dialogs can b e stage d with partial ev aluation. Consider the ternary Scheme fu nction sho wn w ithin a dotted b order in Fig. 2, simplified for pu r p oses of succinct exp osition. 6 Notice that it only mo dels one dialog ep iso de: ≺ size blend cream ≻ . W e defi n e this fu nction w ithout the in tent of eve r inv oking it, and r ather only with the in ten t of pr ogressiv ely transformin g it automatically with partial ev aluation for the sake of s taging the int eraction of a m ixed-initiativ e dialog. Thus, we only us e this function as a malleable d ata ob ject, and w h en it has b een completely consum ed through transformation, the dialog is complete. The top half of Fig. 2 d emonstrates ho w the ≺ size b lend cream ≻ episo de is staged by this pro cess. Th e same fu nction can b e used to realize a completely d ifferen t episo de than the one after whic h it is mo d eled. F or instance, the b ottom half of Fig. 2 d emonstrates ho w the ≺ cream b lend size ≻ episo d e can b e s taged by this pr o cess, with the same f u nction. While Fig. 2 sh o ws how the function is transformed after eac h progressiv e partial ev aluation in th e pro cess, Fig. 3 omits these in termediary outputs and , thus, pr o v id es an alternate view of Fig. 2. While the control fl o w mo dels only one ep iso de (in this case, ≺ s ize blend cream ≻ ), through partial ev aluating we can stage the int eraction required by thirteen distinct episo d es. In general, by partially ev aluating a function represen ting only one episo de, w e can realize P q p =1 p ! × S ( q , p ) distinct episo des (i.e., | D cmi | ), where q is the num b er of questions p osed in a d ialog, and S ( m, n ) is size of the set of all partitions of a set of size m into exactly n non-empty sub sets, where n is a p ositiv e in teger and n 6 m (i.e., th e Stirling numb er of a set of size m ). This ‘mo del one episo de, stage m ultiple’ feature is a significant r esult of our app roac h to dialog mo d eling and im p lemen tation. Notice f r om Fig. 2 that, at any p oin t in the in teraction, a script alw ays explicitly mo dels th e questions th at remain unanswered and, therefore, implicitly mo dels the questions that hav e b een answ ered. As a resu lt, it is alw a ys clear wh at information to prompt for n ext. In the m ixed- initiativ e dialog comm u n it y , ke eping trac k of what has and has not b een communicat ed is calle d dialo g management . The dialo g I size blend cream = {≺ (size blend cream) ≻} can b e staged with partial ev aluation as [ [ mix ] ][f , si ze = . . . , blend = . . . , cream = . . . ] . S imilarly , P F A 1 size blend cream = {≺ size (cream blend) ≻} can b e staged w ith partial ev aluation as [ [ mix ] ][[ [ mix ] ] [ P F A 1 size blend cream , size = . . . ] , blend = . . . , cream = . . . ] . The fi f th (last) ro w of T a- ble 1 and the fourth (last) row of T able 3 d etails ho w dialogs sp ecified usin g only one of eac h concept mnemonic in an expression are staged by partial ev aluation, which su bsumes all of the other concepts based on the argument s with w hic h y ou partially ev aluate. F or instance, P F A ⋆ n is ac hieved by progressive ly partially ev aluating w ith any prefi x of its arguments (see last r o w , thir d (g) column in T able 3). Giv en a sp ecification of a d ialog in our notatio n, an alternate implementat ion approac h in volv es the use of rewrite rules to stage the in teraction [2]. The concepts I and C are primitiv e in that an y d ialog mo delable w ith our notatio n can b e represent ed using only I or C concept mnemonics in a sp ecification expression. In particular, to sp ecify an y d ialog in the sp ectrum sho wn in T able 1 using this notation we can simply translate eac h episo d e in its enumerated sp ecification as a sub - expression with either an I or C in the numerator an d th e entire sp ecification as a un ion of those su b - expressions. As a r esult, all d ialogs sp ecified using this n otation can b e reduced to a sp ecification using only the I or C concept mnemonics. F or instance, I x y z ∪ C x y z ∪ C y z x ∪ C z x y ∪ C x I y z = {≺ (x y z) ≻ , ≺ x 6 An expression of the form <...> is used to represent a list of v alid c hoices (e.g., could represent the list ‘(small medium large) ). Moreo ver, these functions b eing p artially eval uated in Figs . 2 and 3 omit else (exceptional) branches for pu rp oses of succinct exp osition. 11 Staging the d ialog episod e ≺ size blend cream ≻ = C size blend cr eam by p artial eva luation ([ [ mix ] ]). [ [ mix ] ] [ ( lambda ( size blend cream ) ( if ( member ? size < sizes > ) ( if ( member ? blend < blends > ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) ) ) , size=small ] = ( lambda ( blend cream ) ( if ( member ? blend < blends > ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) ) [ [ mix ] ] [ ( lambda ( blend cream ) ( if ( member ? blend < blends > ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) ) , blend= mild ] = ( lambda ( cream ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) [ [ mix ] ] [ ( lambda ( cream ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) , cream=no ] = ( lambda () ( retrie ve item ) ) Staging the d ialog episod e ≺ cream blend size ≻ = C cream blend size by p artial eva luation ([ [ mix ] ]). [ [ mix ] ] [ ( lambda ( size blend cream ) ( if ( member ? size < sizes > ) ( if ( member ? blend < blends > ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) ) ) , cream=yes ] = ( lambda ( size blend ) ( if ( member ? size < sizes > ) ( if ( member ? blend < blends > ) ( retrieve item ) ) ) ) ) [ [ mix ] ] [ ( lambda ( size blend ) ( if ( member ? size < sizes > ) ( if ( member ? blend < blends > ) ( retrie ve item ) ) ) ) ) , blend= dark ] = ( lambda ( size ) ( if ( member ? size < sizes > ) ( retrieve item ) ) ) ) [ [ mix ] ] [ ( lambda ( size ) ( if ( member ? size < sizes > ) ( retrie ve item ) ) ) ) , size=large ] = ( lambda () ( retrie ve item ) ) Figure 2: Staging dia lo g episo des by par tial ev aluation, explicitly illustrating the in termediate output of each partial ev a luation. Dotted b oxes r einforce that bo th series o f transformations , top ha lf and b ottom half, start with the s a me script. Staging the d ialog episod e ≺ size blend cream ≻ = C size blend cr eam by p artial eva luation ([ [ mix ] ]). [ [ mix ] ] [ [ [ mix ] ] [ [ [ mix ] ] [ ( lambda ( size blend cream ) ( if ( member ? size < sizes > ) ( if ( member ? blend < blends > ) ( if ( member ? cream < cream > ) ( retrie ve item ) ) ) ) ) ) , size=small ] , bl end=mil d ] , cream=no ] = ( lambda () ( retrie ve item ) ) Staging the d ialog episod e ≺ cream blend size ≻ = C cream blend size by p artial eva luation ([ [ mix ] ]). [ [ mix ] ] [ [ [ mix ] ] [ [ [ mix ] ] [ ( lambda ( size blend cream ) ( if ( member ? size < sizes > ) ( if ( member ? blend < blends > ) ( if ( member ? cream < cream > ) ( retrieve item ) ) ) ) ) ) , cream=yes ] , blend=d ark ] , size=l arge ] = ( lambda () ( retrieve item ) ) Figure 3: Alternate view of Fig. 2, without explicit illustr a tion of the intermediate outputs of each succes s ive partial ev aluation. a a It is not imp ortan t that the indivi dual resp onses communicated in these tw o staged dialog episodes are different (i. e., (smal l mild no) and (yes dark large) ). Rather it is notable that the resp onses to th e questions in each episod e are provided in different orders. The orders could still b e different ev en if the resp onses w ere the same (e.g., (small mild no) v ersus (no mild small) ). 12 time deprt. dest. PE* "I’m traveling to Brussels." (a program) interpreter input dialog specification in domain−specific language "When would you like to depart?" domain−specific initial dialog script evaluator rewrite rules partial transformed dialog script interpreter for language dialog stager Figure 4: C o nceptual design of dialog sys tem. y z ≻ , ≺ y z x ≻ , ≺ z x y ≻ , ≺ x (y z) ≻} . Therefore, w e define r ewrite rules , not sho wn here, akin to those in [12], and can pr ogressiv ely apply them after ev ery utterance, rather than partial ev aluation itself, to transform the r epresent ation of th e dialog, to stage it. F or instance, the ab ov e dialog P F A 1 size blend cream = {≺ size (blend cream) ≻} can b e s taged with term rewriting as P F A 1 size blend cream = C size I blend cre am (first rewrite), and [ C size I blend cre am , size = . . . ] = C I blend cre am = I blend cream (second rewrite), and [ I blend cream , blend = . . . , cream = . . . ] = ∼ (i.e., dialog complete). Similarly , [ S P E ′ P E a b P E c d , d = . . . ] = S P E ′ P E c P E a b = S P E ′ C c P E a b = C c P E a b , and [ C c P E a b , c = . ] = C P E a b = P E a b , and [ P E a b , b = . . . ] = P E a = C a = I a , and fi nally [ I a , a = . . . ] = ∼ . Since partial ev aluation can b e us ed to partially apply a fun ction with resp ect to any subset of its parameters (i.e., it sup p orts the partial app lication of a function with all p ossible orders and com bin ations of its argumen ts), we can stage any u nsolicited rep orting, mixed-initiativ e d ialog in this space usin g only partial ev aluation. In other words, partial ev aluation is a generalizat ion of an y concept fr om programming languages presented here. A d ialog sp ecification expressed in th is notation conta ining a concept m nemonic other than P E ⋆ represent s a particular t yp e of r estriction on p artial ev aluation. 5 Implemen ting Dialogs with P artial Ev aluation Guided by this computational mo del for mixed-initiativ e in teration, we built a dialog mo deling and managemen t to olkit and a dialog engine groun ded in these pr inciples. A sp ecification of a dialog in this n otation, based on concepts from programming languages, pro vides a plan f or the implemen tation of the dialog. In th is section we d iscuss the imp lemen tation details of automatically generating a stager from an enumerated sp ecification of a dialog to b e implemen ted (see Fig. 1). 5.1 Mixed-initiativ e Dialog T o olkit and E ngine Our to olkit automates the construction of a stager (i.e., a system implement ing a mixed-initiativ e dialog) from a sp ecification of a mixed-initiativ e dialog in ou r notation. The to olkit can b e though t of as an inte rpr eter for a d omain-sp ecific language (i.e., our dialog notation); see Fig. 4. The protot yp e, pro of-of-concept imp lemen tation of b oth the to olkit and en gine was done in Sc heme (describ ed here). 5.2 Dialog Mining Extracting a minimal s p ecification in this notation, based on concepts from programming languages, from an enumerated d ialog sp ecification is a pro cess we call dialo g mining ; see transition from the left to the cen ter of Fig. 1 . While the details of d ialog minin g are b ey ond the scop e of this pap er, and more appropriate for a data min in g aud ience, w e mak e some cursory remarks. 13 Listing 2: T rans c ript of an in teractive sessio n with the dialog miner illustrating how compre s sed specifica tions in this notation, based on concepts fr om pro gramming languag es, including sp ecifica tions a, b, and e in T able 1, are mined fro m enumerated specifica tions. 1 ; ; onl y one utterance ; interpretation or complete ev aluati on 2 > ( mine -expr ' ((( credit -card grade receip t ) ) ) ) 3 (( "I " credit- card grade receipt ) ) 4 5 ; ; exampl e a: a fixed dialog sp ecification ; 6 ; ; totall y − ordered with only a single resp onse p er utterance ; 7 ; ; curr yi ng 8 > ( mine -expr ' (( cred it-card gra de receip t ) ) ) 9 (( "C " credit- card grade receipt ) ) 10 11 ; ; totally ordered with multiple responses per utterance ; parti al fu n ction application n ∗ 12 > ( mine-expr ' (( size blend cream ) (( size blend ) cream ) 13 ( size ( blend cream ) ) (( size blend cream ) ) ) ) 14 (( " PFA_n * " size blend cream ) ) 15 16 ; ; partially ordered with only a single resp onse p er utterance ; 17 ; ; si n gle − argument partial ev aluation ' 18 > ( mine-expr ( permu tation s ' ( size blend cream ) ) ) 19 (( "SPE ' " size blend cream ) ) 20 21 ; ; exampl e e: a complete, mixed − initi ati ve dialog ; 22 ; ; partially ordered with multiple resp onses p er utterance ; 23 ; ; partial ev aluation ∗ 24 > ( mine-expr ( app end ( permu tations ' ( size blend cream ) ) 25 ' ((( si ze blend ) cream ) 26 ( cream ( size blend ) ) 27 ( size ( blend cream ) ) 28 (( blen d cream ) size ) 29 (( size cream ) blend ) 30 ( blend ( size cream ) ) 31 (( size blend cream ) ) ) ) ) 32 (( "PE *" blend cream size ) ) 33 34 ; ; exampl e b: a d ialog sp ecification containing 35 ; ; an embedded, complete, m ixed − ini tiative sub − d i alog 36 > ( mine-expr ' (( PIN account transacti on amoun t ) ( PIN tran sactio n accoun t amount ) ) ) 37 (( "C " PIN ( " SPE ' " account transact ion ) amount ) ) Listing 3: Contin ua tion of trans cript of an in teractive session with the dialog miner in L is ting 2 illustr a ting how compresse d sp ecific a tions in this notation, based on concepts fro m pr ogra mming langua ges, including sp ecifications c and d in T able 1, ar e mined from enumerated specifica tions. 38 ; ; exampl e c: a d ialog sp eci fication containing an embedded, fixed sub − dialog, 39 ; ; or the uni on of t wo fixed di alog sp ecifications 40 > ( mine-expr ' (( receipt sandwi ch bevera ge din e-in / takeout ) 41 ( dine-in / takeout sandwich beverage receipt ) ) ) 42 (( "C " receipt sandwi ch bever age din e-in / takeou t ) 43 ( "C " dine-in / takeout sandwich beverage receipt ) ) 44 45 ; ; exampl e d: a d ialog sp ecification containing 46 ; ; tw o emb edded, complete, mi xed − initi ative sub − di alogs; 47 > ( mine-expr ' (( cream sugar eggs toast ) ( cream sugar toast eggs ) ( suga r cream eggs toast ) 48 ( sugar cream toast eggs ) ( eggs toast sugar cream ) ( eggs toast cream sugar ) 49 ( eggs toast ( crea m sugar ) ) ( toast eggs sugar cream ) ( toast eggs cream sugar ) 50 ( toast eggs ( crea m sugar ) ) (( cream sugar ) eggs toast ) 51 (( crea m sugar ) toast eggs ) 52 ( cream sugar ( eggs toast ) ) ( sugar cream ( eggs toast ) ) 53 (( crea m sugar ) ( eggs toast ) ) 54 (( eggs toast ) ( cream sugar ) ) (( eggs toast ) cream sugar ) 55 (( eggs toast ) sugar cream ) ) ) 56 (( "SPE ' " ( "PE * " cream sugar ) ( " PE *" eggs toast ) ) ) 57 58 ; ; a dialog specification as the union of three sub − expressions (a comp ound expression) 59 > ( mine-expr ' (( size blend cream ) ( size cream blend ) ( blend cream size ) 60 ( crea m blend size ) ( blend size cream ) ) ) 61 (( "C " ( " SPE ' " size blend ) cream ) 62 ( "C " size cream blend ) ( "C " ( "SPE ' " blend cream ) size ) ) 63 64 ; ; case demonstratin g the i n completeness of heu ristic 65 ; ; outp ut should b e ( `` SPE ' ” x ( `` C” y z )) 66 > ( mine-expr ' (( x y z ) ( y z x ) ) ) 67 (( "C " x y z ) ( " C" y z x ) ) 14 W e d esigned a recursiv e, heur istic-based algo rithm to address this pr oblem and implemen ted it in Scheme. Listings 2 and 3 pro vide a transcript of an interacti v e session with our dialog mining system. The input to the miner is an enumerate d dialog sp ecificatio n expressed as a list of episo des, where eac h episo de is also expressed as a list (e.g., see lines 24–31 of Listing 2). The output is a dialog sp ecification in th is n otation based on concepts fr om programming languages. The form of the output is a list of lists where eac h list in the output list represents an exp ression in th is notation (e.g., see line 32 of Listing 2 and lin es 42–43 of Listing 3). T h e c ar of eac h list in the output list is the numerator of the dialog sp ecification in th is n otation b ased on concepts fr om programming languages and th e cd r of it is the denominator. The n esting of eac h list in the output list reflects the nesting in the sp ecification of the dialog in this notation. F or instance, line 37 of Listing 2 represent s C PIN S P E ′ accoun t transaction amount . If the output list con tains more than one list (e.g., dialog c in T able 1 w hose compressed sp ecification is sho w n on lines 42–4 3 of Listing 3 ), the u nion of those lists sp ecifies the dialog. T he min er runs in DrR acket 7 (v ers ion 6.0) with the language set to ‘Determine language from source’. Our heur istic is sou n d in th at it alwa ys returns a sp ecification in this n otation that r epresent s the inp u t dialog (i.e., it nev er retur ns a wrong answer). Ho we v er, it is incomplete in that it d o es n ot alw ays retur n a minimal sp ecification, where a minimal sp ecification is one with a minimal num b er of union op erators. If it cannot mine a minim al sp ecification, it returns a u nion of the in put set of episo des, eac h represented as a sub-expression with a C in the n umerator. F or instance, line 67 of Listing 3 should disp lay only one expression (i.e., S P E ′ x C y z ), but sho ws a comp ound expression con taining tw o sub-expressions in stead (i.e., C x y z ∪ C y z x ). W e are p erforming an ev aluation of our heuristic to measure the fraction of dialog sp ecifications in th e u niv erse of p ossible unsolicited rep orting, mixed -in itiativ e dialogs U for whic h it is unable to fi nd a minimal s p ecification in this notation. W e can generalize this pr ob lem to one of find ing a m in im um set of p osets capturing the requ ire- men ts of a dialog from an enumerate d s p ecification of the dialog. F ormally , we state the problem as: input: A set of p osets P , all defined ov er the same set, where the union of the li near extensions from eac h poset in P is L . output: A m inimum set of p osets R s uch that | R | 6 | P | and the union of the linear extensions from eac h p oset of R is L . W e are currently wo rking on an np -complete pro of of th is problem using a redu ction to V ertex Co ver. While the d ialog mining part of this w ork is no less imp ortan t, here we fo cus on staging by partial ev aluation and stager generation b ecause it is the asp ect of this researc h most r elev ant to the automated soft w are engineering comm u nit y . 5.3 Stagers Note that the last ro w of T ables 1 and 3 only demonstrates ho w to stage dialogs conforming to eac h concept from p rogramming languages presented here. In this s ection, w e address h o w to implemen t s tagers with partial ev aluation f or dialogs that cannot b e sp ecified with a single concept (e.g., dialog b in T able 1) or with a n on-comp ound expression in this notatio n (e.g., d ialog c in T able 1 ). One metho d of imp lementing a complete, mixed-initiativ edialog is to en umerate all p ossible wa ys to complete the dialog as all p ossible con trol flows through the implementa tion. F or instance, consider dialog e in T able 1, whic h is a complete, m ixed -in itiativ e dialog. Enumerating all 7 http://rac ket- lang.org/ . 15 Listing 4: A stag er for complete, mix e d- initiative dialo gs (i.e., thos e in the P E ⋆ class), simplified for purp os es of presentation. ( define stager_ PE ∗ ( lambda ( scri pt ) ( if ( not ( nu ll ? script ) ) ( l et ∗ (( utteranc e ( prompt-fo r-input ) ) ( stat ic-inp ut ( mars hal-utt erance-into-a-set-of-parameter / value pairs ) ) ( speci alized -script ( mix scrip t static- input ) ) ) ( stager_P E ∗ specializ ed-script ) ) ) ) ) p ossible con trol flo w s through that d ialog in v olv es explicitly mo deling all of the thirteen separate totally ordered sets, one for eac h episo de in the sp ecificatio n. This approac h qu ic kly b ecomes unwie ldy ev en for d ialogs with only a few questions as we demonstrate b y capturing the n u m b er of episo des in an en umerated complete, mixed-initiativ e dialog sp ecification as a function of the questions p osed therein. Since an enumerated s p ecification of a complete, mixed-initiativ e d ialog con tains episo d es corresp onding to all p ossible p ermutations of all p ossible partitions of the set of questions in the dialog, w e defin e its size, |D cmi | , as the total function, N → N , equal to P q p =1 p ! × S ( q , p ) , whic h giv en q , the n umber of questions p osed in a dialog, compu tes the total num b er of episo des therein. Therefore, the n umber of episo des in a complete, mixed-initiativ e dialog sp ecification explo des com binatorially as the num b er of questions q in the d ialog increase. F or this reason, w e seek to obviate the need to extensionally hardco de all p ossible episo des in th e con trol fl o w of the imp lemen tation and , thus, impr o ve the control complexity of dialog imp lemen tation, by using partial ev aluation to int ensionally s upp ort those episo des. Consider th e stager giv en in Listin g 4. Th is stager, when passed the scrip t sh o w n in Fig. 2 do es not need to antici pate when the user is deviating from the only hardwired episo de in the script, b y virtue of p artial ev aluation. It do es not c heck that the ord er of utterances or n umber of the resp onses in an utterance conform to the d ialog sp ecification b ecause all orders and combinations are p ossib le. While complete, mixed-initiativ e dialogs can b e staged efficien tly using this approac h, such dialogs represen t only a small fraction of all p ossible dialogs (i.e., there is only one suc h dialog, giv en a fixed num b er of questions). Most d ialog sp ecifications conta in less episo d es th an those that can b e mo d eled by an expression in this notation with a P E ⋆ in th e n umerator. Indiscrimin ately partially ev aluating a script suc h as that sho wn in Fig. 2 to stage dialogs sp ecified b y only a C , as sh own in column (a) in T able 1, or S P E , as shown in column (h) of T able 3, r ealizes exc ess episo des (i.e., episo d es staged that are not in th e sp ecificatio n). On th e other hand , ap ply ing a script such as that sho wn in Fig. 2 to s tage a d ialog conforming to the P E ⋆ concept incurs deficit (i.e., some of the episo des in the sp ecification are not staged). Using a curried script to stage a dialog sp ecified b y S P E yields excess and d eficit. Thus, while partial ev aluation subsu mes all other language concepts considered here, partial ev aluation is an ‘all or nothing’ prop osition [17]. It do es n ot d iscriminate against an y of the p ossib le partial assignmen ts of input parameters to the function (i.e., scr ip t) b eing partially ev aluated; the script can b e partially ev aluated with resp ect to any parameter orders or com b inations. “F or a d ialog script parameterized [b y] slot [parameters], partial ev aluation can b e used to su p p ort all v alid p ossibilities for mixing initiativ e, but it cannot restrict the scop e of m ixing in itiativ e in any w a y . I n particular th is means that, un lik e interpretation [or curryin g], partial ev aluation cannot en f orce an y individual [episo de]” [17]. Th us, to b e faithful to a sp ecification, we r equire a control ler to inv oke partial ev aluation judiciously w ith resp ect to th e different orders and com b inations of arguments that reflect the p ermissib le episo des or requ ir emen ts of a d ialog. W e call this con troller a stager b ecause it stages the in teraction required to complete a dialog. S p ecifically , a stager must restrict the w a y s in whic h 16 partial ev aluation is applied to a script in all dialogs except complete, mixed-initiativ e d ialogs (i.e., those conforming to the P E ⋆ concept). Since staging complete, m ixed-initiativ e dialogs in this m o del do es not require v erification of the order and size of utterances, the ob jectiv e of the dialog miner is to id en tify as m uc h of the input dialog as p ossible that can b e sp ecified through the P E ⋆ concept. In other words, it needs to iden tify as m uc h of the dialog as p ossible that can b e hand led by partial ev aluation. This pr o cess has b een referred to as layering [17]. Moreo v er, the ob jectiv e of rewrite r u les is n ot to redu ce a complex d ialog to one expressed only through the prim itive concepts I or C . On the cont rary , r ather w e d esire to express as m u c h of the d ialog as p ossible thr ough the P E ⋆ concept to similarly imp ro v e the imp lemen tation. F or instance, it is adv an tageous to express the sp ecification {≺ a b ≻ , ≺ b a ≻ , ≺ (a b) ≻} as P E ⋆ a b rather than C a b ∪ C b a ∪ I a b . F urthermore, to tak e adv anta ge of all p ossible opp ortu nities to use partial ev aluation, rewrite rules can b e applied not only to the original, p ristine, script for a dialog, bu t also to the tr an s formed, reduced script r emaining after every utterance. F or instance, [ [ mix ] ][ S P E ′ P E a b P E c d , d = . . . ] = S P E ′ P E c P E a b = S P E ′ C c P E a b = C c P E a b , and [ [ mix ] ] [ C c P E a b , c = . . . ] = C P E a b = P E a b . This can b e thought of as rela yering after ev ery utterance. Unlik e Figs. 2 and 3, wh ere the script to b e partial ev aluated is the first argument to [ [ mix ] ], here, for pu rp oses of conserving sp ace, we us e a sp ecificatio n of the dialog in this notation based on concepts fr om programming languages to represent the scrip t to b e partially ev aluated. 5.4 Ev aluation One metho d of quantifying con trol complexit y or, more sp ecifically , an ticipation of p ermissible orders and forms of utterances, is to coun t the n umber of sub-expressions in a dialog sp ecified using th is notation based on concepts f rom programming languages that its stager must su p- p ort. In other w ords, the num b er of su b-expressions r equired to capture th e requirements of a dialog is an ev aluation metric for the complexit y of its stager. A complete, mixed-initiativ e di- alog can b e captured b y one exp r ession. If w e r emo ve only one of the th irteen episo d es fr om the P E ⋆ size blend cream complete, mixed -in itiativ e dialog, its requirement s can n o longer b e captur ed b y only one expression. F or instance, a dialog where the ≺ (size blend cream) ≻ episo de is absen t from the P E ⋆ size blend cream sp ecification cannot b e represente d with less than five su b -expressions (i.e., S P E ′ size blend cream ∪ S P E size blend cream ∪ C I size blend cream ∪ C I blend cre am size ∪ C I size c ream blend ) . Therefore, in th is mo d el, a s tager for the prior dialog is less complex in th e con trol than one for th e latter. While P E ⋆ size blend cream repre- sen ts one p oset, n ote that there is not a one-to -one corr esp ondence b et ween p osets and expressions in this notatio n, based on concepts from programming languages, that capture the requiremen ts of a dialog. F or instance, while the previous d ialog cannot b e repr esented with a union of less than fiv e sub -expr essions in this notation, it can b e represente d by one p oset. When the sp ecification for the dialog b eing staged cannot b e captured by a single exp ression (e.g., sp ecifications c T able 1 and C size S P E blend cre am ∪ C blend S P E cream size ∪ C cream blend size ) we currently require one stager p er expression. Then a decision, b ased on the user’s fi rst utterance, is r equired, if p ossible, to d etermin e whic h stager to in v ok e. Staging dialogs in the ∆ class that in v olv e sub-dialogs r equires additional consideration. A stager for eac h of these dialogs not only n eeds to control how partial ev aluation is inv ok ed to supp ort the in dividual concepts, b ut also needs to co ordinate the ord er in whic h it jump s into and return s fr om su b-dialogs. 5.5 Practical Considerations W e made a f ew practical considerations in our system imp lemen tation. F or in stance, since we are only using the constant pr opagation capabilit y of partial ev aluation, we imp lemen ted our o wn 17 Listing 5: Gener alized stager algorithm simplified for purp oses of presentation. ( genera te-pri stine-sub-scripts-from-expressions ) ( let ∗ (( origi n-scri pt ( file- > list scrip t-file- name ) ) ( origin-c ounter 1) ( loop-key ( call / cc ( lambda ( k ) ( list k orig in-scr ipt origin-co unter ) ) ) ) ( l o op ( car loo p-key ) ) ( script ( cadr loop-key ) ) ( counte r ( caddr loop-key ) ) ) ( promp t-for- input ) ( if ( valid- input ?) ( let (( new-scrip t ( pa rtially -eval-script-with-utterance ) ) ) ( if ( co mplete- evaluation ?) ( e v al new-sc ript ) ( k ( list k new-scrip t counter +1)))) ( k ( list k script coun ter ) ) ) ) ; i nv alid input packaged as a set of to [[mix]] against parameter−value pairs store specialized script user user utterance utterance retrieve script from database retrieved script is program to [[mix]] ... ... ... dialog sub−script dialog sub−script (lambda (p q) (if (eqv? p ...) (if (eqv? q ...) (retrieve item)))) (lambda (a b c) (if (eqv? a ...) (if (eqv? b ...) (if (eqv? c ...) (retrieve item))))) Racket 2 1 4 Dialog Stager 3 interpreter propagation) (constant Evaluator Partial Script Database Figure 5: Stager sy stem des ign and execution. Num be r s indicate flow o f progress ion and this prog ression rep eats un til the dialog is complete. language pro cessing f unction that pr opagates the supplied arguments throughout the b o d y of a script, r ather than using an off-the-shelf partial ev aluator. W e also capture fir st-class con tinuations through the call/cc facilit y in Sc heme to restart a stager after eac h progressiv e p artial ev aluation. W e generate a lo op key , whic h cont ains a contin uation, a script, and an occurr ence coun ter, w ith the initial, pristine script. A stager then pr ompts for and accepts an utterance f rom th e user, v alidates the resp onses in the utterance an d , if v alid, marshals it in to a set of parameter-v alue pairs, and partially ev aluates a script with that set of static parameter assignments. Finally , the stager generates a n ew loop key with the sp ecialized script and uses the con tinuatio n to jump bac k to the b eginning of the stager. The generalized stager algorithm shown in Listing 5 illustrates this pro cess. W e also incorp orate a history-records ob ject, wh ic h s tores the lo op k ey of eac h stage, to supp ort re do and undo op erations. The functional p aradigm of programming enabled us to su pp ort these finer touc h es in a simple and clean manner. 5.6 Stager Generation F rom an expression, in notation based on concepts from programming languages, output b y th e di- alog min er, w e automatically generate a stager to realize and execute the dialog (see transition from the cen ter to the righ t of Fig. 1). Since Sc heme is a homoiconic language, it is su itable for generating a stager in Sc heme. Giv en a dialog sp ecified in the notation, b ased on concepts from programming languages, pr esen ted h ere, it automatically generates a stager, and the necessary scripts. The size 18 of the stager it generates is dep endent on the complexity of the dialog to b e stage d. Th e generated stagers must b e executed with DrR acket (v ers ion 6.0) w ith the language set to ‘Determine language from sou r ce’. Fig. 5 pro vides an o verview of the execution of the stagers we generate (i.e., the righ t- most side of Fig. 1). Our dialog m o deling to olkit, including the dialog miner and stager generator, is av ailable at http://a cademic .udayton .edu/SaverioPerugini/dialogtoolkit.zip . 6 Discussion The adv ent and increased use of virtual, im m ersiv e en vir onmen ts in cyb erlearning [4 ], gaming, and smart p hones app s pr ovides a new landscap e and opp ortun it y to r esearch mo dels for designing and implemen ting fl exible human-co mpu ter dialogs. C y b erlearning activities and apps wh ose success relies on flexible, mixed-initiativ e dialog can b enefit fr om a mo del for designing and implement - ing dialogs in a more systematic and simplified w a y . Our pr o ject is p articularly worth wh ile and applicable in the con text of imp ro ving the implemen tation of dialogs in these cyb erlearning en- vironmen ts b ecause through a mixed-initiativ e m otif, our researc h supp orts and f osters enh anced teac her-student collab oration b y blurr ing the b ou n daries b etw een teac her and stud en t. Moreo ver, our mo d el for mixed-initiativ e in teration has the p oten tial to b e w idely adopted d ue to the gro win g n umber of cyb erlearning app lications [4] and smart p hone apps and users of these s y s tems. T hus, while th is researc h pro ject tak es a n on -traditional appr oac h to dialog mo deling and implementati on, w e are optimistic that it can ha ve an imp act on rh e softw are deve lopmen t pr o cess for virtual/cyb er- learning en vir onmen ts, gaming, and smart phone apps, where flexibilit y in human-computer dialog is imp ortan t. Prior researc h p ro jects h a ve appr oac hed in telligen t information system design fr om the p er- sp ectiv e of (functional) programming languages [6, 11, 15, 16]. Ho wev er, only a few researc h pro jects h a ve sought to marry human-computer dialogs with concepts from pr ogramming lan- guages [3 , 11, 13, 17]. Due to the conceptual metaphors b et we en natur al languages and program- ming languages, viewing human-computer dialog mo deling and imp lemen tation fr om the p ers p ec- tiv e of programming languages su ggests a natural, yet under-explored, approac h to dialog repre- sen tation and reasoning. Thus, w e also exp ect our w ork to generate discussion in the automated soft ware engineering comm unity . 6.1 Con t ributions W e mo dified an d impro ved a mo d el for sp ecifying and staging m ixed -in itiativ e dialogs [3, 12, 17]. The primary theme of this app r oac h is to id en tify as many em b edded complete, mixed-initiativ e sub-dialogs in a sp ecification since they can b e adv an tageously handled by partial ev aluation. I d en- tifying these sub -dialogs p ermits one to plan f or only one episo d e in a script and j u diciously apply partial ev aluation to it to realize all p ossible v ariations of that episo de. Th is n on-traditional use of p artial ev aluation helps meet the sp ecificatio n of a d ialog w ithout having to exp licitly hardco d e all s u pp orted episo des into the cont rol fl o w of the implemen tation. W e generalized the activit y of automatica lly building a stager and generate stagers for a v ariety of unsolicited rep orting, mixed- initiativ e dialogs. While “[c]reating an actual dialog system inv olv es a v ery in tensiv e programming effort” [8], our to olkit automates the construction of a stager from a s p ecification of a mixed- initiativ e dialog in our notation. Three dialog mo dels, namely transition netw orks, conte xt-free grammars, and ev en ts, ha ve b een id en tified in [7]. W e feel that we are at a v anguard of a fourth dialog mo del. W e hav e extended [3, 12 , 17] in multiple wa ys. W e su mmarize our contributions as: w e 19 • recognize the need to su p p ort m ultiple orders of r esp onses indep endent of m ultiple resp onses p er utterance and to bring more str u cture to the space of unsolicited r ep orted, mixed-initiativ e dialogs. T o d o so w e enric hed and augmented a notation, based on concepts from programming languages, for sp ecifying d ialogs by adding and mo difying concepts and their mnemonics; • introdu ce a dialog mining comp onen t, including the la y ering essentia l to, and deemed critical in [17 ] for, implemen ting dialogs con taining n ested su b-dialogs. Ramakrishnan, Capra, and P ´ erez-Qui ˜ nones note that d ev eloping an initial, optimal r epresen tation of a dialog is an op en researc h issue in [17]: An inte resting researc h iss ue is: [g]iv en (i) a set of in teraction sequen ces [(referred to as episo des here)], and (ii) addressab le information (suc h as arguments and slot v ariables), d etermine (iii) the s mallest p rogram so that eve ry inte raction sequence can b e staged . . . . [T]his r equires algorithms to automatically decomp ose and ‘la yer’ inte raction sequences in to those that are b est add ressed [by an] interpreter and those that can b enefit f rom representat ion and sp ecializat ion by [a] partial ev aluator [17]. Our dialog miner addr esses this issu e. • automatically generate stagers for a v ariet y of un solicited rep orting, mixed -in itiativ e d ialogs, including those inv olving su b-dialogs; • encompassed all of ab o ve in a free, downloadable dialog mo deling to olkit. 6.2 F uture W ork W e inte nd to wid en th e scop e of the un solicited rep orting, mixed-initiativ e dialogs th at can b e accommodated (i.e., sp ecified and staged) in this m o del. F or instance, we in tend to enhance our mining and la yering algorithms so that we can r ecognize and stage dialogs, in volving m ore than one su b-dialog, sp ecified with an S P E ′ in the numerator suc h as dialog d in T able 1. Since Sc heme supp orts first-class and higher-order functions, we in tend to explore partially ev aluating scripts that, un lik e that sh o w n in Fig. 2, accept fu nctions repr esenting scripts for sub-dialogs as parameters rather than individual resp onses. Moreo v er, we are w orking on algorithms to deal w ith dialogs wh ere the episo des ther ein cannot b e r epresent ed b y a single p oset (e.g., dialog c in T able 1). W e ha v e iden tified sp ecific examples wh ere a dialog cann ot b e sp ecified with less than y p osets, yet can b e staged usin g x scripts, wh ere x < y . W e in tend to study su c h cases for insight into solving this problem in general. Bey ond these issues, we in tend to lift additional restrictions on the space of unsolicited r ep orting, mixed-initiativ e dialogs to further expand the space of dialogs on w hic h w e w ork. F or example, not all d ialogs ha v e a consisten t num b er of questions across all episo des. More generally , some d ialogs ha v e dep end en cies b et ween resp onses as id entified in [14], in a slight ly different conte xt. In the dialogs we ha ve present ed in this article, d ue to domain seman tics, the an s w ers to the questions p osed are completely indep endent of eac h other. In other words, an y answer to an y question d o es not disqualify any of the answ ers to any of the other questions. Ho wev er, in other d omains su c h complete indep endence ma y not exist. F or example, the 2014 Honda Civic Hybrid is n ot a v ailable with a man ual transmission and , therefore, there is no need to prompt for transmission t yp e once Honda and Civic Hybrid are sp ecified for mak e and mo d el, resp ectiv ely . Therefore, we m u st stud y ho w to programmatically repr esen t d ep enden cies b et ween the resp onses in a dialog. W e plan to 20 explore a v ariety of options to d eal with dep endencies. In co vering a richer assortment of un solicited rep orting, mixed-initiativ e dialogs, we intend to evolv e the d ialog notation into a domain-sp ecific language, and the to olkit into a dialog protot yping to ol, whic h dialog designers can use to explore and test a v ariet y of un solicited r ep orting, mixed-initiativ e d ialogs. Nonetheless, comm unicating indep endent resp onses in a v ariet y of ord er s and com binations are practical asp ects of common d ialogs, as d emonstrated in T able 2. Thus, w e feel this app r oac h and pro ject is wo rthwhile and p oten tially applicable in the conte xt of impro ving the implementa tion of dialogs within smart ph one apps. W e feel th at b oth the ph ilosophical and conceptual connections b et we en natural and pr ogramming languages [18] su ggest that ad d itional concepts from program- ming languages, suc h as reflection and fi rst-class con tin uations, may fin d a place in th is m o del. Dialog is essen tial to pro viding a ric h form of h uman-computer interact ion. This pro ject seeks to establish a sound and well-e v aluated compu tational mo del for mixed-initiativ e dialog. W e en visage the long-term practical significance and broader imp acts of this w ork inv olving the incorp oration of stagers based on partial ev aluation and r ewrite ru les int o cyb erlearning en vironments, smart phones, airp ort kiosks, itm mac hines, and inte ractiv e, v oice-resp onses s ystems, since the ubiqu it y of these platforms in service-orien ted d omains, s u c h as edu cation, h ealth care, bankin g, and tra v el pro vide a fertile lands cap e for the u se of our mo del for mixed-initiativ e in teration. Ac kn o wledgmen ts The researc h was supp orted in part b y grants from the Ohio Board of Regen ts and s upp ort from the Univ ersit y of Da yton College of Arts and Sciences. W e thank John Cresencia, Shuangy ang Y ang, and Brandon Williams at the Un iv ersit y of Da yton for assisting in the implementa tion of the dialog mo deling to olkit, and for helpful discussions and in s igh t. References [1] J.F. Allen. Mixed-initiativ e interact ion. IEE E Intel ligent Systems , 14(5):14–16 , 1999. [2] F. Baader and T. Nipko w. T e rm R ewriting and Al l That . C am bridge Univ ersit y P r ess, Cam- bridge, UK, 1999. [3] R. Capra, M. Nara y an, S. Perugini, N. Ramakrishnan, and M.A. P ´ erez-Qui ˜ nones. The staging transformation approac h to mixing initiativ e. In G. T ecuci, editor, Working Notes of the IJCAI 2003 W orkshop on Mixe d-Initiative Intel lige nt Systems , pages 23–2 9, Menlo P ark, CA, 2003. AAAI/MIT Press. [4] A. Dubro w. Sev en cyb erlearnin g tec hnologies tr ansform- ing education. Huffington Post , 6 April 2015. Av ailable: http://w ww.huffi ngtonpost.com/aaron- dubrow/7- cyberlearning- technolog_b_6988976.html [Last accessed: 18 Nov em b er 2015]. [5] D.P . F r iedman and M. W and. E ssentials of Pr o gr amming L anguages . MIT Press, Cambridge, MA, third ed ition, 2008. [6] P . Graun k e, R. Findler, S . Krishnamurthi, and M. F elleisen. Automatically r estru cturing programs for the w eb. In P r o c e e dings of the Sixte enth IE EE International Confer enc e on Autom ate d Softwar e Engine ering (ASE) , p ages 211–2 22, 2001. 21 [7] M. Green. A Sur v ey of Thr ee Dialogue Mo dels. ACM T r ansactions on Gr aphics , 5(3):244–2 75, July 1986. [8] C.I. Gu in n. Ev aluating m ixed-initiativ e dialog. IEEE Intel lige nt Systems , 14(5):2 1–23, 1999. [9] N.D. Jones. An Introdu ction to P artial Ev aluation. ACM Computing Surveys , 28(3):4 80–503, Septem b er 1996. [10] Y.D. Liu, C . Sk alk a, and S.F. S mith. T yp e-sp ecialize d Staged Programming with Pro cess Separation. Higher-Or der and Symb olic Computation , pages 1–45, S eptem b er 2012. [11] S .N. Malk o v. C ustomizing a F un ctional Programming Language for W eb Dev elopmen t. Com- puter L anguages, Systems and Structur es , 36(4):34 5–351, 2010. [12] M. Nara y an , C. Williams, S. Perugini, and N. Ramakrishn an . Staging trans formations for m ultimo dal web in teraction m anagemen t. In M. Na jork and C.E. Wills, editors, Pr o c e e dings of the Thirte enth International ACM World Wide Web Confer enc e (WWW) , p ages 212–223 , New Y ork, NY, 2004. A C M Press. [13] M.A. P´ e rez-Qui ˜ nones. Conversational Col lab or ation in User-initiate d Interruption and Can- c el lation R e quests . Ph.D. d issertation, The George W ashin gton Univ ersit y , 1996 . [14] S . P erugini and N. Ramakrish nan. Mining web fun ctional d ep end encies for flexible in formation access. Journal of the Am eric an So ciety for Information Scienc e and T e chnolo gy (J A SIST) , 58(12 ):1805–1 819, 2007. [15] D. Quan, D. Huyn h, D.R. Karger, and R. Miller. User Interface Con tin uations. In Pr o c e e dings of the Sixte enth Annual ACM Symp osium on User Interfac e Softwar e and T e chnolo gy (U IST) , pages 145–14 8, New Y ork, NY, No v em b er 2003. A CM Press. [16] C . Queinnec. T he influ en ce of bro wsers on ev aluators or, contin uations to program web serve rs. In Pr o c e e dings of the Fifth ACM SIGPLAN International Confer enc e on F unctional Pr o gr am- ming (ICFP) , p ages 23–33, New Y ork, NY, 2000. ACM Press. Also app ears in ACM SIGPLAN Notic es , 35(9), 2000. [17] N. Ramakrishnan, R. C apra, an d M.A. P ´ erez-Qui ˜ nones. Mixed-In itiativ e In teraction = Mixed Computation. In P . Thiemann , ed itor, P r o c e e dings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Base d Pr o gr am Manipulation (PE PM) , pages 119–130, New Y ork, NY, 2002. ACM Pr ess. Also app ears in ACM SIGPLAN Notic es , 37(3), 2002. [18] C -C. Shan. Lin gu istic S ide Effects. I n C. Bark er and P . Jacobson, editors, Dir e ct Comp osi- tionality , pages 132–16 3. Oxf ord Universit y Press, 2007. 22

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment