CNF Checker & Converter
A grammar is in Chomsky Normal Form (CNF) if every production rule is either
A → BC (exactly two non-terminals) or A → a (exactly one terminal).
This tool checks your grammar against these rules and converts it to CNF if needed,
following the standard steps: START → TERM → BIN → DEL → UNIT.
Grammar Input
Enter each production rule on a new line. Use -> or → as separator
and | for multiple productions on the same line.
The first rule's left side is taken as the start symbol.
Production Rules
CYK String Membership
The Cocke–Younger–Kasami (CYK) algorithm determines whether a string
belongs to the language defined by a grammar. It requires the grammar to be in CNF —
if yours is not, it will be converted automatically. The algorithm builds a
triangular table bottom-up, combining smaller substrings into larger ones.
1 Grammar Input
Enter your Context-Free Grammar below. If it is not already in CNF, it will be automatically converted before the CYK algorithm runs.
Production Rules