Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Compositional Creativity (ICFP 2017)

Chris
September 04, 2017

Compositional Creativity (ICFP 2017)

Chris

September 04, 2017
Tweet

More Decks by Chris

Other Decks in Research

Transcript

  1. ICFP 2017, Oxford, UK Compositional Creativity Chris Martens Assistant Professor

    Computer Science Department North Carolina State University
  2. About Me Assistant Professor (UK equiv.: Lecturer) at NCSU Postdoc

    UC Santa Cruz, Expressive Intelligence Studio PhD CMU 2015, POP group 2
  3. About Me Conferences I used to go to had words

    like: functional, types, logic, deduction, languages 3 Conferences I go to now have words like: artificial intelligence, narrative, interactive storytelling, games, play
  4. My Lab Conferences I used to go to had words

    like: functional, types, logic, deduction, languages 4 Conferences I go to now have words like: artificial intelligence, narrative, interactive storytelling, games, play
  5. Research Mission Use principles from logic and formal methods to

    enable more expressive human-computer collaboration 5
  6. Unifying themes: logic ❖ Logic as an intermediate language between

    human and computational thought ❖ Reasoning about synthesized behavior 8
  7. Unifying themes: social reasoning ❖ Simulating social agents ❖ Designing

    languages and other human-computer interfaces through a metaphor of conversation 9
  8. This talk From classical AI to modern FP Plots as

    plans as proofs Intentional reasoning Epistemic reasoning 10
  9. From classical AI to modern FP From classical AI to

    modern FP Plots as plans as proofs Intentional reasoning Epistemic reasoning 11
  10. Influence on AI First system to codify 
 reasoning as

    search Presented at McCarthy’s AI-defining Dartmouth Research Project, Summer 1956 AI historian Pamela McCormick: “proof positive that a machine could perform tasks heretofore considered intelligent, creative and uniquely human” 13
  11. Influence on FP To build LTM, they implemented a new

    language called IPL Influenced McCarthy’s design of LISP Use of lists rather than arrays Hierarchical subroutines and recursion 14
  12. Reasoning as Search: 3 examples * Theorem proving * Program

    synthesis * AI planning 21 Conor McBride (since at least 2013): Type inference is so last century! Let’s write more detailed types, do program inference!
  13. (Type-based) Program Synthesis Γ ⊢A :A let rec reverse l

    = case l of nil => … | cons x::xs => … Osera and Pierce - “Type-and-example-directed program synthesis,” POPL 2015; Polikarpova et al., “Program synthesis from polymorphic refinement types,” POPL 2016 23 Composition of program constructs
  14. AI Behavior Synthesis (Planning) Γ ⊢A 25 Initial State Goal

    state Atomic operators that can change the state
  15. AI Behavior Synthesis (Planning) Γ ⊢A move a1 a2 pickup

    block1 move a2 b2 place block1 : { at(bot, a1), at(block1, a2)} —-> {at(bot, b2), at(block1, b2)} 26 Plan (sequence of operations)
  16. Plots as plans as proofs From classical AI to modern

    FP Plots as plans as proofs Intentional reasoning Epistemic reasoning 28
  17. AI Planning Domain - sets of operators (parameterized actions) Problem

    - initial and goal configuration —PLANNER—> plan, i.e.
 sequence of operators applied to terms to reach goal from initial 29
  18. AI Planning Domains PDDL/STRIPS - domain specific langs. for planners

    Actions defined in terms of of preconditions and effects Preconditions, effects, configurations, are collections of logical predicates 30
  19. Story Generation Planning for Plot Generation
 (Young 1999; Cavazza and

    Charles 2001-2) Linear Logic Programming for Plot Generation
 (Martens, Ferreira, Bosser, Cavazza 2013) 31
  20. Story Configurations initial: { dead(jon_arryn, hand),
 role(robert_baratheon, king),
 heir(robert_baratheon, joffrey),


    allies(robert_baratheon, eddard_stark),
 role(eddard_stark, warden_of_north) } sets of atomic propositions describing the world (Game-of-Thrones-inspired example) 32 ! " ❄ (
  21. Story Operators narrative events, e.g. ways characters can bid for

    power name_hand(Ruler, NewHand) :
 preconditions: need_filled(hand),
 role(Ruler, ruler_of_westeros),
 allies(Ruler, NewHand) effects: offered_role(NewHand, hand)
 delete need_filled(hand) 33
  22. Story Operators As a linear logic formula: name_hand(Ruler, NewHand) :

    need_filled(hand) *
 has_role(Ruler, ruler_of_westeros) *
 allies(Ruler, NewHand) -o offered_role(NewHand, hand) *
 has_role(Ruler, ruler_of_westeros) *
 allies(Ruler, NewHand) 34
  23. 36 " names ! " ! ❄ " ! (

    " " " ! ! Compositional notation for plots
  24. ! observes ( 37 " names ! " ! ❄

    " ! " " ! ( " ! … Compositional notation for plots
  25. ! observes ( 38 " names ! " ! ❄

    " ! " " ! ( " ! … … … Compositional notation for plots
  26. SEASON 1
 EPISODE 2 39 " ! ❄ " !

    ( " … … … Compositional notation for plots
  27. SEASON 1
 EPISODE 2 40 " ! ❄ " !

    ( " … … … Compositional notation for plots c.f. symmetric monoidal categories
  28. Planners & theorem provers find the most efficient solution 


    
 : Exists C. has_role(C, ruler_of_westeros) 44 Narrative variation?
  29. Planners & theorem provers find the most efficient solution has_role(rb,

    ruler_of_westeros) |- 
 
 : Exists C. has_role(C, ruler_of_westeros) 45 Narrative variation?
  30. Planners & theorem provers find the most efficient solution has_role(rb,

    ruler_of_westeros) |- 
 
 “The end.” : Exists C. has_role(C, ruler_of_westeros) 46 Narrative variation?
  31. Planners & theorem provers find the most efficient solution has_role(rb,

    ruler_of_westeros) |- 
 
 “The end.” : Exists C. has_role(C, ruler_of_westeros) Stories are anti-efficient! 47 Narrative variation?
  32. A Partial Solution: Nondeterministic Proof Construction Linear logic for story

    generation: Martens et al. 2013 (LPNMR) Use forward chaining nondeterminism to leave goals unspecified,
 randomly explore the search space 48 Sacrifice completeness of search for variation in outcome
  33. Another Limitation Stories generate interest e.g. through characters with conflicting

    goals Subterfuge, betrayal, suspense, etc. all depend on characters acting on goals with limited knowledge 49
  34. Adding constraints Program synthesis:
 Refining types with input-output examples (test

    cases)
 
 51 f : int -> nat
 | f 1 => 1
 f 2 => 4
 f 5 => 25
  35. Intentional reasoning From classical AI to modern FP Plots as

    plans as proofs Intentional reasoning Epistemic reasoning 53
  36. Game AI: from opponents to cooperators Computer opponents (e.g. Chess,

    Go):
 moves need not be intelligible to human Computer cooperators:
 need to move in a legible, intentional-seeming way 54
  37. Grice's Maxims of Conversation ❖ Quantity - say neither too

    much nor too little ❖ Quality - tell the truth ❖ Relation - what is said should be relevant to the topic/stated intentions ❖ Manner - avoid obscurity and ambiguity 55 (Paul Grice, “Logic and Conversation,” 1975)
  38. Hanabi Your hand is visible only to others Your shared

    goal is to build sequentially- ordered stacks of like- color cards 56
  39. Computational cooperation in Hanabi ❖ Model the player’s knowledge, including

    their model of our knowledge ❖ Give hints to human players that will be recognized as intentional: point out cards when unambiguous whether to play or discard
 
 59
  40. Computational cooperation in Hanabi ❖ Model the player’s knowledge, including

    their model of our knowledge ❖ Give hints to human players that will be recognized as intentional: point out cards when unambiguous whether to play or discard
 
 60 }“Intentional”
 model
  41. Computational cooperation in Hanabi ❖ Model the player’s knowledge, including

    their model of our knowledge ❖ Give hints to human players that will be recognized as intentional: point out cards when unambiguous whether to play or discard ❖ Interpret hints from human players as carrying the same intent; play or discard appropriately 61 }“Intentional”
 model { “Full”
 model
  42. Computational Intelligence in Games (CIG) 2017 3 implementations (base, intentional,

    full) + experimental evaluation 1. Simulation of computer:computer 2. Human subjects study, human:computer 62
  43. Computational Intelligence in Games (CIG) 2017 64 Players rated more

    intentional agents both more enjoyable and more intentional-seeming
  44. Grice's Maxims of Conversation Quantity - say neither too much

    nor too little ❖ Enforced by game rules 65
  45. Grice's Maxims of Conversation Relation - be relevant ❖ Only

    give hints that can be interpreted as play/discard instructions 67
  46. Grice's Maxims of Conversation Manner - avoid ambiguity ❖ Only

    hint sets of cards for which the actionable subset is unambiguous 68
  47. Intentionality depends on Belief Transition from ad-hoc encoding of knowledge

    to formal Describe how beliefs influence actions and vice versa 70
  48. Epistemic reasoning From classical AI to modern FP Plots as

    plans as proofs Intentional reasoning Epistemic reasoning 71
  49. Theory of Mind Forming mental models of other people’s mental

    models A key form of social reasoning in humans 73
  50. 3 Logicians Walk into a Pub 76 Will everyone have

    a beer? I don’t knowI don’t know
  51. 3 Logicians Walk into a Pub 77 Will everyone have

    a beer? I don’t knowI don’t know Yes!
  52. Agent a believes A
 A holds under action α Dynamic

    Epistemic Logic ☐a A
 [α]A 80 Actions may change the 
 actual world or the
 set of worlds an agent considers possible
  53. Epistemic Actions (Baltag 2002) α, β ::= flip p 


    | ?A 
 | α + β 
 | α ; β 
 Change truth value
 Precondition
 Nondeterministic choice
 Sequence
 81
  54. Epistemic Actions (Baltag 2002) α, β ::= flip p 


    | ?A 
 | α + β 
 | α ; β 
 | αa 
 | α* Change truth value
 Precondition
 Nondeterministic choice
 Sequence
 Appearance to a
 Public action 82
  55. –Petyr Baelish “Fight every battle everywhere, always, in your mind.

    Everyone is your enemy, everyone is your friend. Every possible series of events is happening all at once. Live that way and nothing will surprise you. Everything that happens will be something that you’ve seen before.” 92
  56. A tiny example Alice flips a coin in secret;
 Bob

    and Carol observe 93 coin(heads)Alice + coin(tails)Alice; 
 (coin(heads) + coin(tails)){Bob, Carol}
  57. Ostari - Eger & Martens 2017 Parameterized actions
 Parameters can

    be secret to specific sets of agents 95 ⟨action⟩ ::= ⟨identifier⟩(⟨params⟩) <cmd>
  58. Ostari - Eger & Martens 2017 <cmd> ::=
 <property> :=

    <value>
 | learn <agents> <fact>
 | public <cmd>
 | <cmd> ; <cmd> 96 ⟨action⟩ ::= ⟨identifier⟩(⟨params⟩) <cmd>
  59. Ostari - Eger & Martens 2017 <cmd> ::=
 <property> :=

    <value>
 | learn <agents> <fact>
 | public <cmd>
 | <cmd> ; <cmd> 97 ⟨action⟩ ::= ⟨identifier⟩(⟨params⟩) <cmd>
  60. Ostari - Eger & Martens 2017 <cmd> ::=
 <property> :=

    <value>
 | learn <agents> <fact>
 | public <cmd>
 | <cmd> ; <cmd> <fact> ::=
 exists x.<cond>
 | all x.<cond>
 | each x.<cond>
 | which x.<cond> 98 ⟨action⟩ ::= ⟨identifier⟩(⟨params⟩) <cmd>
  61. Ostari - Eger & Martens 2017 <cmd> ::=
 <property> :=

    <value>
 | learn <agents> <fact>
 | public <cmd>
 | <cmd> ; <cmd> <fact> ::=
 exists x.<cond>
 | all x.<cond>
 | each x.<cond>
 | which x.<cond> 99 ⟨action⟩ ::= ⟨identifier⟩(⟨params⟩) <cmd>
  62. Example 102 hintcolor(p: Players, c: Colors) learn (p): Each i

    in HandIndex: color(at(p, i)) == c Hinting a color in Hanabi
  63. Implementation in Haskell
 (laziness useful for possible worlds representation!) Sequences

    of actions and queries Goals that generate action sequences Ostari - Eger & Martens 2017 103
  64. Epistemic Narrative Generation WorldA:
 at(Sherlock) = BakerStreet
 looks like (Sherlock):

    WorldA
 looks like (Moriarty): WorldA, WorldB WorldB:
 at(Sherlock) = ScotlandYard
 looks like (Sherlock): WorldB
 looks like (Moriarty): WorldA, WorldB 104
  65. Epistemic Narrative Generation Generates a story in which Moriarty frames

    someone for murder goal: 
 murdered(Moriarty, Victim) ^
 ☐(Moriarty): ☐(Sherlock): exists M. 
 M != Moriarty ^ murdered(M, Victim) 106
  66. Summary 3 investigations into using logic for creativity: 1. Generating

    narrative with planning/linear logic 2. Intentional reasoning in the context of cooperation 3. Codifying intentionality with Epistemic Logic 107
  67. From modern FP to future AI From classical AI to

    modern FP Plots as plans as proofs Epistemic reasoning Intentional reasoning From modern FP to future AI 108
  68. Why Games and Stories? Logic is a great intermediate language

    between humans and machines, but insufficient Humans have been communicating through play and storytelling for even longer than they have been doing logic The best abstractions are discovered in diverse disciplines! 119