Skip to content

Commit 76ad28a

Browse files
walacglemco
authored andcommitted
rv/rvgen: fix typos in automata and generator docstring and comments
Fix two typos in the Automata class documentation that have been present since the initial implementation. Fix the class docstring: "part it" instead of "parses it". Additionally, a comment describing transition labels contained the misspelling "lables" instead of "labels". Fix a typo in the comment describing the insertion of the initial state into the states list: "bein og" should be "beginning of". Fix typo in the module docstring: "Abtract" should be "Abstract". Fix several occurrences of "automata" where it should be the singular form "automaton". Signed-off-by: Wander Lairson Costa <wander@redhat.com> Reviewed-by: Gabriele Monaco <gmonaco@redhat.com> Link: https://lore.kernel.org/r/20260223162407.147003-8-wander@redhat.com Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
1 parent 6c7e548 commit 76ad28a

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

tools/verification/rvgen/rvgen/automata.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org>
55
#
6-
# Automata object: parse an automata in dot file digraph format into a python object
6+
# Automata class: parse an automaton in dot file digraph format into a python object
77
#
88
# For further information, see:
99
# Documentation/trace/rv/deterministic_automata.rst
@@ -33,7 +33,7 @@ class AutomataError(Exception):
3333
"""
3434

3535
class Automata:
36-
"""Automata class: Reads a dot file and part it as an automata.
36+
"""Automata class: Reads a dot file and parses it as an automaton.
3737
3838
It supports both deterministic and hybrid automata.
3939
@@ -153,7 +153,7 @@ def __get_state_variables(self) -> tuple[list[str], str, list[str]]:
153153
states = sorted(set(states))
154154
states.remove(initial_state)
155155

156-
# Insert the initial state at the bein og the states
156+
# Insert the initial state at the beginning of the states
157157
states.insert(0, initial_state)
158158

159159
if not has_final_states:
@@ -175,7 +175,7 @@ def __get_event_variables(self) -> tuple[list[str], list[str]]:
175175
line = self.__dot_lines[cursor].split()
176176
event = "".join(line[line.index("label") + 2:-1]).replace('"', '')
177177

178-
# when a transition has more than one lables, they are like this
178+
# when a transition has more than one label, they are like this
179179
# "local_irq_enable\nhw_local_irq_enable_n"
180180
# so split them.
181181

tools/verification/rvgen/rvgen/dot2c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org>
55
#
6-
# dot2c: parse an automata in dot file digraph format into a C
6+
# dot2c: parse an automaton in dot file digraph format into a C
77
#
88
# This program was written in the development of this paper:
99
# de Oliveira, D. B. and Cucinotta, T. and de Oliveira, R. S.

tools/verification/rvgen/rvgen/dot2k.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ class da2k(dot2k):
167167
def __init__(self, *args, **kwargs):
168168
super().__init__(*args, **kwargs)
169169
if self.is_hybrid_automata():
170-
raise AutomataError("Detected hybrid automata, use the 'ha' class")
170+
raise AutomataError("Detected hybrid automaton, use the 'ha' class")
171171

172172
class ha2k(dot2k):
173173
"""Hybrid automata only"""
174174
def __init__(self, *args, **kwargs):
175175
super().__init__(*args, **kwargs)
176176
if not self.is_hybrid_automata():
177-
raise AutomataError("Detected deterministic automata, use the 'da' class")
177+
raise AutomataError("Detected deterministic automaton, use the 'da' class")
178178
self.trace_h = self._read_template_file("trace_hybrid.h")
179179
self.__parse_constraints()
180180

tools/verification/rvgen/rvgen/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Copyright (C) 2019-2022 Red Hat, Inc. Daniel Bristot de Oliveira <bristot@kernel.org>
55
#
6-
# Abtract class for generating kernel runtime verification monitors from specification file
6+
# Abstract class for generating kernel runtime verification monitors from specification file
77

88
import platform
99
import os

0 commit comments

Comments
 (0)