def customize_infra_agent_in_degree_low(agent: Number) -> Symbol: if agent.number < 2: return Number(0) else: return Number(2)
def theory_term_number(self, term_id: int, number: int) -> None: self._output("theory_number", [Number(term_id), Number(number)])
def theory_term_string(self, term_id: int, name: str) -> None: self._output("theory_string", [Number(term_id), String(name)])
def external(self, atom: int, value: TruthValue) -> None: value_name = str(value).replace('TruthValue.', '').lower().rstrip('_') self._output("external", [Number(atom), Function(value_name)])
def assume(self, literals: Sequence[int]) -> None: for lit in literals: self._output("assume", [Number(lit)])
def nia(self) -> Symbol: return Number(self.number_of_infra_agents)
def project(self, atoms: Sequence[int]) -> None: for atom in atoms: self._output("project", [Number(atom)])
def _wlit(i: Symbol, pos: int, wlit: Tuple[int, int]) -> Sequence[Symbol]: # pylint: disable=unused-argument return [i, Number(wlit[0]), Number(wlit[1])]
def _output(self, name: str, args: Sequence[Symbol]): if self._reify_steps: args = list(args) + [Number(self._step)] self._cb(Function(name, args))
def product_agent_out_degree_low(self, agent: Number) -> Symbol: return Number(self.product_agent_profile["out_degree"][0])
def product_agent_in_degree_high(self, agent: Number) -> Symbol: return Number(self.product_agent_profile["in_degree"][1])
def infra_agent_in_degree_high(self, agent: Number) -> Symbol: return Number(self.infra_agent_profile["in_degree"][1])
def infra_agent_out_degree_low(self, agent: Number) -> Symbol: return Number(self.infra_agent_profile["out_degree"][0])
def npa(self) -> Symbol: return Number(self.number_of_product_agents)
def _theory(i: Symbol, pos: int, lit: int) -> Sequence[Symbol]: return [i, Number(pos), Number(lit)]
def minimize(self, priority: int, literals: Sequence[Tuple[int, int]]) -> None: self._output( "minimize", [Number(priority), self._wlit_tuple(literals)])
def _lit(i: Symbol, pos: int, lit: int) -> Sequence[Symbol]: # pylint: disable=unused-argument return [i, Number(lit)]
def nl(self) -> Symbol: return Number(self.number_of_leaves)