refactor(py): update the type stubs (and expose DType)
This commit is contained in:
parent
9b07df440b
commit
31c65a4734
10 changed files with 102 additions and 56 deletions
|
|
@ -1,8 +1,9 @@
|
|||
from argus import _argus
|
||||
from argus._argus import * # noqa: F401
|
||||
|
||||
__all__ = []
|
||||
try:
|
||||
__doc__ = _argus.__doc__
|
||||
except AttributeError:
|
||||
...
|
||||
|
||||
|
||||
|
||||
__doc__ = _argus.__doc__
|
||||
if hasattr(_argus, "__all__"):
|
||||
__all__ += _argus.__all__
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
from argus._argus import *
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# Add
|
||||
# Always
|
||||
# And
|
||||
# BoolExpr
|
||||
# BoolSignal
|
||||
# Cmp
|
||||
# ConstBool
|
||||
# ConstFloat
|
||||
# ConstInt
|
||||
# ConstUInt
|
||||
# Div
|
||||
# Eventually
|
||||
# FloatSignal
|
||||
# IntSignal
|
||||
# Mul
|
||||
# Negate
|
||||
# Next
|
||||
# Not
|
||||
# NumExpr
|
||||
# Or
|
||||
# Signal
|
||||
# UnsignedIntSignal
|
||||
# Until
|
||||
# VarBool
|
||||
# VarFloat
|
||||
# VarInt
|
||||
# VarUInt
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
from abc import ABC
|
||||
from enum import Enum, auto
|
||||
from typing import List, Tuple, final
|
||||
|
||||
class NumExpr(ABC):
|
||||
|
|
@ -121,6 +122,13 @@ class Eventually(BoolExpr):
|
|||
class Until(BoolExpr):
|
||||
def __init__(self, lhs: BoolExpr, rhs: BoolExpr): ...
|
||||
|
||||
@final
|
||||
class DType(Enum):
|
||||
Bool = auto()
|
||||
Int = auto()
|
||||
UnsignedInt = auto()
|
||||
Float = auto()
|
||||
|
||||
class Signal(ABC): ...
|
||||
|
||||
@final
|
||||
|
|
@ -162,7 +170,5 @@ class FloatSignal(Signal):
|
|||
@final
|
||||
class Trace: ...
|
||||
|
||||
@final
|
||||
class BooleanSemantics:
|
||||
@staticmethod
|
||||
def eval(expr: BoolExpr, trace: Trace) -> BoolSignal: ...
|
||||
def eval_bool_semantics(expr: BoolExpr, trace: Trace) -> BoolSignal: ...
|
||||
def eval_robust_semantics(expr: BoolExpr, trace: Trace) -> BoolSignal: ...
|
||||
|
|
|
|||
49
pyargus/argus/exprs.py
Normal file
49
pyargus/argus/exprs.py
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
from argus._argus import (
|
||||
Abs,
|
||||
Add,
|
||||
Always,
|
||||
And,
|
||||
BoolExpr,
|
||||
ConstBool,
|
||||
ConstFloat,
|
||||
ConstInt,
|
||||
ConstUInt,
|
||||
Div,
|
||||
Eventually,
|
||||
Mul,
|
||||
Negate,
|
||||
Next,
|
||||
Not,
|
||||
NumExpr,
|
||||
Or,
|
||||
Until,
|
||||
VarBool,
|
||||
VarFloat,
|
||||
VarInt,
|
||||
VarUInt,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Abs",
|
||||
"Add",
|
||||
"Always",
|
||||
"And",
|
||||
"BoolExpr",
|
||||
"ConstBool",
|
||||
"ConstFloat",
|
||||
"ConstInt",
|
||||
"ConstUInt",
|
||||
"Div",
|
||||
"Eventually",
|
||||
"Mul",
|
||||
"Negate",
|
||||
"Next",
|
||||
"Not",
|
||||
"NumExpr",
|
||||
"Or",
|
||||
"Until",
|
||||
"VarBool",
|
||||
"VarFloat",
|
||||
"VarInt",
|
||||
"VarUInt",
|
||||
]
|
||||
7
pyargus/argus/semantics.py
Normal file
7
pyargus/argus/semantics.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from argus._argus import Trace, eval_bool_semantics, eval_robust_semantics
|
||||
|
||||
__all__ = [
|
||||
"Trace",
|
||||
"eval_bool_semantics",
|
||||
"eval_robust_semantics",
|
||||
]
|
||||
9
pyargus/argus/signals.py
Normal file
9
pyargus/argus/signals.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
from argus._argus import BoolSignal, FloatSignal, IntSignal, Signal, UnsignedIntSignal
|
||||
|
||||
__all__ = [
|
||||
"Signal",
|
||||
"BoolSignal",
|
||||
"IntSignal",
|
||||
"UnsignedIntSignal",
|
||||
"FloatSignal",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue