Skip to content

Commit

Permalink
Do not parenthesize structure literals
Browse files Browse the repository at this point in the history
  • Loading branch information
tothtamas28 committed Jan 24, 2025
1 parent 541f4ec commit a9a34dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pyk/src/pyk/k2lean4/k2lean4.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,13 @@ def _transform_app(self, symbol: str, sorts: tuple[Sort, ...], args: tuple[Patte

def _transform_arg(self, pattern: Pattern) -> Term:
term = self._transform_pattern(pattern)

if not isinstance(pattern, App):
return term

if pattern.symbol in self.structure_symbols:
return term

return Term(f'({term})')

def _transform_inj_app(self, sorts: tuple[Sort, ...], args: tuple[Pattern, ...]) -> Term:
Expand Down

0 comments on commit a9a34dd

Please sign in to comment.