|
55 | 55 | import chc.api.XPredicate as XP |
56 | 56 |
|
57 | 57 |
|
58 | | - |
59 | 58 | if TYPE_CHECKING: |
60 | 59 | from chc.app.CFile import CFile |
61 | 60 | from chc.app.CFileDeclarations import CFileDeclarations |
@@ -328,7 +327,7 @@ def f(index: int, tags: List[str], args: List[int]) -> XPredicate: |
328 | 327 | args = [self.index_s_term(p.term)] |
329 | 328 |
|
330 | 329 | elif p.is_non_negative: |
331 | | - p = cast(XP.XNonNegative, p) |
| 330 | + p = cast(XP.XNonNegative, p) |
332 | 331 | args = [self.index_s_term(p.term)] |
333 | 332 |
|
334 | 333 | elif p.is_initialized: |
@@ -383,7 +382,11 @@ def parse_mathml_api_parameter( |
383 | 382 | self, name: str, pars: Dict[str, int], gvars: List[str] = [] |
384 | 383 | ) -> int: |
385 | 384 | if (name not in pars) and (name not in gvars): |
386 | | - raise Exception("Error in reading user data: " + name + " in file " + self.cfile.name) |
| 385 | + raise Exception( |
| 386 | + "Error in reading user data: " |
| 387 | + + name |
| 388 | + + " in file " |
| 389 | + + self.cfile.name) |
387 | 390 | if name in pars: |
388 | 391 | tags = ["pf"] |
389 | 392 | args = [pars[name]] |
@@ -440,7 +443,8 @@ def parse_mathml_term( |
440 | 443 | if tnode_text is None: |
441 | 444 | raise Exception("Expected element to have text") |
442 | 445 | args = [ |
443 | | - self.parse_mathml_api_parameter(tnode_text, pars, gvars=gvars), |
| 446 | + self.parse_mathml_api_parameter( |
| 447 | + tnode_text, pars, gvars=gvars), |
444 | 448 | self.parse_mathml_offset(None), |
445 | 449 | ] |
446 | 450 |
|
@@ -497,9 +501,11 @@ def parse_mathml_term( |
497 | 501 | tags = ["ax", "minusa"] |
498 | 502 |
|
499 | 503 | else: |
500 | | - raise Exception('Parse mathml s-term apply not found for "' + op + '"') |
| 504 | + raise Exception( |
| 505 | + 'Parse mathml s-term apply not found for "' + op + '"') |
501 | 506 | else: |
502 | | - raise Exception('Parse mathml s-term not found for "' + tnode.tag + '"') |
| 507 | + raise Exception( |
| 508 | + 'Parse mathml s-term not found for "' + tnode.tag + '"') |
503 | 509 |
|
504 | 510 | return self.mk_s_term(tags, args) |
505 | 511 |
|
@@ -625,22 +631,26 @@ def bound(t: str) -> int: |
625 | 631 |
|
626 | 632 | # ------------------------ Read/write xml services ----------------------- |
627 | 633 |
|
628 | | - def read_xml_xpredicate(self, node: ET.Element, tag: str = "ipr") -> XPredicate: |
| 634 | + def read_xml_xpredicate( |
| 635 | + self, node: ET.Element, tag: str = "ipr") -> XPredicate: |
629 | 636 | xml_value = node.get(tag) |
630 | 637 | if xml_value is None: |
631 | 638 | raise Exception('No value for tag "' + tag + '"') |
632 | 639 | return self.get_xpredicate(int(xml_value)) |
633 | 640 |
|
634 | | - def read_xml_postcondition(self, node: ET.Element, tag: str = "ixpre") -> XPredicate: |
| 641 | + def read_xml_postcondition( |
| 642 | + self, node: ET.Element, tag: str = "ixpre") -> XPredicate: |
635 | 643 | xml_value = node.get(tag) |
636 | 644 | if xml_value is None: |
637 | 645 | raise Exception('No value for tag "' + tag + '"') |
638 | 646 | return self.get_xpredicate(int(xml_value)) |
639 | 647 |
|
640 | | - def write_xml_postcondition(self, node: ET.Element, pc: XPredicate, tag: str = "ixpre") -> None: |
| 648 | + def write_xml_postcondition( |
| 649 | + self, node: ET.Element, pc: XPredicate, tag: str = "ixpre") -> None: |
641 | 650 | return node.set(tag, str(self.index_xpredicate(pc))) |
642 | 651 |
|
643 | | - def read_xml_postrequest(self, node: ET.Element, tag: str = "iipr") -> PostRequest: |
| 652 | + def read_xml_postrequest( |
| 653 | + self, node: ET.Element, tag: str = "iipr") -> PostRequest: |
644 | 654 | xml_value = node.get(tag) |
645 | 655 | if xml_value is None: |
646 | 656 | raise Exception('No value for tag "' + tag + '"') |
@@ -678,7 +688,7 @@ def objectmap_to_string(self, name: str) -> str: |
678 | 688 | return "\n".join(lines) |
679 | 689 | else: |
680 | 690 | raise UF.CHCError( |
681 | | - "Name: " + name + " does not correspond to a table") |
| 691 | + "Name: " + name + " does not correspond to a table") |
682 | 692 |
|
683 | 693 | def write_xml(self, node: ET.Element) -> None: |
684 | 694 | def f(n: ET.Element, r: Any) -> None: |
|
0 commit comments