#
#   Imandra Inc.
#
#   speclogician/presentation/preview/fixtures/scenario_complement.py
#

from __future__ import annotations

from speclogician.presentation.models.scenario_complement import (
    ScenarioComplementPM,
    ScenarioComplementRegionPM,
)


def make_scenario_complement_pm(variant: str = "typical") -> ScenarioComplementPM:
    v = (variant or "typical").strip().lower()

    if v == "empty":
        return ScenarioComplementPM(
            count_regions=0,
            regions_preview=[],
            regions_all=None,
        )

    if v == "edge":
        preview = [
            ScenarioComplementRegionPM(
                fp="a3f91c0d12e9ab01",
                num_constraints=12,
                invariant="x >= 0",
                model="{x = 0}",
                model_eval="ok",
                constraints_preview=["x >= 0", "y = 1", "z != 3"],
            ),
            ScenarioComplementRegionPM(
                fp="bb92e44caa10fe88",
                num_constraints=7,
                invariant="balance < limit",
                model="{balance = 5, limit = 10}",
                model_eval="ok",
                constraints_preview=["balance < limit", "limit = 10"],
            ),
            ScenarioComplementRegionPM(
                fp="0f12caa903bc9e77",
                num_constraints=3,
                invariant=None,
                model=None,
                model_eval=None,
                constraints_preview=["flag = true"],
            ),
        ]
        return ScenarioComplementPM(
            count_regions=42,
            regions_preview=preview,
            regions_all=None,
        )

    # typical
    preview = [
        ScenarioComplementRegionPM(
            fp="e19caa903bc9e771",
            num_constraints=4,
            invariant="state_ok",
            model="{s = {...}}",
            model_eval="ok",
            constraints_preview=["state_ok", "x != 0"],
        ),
        ScenarioComplementRegionPM(
            fp="a2ff10d12e9ab013",
            num_constraints=2,
            invariant=None,
            model="{x = 1}",
            model_eval="ok",
            constraints_preview=["x = 1"],
        ),
    ]
    return ScenarioComplementPM(
        count_regions=7,
        regions_preview=preview,
        regions_all=None,
    )