Skip to content

Commit

Permalink
Adjusting functions to have proper naming and operations
Browse files Browse the repository at this point in the history
  • Loading branch information
ACassimiro committed Aug 27, 2024
1 parent 43b12a6 commit c60452b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion rust-lite/src/rust_lite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def exec_run(options: RunOptions) -> None:

print('Performed all possible rewriting operations; Trying to fetch the content of the K cell.')

module_manager.fetch_k_top_element()
module_manager.print_k_top_element()

def trigger_exec_run(stripped_args):
options = generate_options(stripped_args)
Expand Down
17 changes: 4 additions & 13 deletions rust-lite/src/rust_lite/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,18 @@ def load_program(self, program_path: str) -> None:
output_kore = self.krun.run_pattern(pattern, pipe_stderr=False)
self.cterm = CTerm.from_kast(self.krun.kore_to_kast(output_kore))


def fetch_k_cell_content(self):
print('--------------------------------------------------')
print('K CELL CONTENTS: ')
def fetch_k_cell_content(self) -> KToken:
cell = self.cterm.cell('K_CELL')
_PPRINT.pprint(cell)
return cell

def print_k_top_element(self) -> None:
cell = self.fetch_k_cell_content()
queue: deque[KInner] = deque(cell)


def fetch_k_top_element(self):
print('--------------------------------------------------')
print('K CELL TOP ELEMENT: ')
cell = self.cterm.cell('K_CELL')

queue: deque[KInner] = deque(cell)

if(len(queue) > 0):
top_cell = queue.popleft()
_PPRINT.pprint(top_cell)
else:
print('Cell is empty.')

return cell

0 comments on commit c60452b

Please sign in to comment.