Skip to content

Fresh variable generation API #3

Closed

Description

@RobinWebbers

Currently, the API allows one to only quantify over inputs via its type signature. For example, we quantify over all platform sized integers Int in the following snipped:

{-# ANN example0 (Theory embeddings) #-}
example0 :: Int -> SMT.Bool

A more user-friendly and robust would be to expose a way to create symbolic variables directly to the user via a simple API. I.e. we would expose the following base function:

symbolic :: Primitive a => Identifier -> a

The Identifier is likely a type alias for SMT.Integer and will evaluation should halt if it is ever left symbolic. With this, we can just implement a typeclass similar to Arbitrary from QuickCheck.

Activity

  1. RobinWebbers commented on Jul 28, 2026

    @RobinWebbers
    MemberAuthor

    Actually, it is unclear what the typeclass implementation would look like for embedded types. Likely the solution would be to embed the typeclass instance for the embedded type. I'll mark issue #12 as a blocker for this reason!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions