Skip to content

Aliases for knows #122

@iancero

Description

@iancero

Sometimes, we need to use knows to force an agent to be aware of an axis, but we don't really mean they know the value of that axis in the everyday use of the term. Would it be possible to consider adding aliases for knows that fit this case more cleanly, for better code readability and programmer reasoning?

For example, we might say:

@memo
def model[s: State, a: Action]():
    alice: knows(s)  # here, she doesn't really "know" the state in a true sense, instead she is considering / reflecting on it, holding the value in her mind

    alice: thinks[
        bob: given(s in State, wpp=exp(s)),
        bob: chooses(a in Action, wpp=exp(s*a))
    ]

    alice: observes [bob.a] is a

    return alice[
        Pr[bob.s == s]
    ]

I think the aliases for chooses (e.g., given, draws) are great examples that have made the language much clearer to me, even though they are just sugar (and being just straight aliases, are maybe even better understood as calorie-free stevia?).

I don't know what the safest choices would be, but what about something like:

alice: aware_exists(s)
alice: knows_about(s)
alice: knows_axis(s)
alice: actively_considers(s)

Like observes, you could also do it with a mnemonic:

alice: knows [s] # which could syntactically distinguish the two different uses of knows
alice: considers_case_of [s] is s

Again, I'm not attached to any particular alias, but I think the fact that knows has uses that are distinct from it's everyday meaning suggests it could be fertile ground for the same kind of successful aliases we now have for chooses.

  • Ian

PS - I've had a full day of memo thoughts, so I promise this is the last one. Thanks again for everything you do on this language, it is a real pleasure to use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions