Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Prefix grammar
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
In [[theoretical computer science]] and [[formal language theory]], a '''prefix grammar''' is a type of [[string rewriting system]], consisting of a set of [[string (computer science)|string]] [[rewriting]] rules, and similar to a [[formal grammar]] or a [[semi-Thue system]]. What is specific about prefix grammars is not the shape of their rules, but the way in which they are applied: only [[prefix (computer science)|prefixes]] are rewritten. The prefix grammars describe exactly all [[regular language]]s.<ref>[http://portal.acm.org/citation.cfm?id=185820 M. Frazier and C. D. Page. Prefix grammars: An alternative characterization of the regular languages. Information Processing Letters, 51(2):67β71, 1994.]</ref> ==Formal definition== A prefix grammar ''G'' is a [[n-tuple|3-tuple]], (Ξ£, ''S'', ''P''), where *Ξ£ is a finite alphabet *''S'' is a finite set of base strings over Ξ£ *''P'' is a finite set of production rules of the form ''u'' β ''v'' where ''u'' and ''v'' are strings over Ξ£ For strings ''x'', ''y'', we write ''x'' β<sub>''G''</sub> ''y'' (and say: ''G'' can derive ''y'' from ''x'' in one step) if there are strings ''u, v, w'' such that {{tmath|1=x = vu, y = wu}}, and ''v'' β ''w'' is in ''P''. Note that {{math|β<sub>''G''</sub>}} is a [[binary relation]] on the strings of Ξ£. The ''language'' of ''G'', denoted {{tmath|L(G)}}, is the set of strings derivable from ''S'' in zero or more steps: formally, the set of strings ''w'' such that for some ''s'' in ''S'', ''s R w'', where ''R'' is the [[transitive closure]] of {{math|β<sub>''G''</sub>}}. ==Example== The prefix grammar *Ξ£ = {0, 1} *''S'' = {01, 10} *''P'' = {0 β 010, 10 β 100} describes the language defined by the [[regular expression]] :<math> 01(01)^* \cup 100^* </math> ==See also == * [[Regular grammar]] ==References== {{reflist}} [[Category:Formal languages]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Math
(
edit
)
Template:Reflist
(
edit
)
Template:Tmath
(
edit
)