Skip to main content
Glama
z3_models.py1 kB
from enum import Enum from typing import Union import z3 from pydantic import BaseModel Z3Value = bool | int | float | str Z3Ref = z3.BoolRef | z3.ArithRef | z3.ExprRef Z3Sort = Union[z3.BoolSort, z3.IntSort, z3.RealSort, z3.StringSort] # noqa: UP007 class Z3VariableType(str, Enum): """Variable types in Z3.""" INTEGER = "integer" REAL = "real" BOOLEAN = "boolean" STRING = "string" class Z3Variable(BaseModel): """Typed variable in a Z3 problem.""" name: str type: Z3VariableType class Z3Constraint(BaseModel): """Constraint in a Z3 problem.""" expression: str # expression as string (run through eval) description: str = "" class Z3Problem(BaseModel): """Complete Z3 constraint satisfaction problem.""" variables: list[Z3Variable] constraints: list[Z3Constraint] description: str = "" class Z3Solution(BaseModel): """Solution to a Z3 problem.""" values: dict[str, Z3Value] is_satisfiable: bool status: str

Implementation Reference

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sdiehl/usolver'

If you have feedback or need assistance with the MCP directory API, please join our Discord server