File size: 680 Bytes
16f1328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26a7647
16f1328
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from __future__ import annotations

from abc import ABC, abstractmethod
from dataclasses import dataclass


@dataclass
class LeanResult:
    passed: bool
    error: str
    latency_ms: int
    raw_stderr: str


class LeanBackend(ABC):
    @abstractmethod
    def verify(
        self,
        spec_module: str,
        function_name: str,
        code: str,
        symbol_name: str | None = None,
        extra_imports: list[str] | None = None,
        sample_checks: list[str] | None = None,
    ) -> LeanResult:
        raise NotImplementedError

    @abstractmethod
    def verify_proof(self, spec_module: str, proof_code: str) -> LeanResult:
        raise NotImplementedError