Skip to content

Access variables from check #963

Description

@rprospero

I suspect that this is more of a documentation issue than an actual bug, but I cannot seem to find a way to access the variables that are substituted during a check. As a quick example, imagine that I have

(datatype Expr
          (Scalar String)
          (Mul Expr Expr :cost 5))

(let b (Scalar "b"))

(rewrite (Mul (Scalar x) (Scalar y)) (Mul (Scalar y) (Scalar x)))
(rewrite (Mul (Scalar x) (Scalar y)) (Scalar (+ x " " y)))

(let example (Mul b b))

(run 5)

(check (= example
          (Scalar x)))

Now, in this trivial example, I happen to know that the check will pass and the value of x will be "b b". However, I can't seem to find any way to access this value. I know that, in general, there may be multiple possible values for x, but I would be happy seeing any of them.

Again, I suspect that this functionality is already available, but the tutorial and the examples do not seem to contain any documentation on accessing it.

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