Skip to content

Conversions

Collection of different conversion functions.

args_to_dict(args_str: str) -> dict[str, Any]

Convert program argument string to dictionary.

Parameters:

Name Type Description Default
args_str str

String to be converted.

required

Returns:

Type Description
dict[str, Any]

Argument dictionary.

str_to_symbols(string: str) -> list[clingo.symbol.Symbol]

Convert String to list of clingo.Symbol.

Parameters:

Name Type Description Default
string str

String to be converted.

required

Returns:

Type Description
list[Symbol]

list of symbols.

symbol_to_str(symbol: clingo.Symbol) -> str

Convert clingo.Symbol to String.

Parameters:

Name Type Description Default
symbol Symbol

Symbol to be converted.

required

Returns:

Type Description
str

Symbol as string.