Skip to content

Implement Interactive Boolean Minimization for Query Relevance Reduction #638

@mengwong

Description

@mengwong

Motivation

Suppose we have a simple rule, like:

DECIDE `one may purchase alcohol` IF
            you are of 21 years of age
       AND     you are unmarried
            OR your spouse has given approval
            OR you're only buying beer, nothing harder
  OR        you are below 21 years of age
       AND  your parent has given approval
            OR you are legally emancipated

Naively the decision function asks for a whole load of input parameters:

  • age
  • marital status
  • spousal approval
  • beverage type
  • parental approval
  • legally emancipated

Intuition

The BDD splits early on the age thing, so that if we are 25 years old, then parental approval and legally emancipated drop out, and are labeled Don't Care terms. The remaining next relevant questions have to do with marital status and beverage type.

Interactive API for Partial Evaluation and Decision Reduction

We need a convention by which the user can trigger partial evaluation: given some inputs, we return the residual decision function. Or at least the set of next most relevant upcoming terms.

Example 1

sequenceDiagram
    Client->>Chatbot: So I want to know if I can buy booze in Atlantis.
    Chatbot->>Reasoner: purchase_alcohol(  )
    Reasoner->>Chatbot: require( [ age ] )
    Chatbot->>Client: It depends. How old are you?
    Client->>Chatbot: Thirty
    Chatbot->>Reasoner: purchase_alcohol( age=30 )
    Reasoner->>Chatbot: require( [ marital_status, beverage_type ])
    Chatbot->>Client: Gotcha. It still depends. What kind of booze are you buying? And does your wife know you're here?
    Client->>Chatbot: I'm buying wine. But I'm not married!
    Chatbot->>Reasoner: purchase_alcohol( age=30, beverage=wine, marital_status=single )
    Reasoner->>Chatbot: answer=True, evaltrace={...}
    Chatbot->>Client: OK, then you're good to go!
    Chatbot->>Client: If you had been married you would need spousal approval to buy wine.
    Chatbot->>Client: But you're old and single, so enjoy your bender!"
Loading

Background

https://en.wikipedia.org/wiki/Espresso_heuristic_logic_minimizer

As a Binary Decision Diagram

https://claude.ai/share/3c00dd49-fe52-41b2-9588-41dbf123d21a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions