Skip to content
This repository was archived by the owner on Apr 25, 2024. It is now read-only.
This repository was archived by the owner on Apr 25, 2024. It is now read-only.

Rework CTerm initializer #295

@tothtamas28

Description

@tothtamas28

Instead of taking a KInner, it should be:

def __init__(self, config: KInner, constraints: Iterable[KInner] = ()) -> None:
    check_config(config)
    constraints = self._normalize_constraints(constraints)
    object.__setattr__(self, 'config', config)
    object.__setattr__(self, 'constraints', constraints)

and

@staticmethod
def from_term(term: KInner) -> 'CTerm':
    config, constraint = split_config_and_constraints(term)
    return CTerm(config, constraints)

Edit: added implementation of from_term for unambiguity.

Rationale

CTerm is often instantiated as

CTerm(mlAnd([config] + constraints))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions