meszarosdezso / gramatik

Fundamentals of theory of computation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gramatik

Work with Chomsky grammers.

Example

let gramatik = Gramatik(
	['A', 'B', 'S'].into(),
	['a', 'b'].into(),
	ruleset!(
		S -> _
		A -> a | aB
		B -> b | _
	),
	'S'
);

println!("The gramatik's class: {}", gramatik.class());

if gramatik.is_class(2) {
	println!("The gramatik is class 2!");
}

Based on the lectures of Krisztian Tichler Dr.

Disclaimer

This is only for fun and learning, I failed the exam twice already. Do not trust this code.

(c) 2022

About

Fundamentals of theory of computation


Languages

Language:Rust 100.0%