Skip to content

define-term in pattern position #215

@wilbowma

Description

@wilbowma

I usually think of any term being allowed in pattern position and simply acting as "unify with this".

I think of define-term as simply introducing a meta-variable that means literally the term being defined.

However, both of these mental models are broken when combined:

(require redex/reduction-semantics)
(define-language L)
(define-term T true)
> (redex-match? L true (term T))
#t
> (redex-match? L T (term true))
#f
> (define-judgment-form L
    #:mode (eval I O)
    [(eval true true)])
> (judgment-holds (eval T true))
#t
> (judgment-holds (eval T T))
#f

Is there a reason? Could this be supported?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions