kdrag.solvers.tla
Automatically downloads tla2tools.jar
Module Attributes
But really this should be module defined = ( { "$IfThenElse", "$BoundedForall", "$BoundedExists", "$SetOfRcds", "$FcnConstructor", "$FcnApply", "$SetEnumerate", "$RcdConstructor", }.union(consts.keys()) .union(binops.keys()) .union(unops.keys()) .union(comp.keys()) ) def is_defined(f: App) -> bool: if |
Functions
|
Run the model checker on a tla file. |
|
Convert a list of pairs to a dictionary. |
|
Run the model checker on a tla file. |
|
|
|
Run the pluscal translator on a tla file. |
|
|
|
Run apalache with the given arguments. |
|
Run tla2tools.jar with the given arguments. |
|
Convert tla file to xml output |
Classes
|
Untyped Ast for expressions |
|
A TLA+ Module. |
|
Exceptions
- class kdrag.solvers.tla.App(f: object, args: list[App])
Bases:
objectUntyped Ast for expressions
- Parameters:
f (object)
args (list[App])
- all_decls() set[str]
- Return type:
set[str]
- f: object
- infer_lite() SortRef | None
- Return type:
SortRef | None
- is_binder()
- is_const()
- is_value()
- class kdrag.solvers.tla.Module(name: str, variables: list[str], definitions: dict[str, ~kdrag.solvers.tla.App], def_params: dict[str, list[str]], theorems: list[~kdrag.solvers.tla.App], decls: dict[str, ~z3.z3.FuncDeclRef] = <factory>)
Bases:
objectA TLA+ Module. Build it from a file using Module.of_file(filename) or from a string using Module.of_string(string).
mod.infer_sorts() will automatically try to infer the sorts of all variables. It may be preferable to manually declare them as these sorts are part of the spec.
- Parameters:
- Var(name: str, sort: SortRef) ExprRef
- Parameters:
name (str)
sort (SortRef)
- Return type:
ExprRef
- action(actname: str, decls: dict[str, FuncDeclRef | ExprRef] = {}) ExprRef
Return the action of the module as an smt expression. These are expressions that may involve primed variables, but do not involve other temporal operators.
- Parameters:
actname (str)
decls (dict[str, FuncDeclRef | ExprRef])
- Return type:
ExprRef
- apply(name, *args: ExprRef) ExprRef
- Parameters:
args (ExprRef)
- Return type:
ExprRef
- behavior(name: str, decls: dict[str, FuncDeclRef | ExprRef]) ExprRef
Return a useful smt form of statements that involve non trivial temporal operators
- Parameters:
name (str)
decls (dict[str, FuncDeclRef | ExprRef])
- Return type:
ExprRef
- declare_operator(name: str, *sorts: SortRef)
- Parameters:
name (str)
sorts (SortRef)
- declare_var(v: ExprRef)
- Parameters:
v (ExprRef)
- declare_vars(vs: list[ExprRef])
- Parameters:
vs (list[ExprRef])
- decls: dict[str, FuncDeclRef]
- def_params: dict[str, list[str]]
- infer_sorts()
- invariant(inv=None, init=None, step=None)
- name: str
- operator(name: str, decls: dict[str, FuncDeclRef | ExprRef] = {}, sort=None) ExprRef
- Parameters:
name (str)
decls (dict[str, FuncDeclRef | ExprRef])
- Return type:
ExprRef
- to_smt(e: App, decls: Mapping[str, FuncDeclRef | ExprRef], sort=None) ExprRef
- Parameters:
e (App)
decls (Mapping[str, FuncDeclRef | ExprRef])
- Return type:
ExprRef
- variables: list[str]
- vars() list[ExprRef]
- Return type:
list[ExprRef]
- vars1() list[ExprRef]
- Return type:
list[ExprRef]
- exception kdrag.solvers.tla.SortInference
Bases:
Exception- add_note(object, /)
Exception.add_note(note) – add a note to the exception
- args
- with_traceback(object, /)
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- kdrag.solvers.tla.apalache_check(filename: str, init=None, next_=None, inv=None)
Run the model checker on a tla file. Returns the stdout of the model checker.
- Parameters:
filename (str)
- kdrag.solvers.tla.assoc_list(pairs: list[App]) dict[str, App]
Convert a list of pairs to a dictionary. Each pair is an App with two arguments.
- kdrag.solvers.tla.check(filename: str, check_deadlock=True, continue_=False, inv=None, config=None)
Run the model checker on a tla file. Returns the stdout of the model checker.
- Parameters:
filename (str)
- kdrag.solvers.tla.consts: dict[object, ExprRef] = {'BOOLEAN': K(Bool, True), 'FALSE': False, 'TRUE': True}
But really this should be module defined = (
- {
“$IfThenElse”, “$BoundedForall”, “$BoundedExists”, “$SetOfRcds”, “$FcnConstructor”, “$FcnApply”, “$SetEnumerate”, “$RcdConstructor”,
}.union(consts.keys()) .union(binops.keys()) .union(unops.keys()) .union(comp.keys())
) def is_defined(f: App) -> bool:
if
- kdrag.solvers.tla.domain(e: ExprRef) SortRef
- Parameters:
e (ExprRef)
- Return type:
SortRef
- kdrag.solvers.tla.install_apalache()
- kdrag.solvers.tla.pluscal_translate(filename: str) bytes
Run the pluscal translator on a tla file. Returns the stdout of the translator.
- Parameters:
filename (str)
- Return type:
bytes
- kdrag.solvers.tla.prime(e: ExprRef) ExprRef
- Parameters:
e (ExprRef)
- Return type:
ExprRef
- kdrag.solvers.tla.run_apalache(args: list[str])
Run apalache with the given arguments. Returns the stdout of the process.
- Parameters:
args (list[str])
- kdrag.solvers.tla.run_tools(args: list[str])
Run tla2tools.jar with the given arguments. Returns the stdout of the process.
- Parameters:
args (list[str])
- kdrag.solvers.tla.tla_to_xml(filename)
Convert tla file to xml output