Skip to content

Theory of computation course (Free university of Tbilisi) assignments.

License

Notifications You must be signed in to change notification settings

CSopiko/theory-of-computation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

theory-of-computation

Homework 1

Problem 2

ABOUT

Program simulates NFA on given a expression. Parameters of NFA are defined/passed by user input. Program outputs same length string as given expression. While simulating expression, if any current state of machine is in accept state program outputs Y or else N on relevant index.
The last index shows if machine accepts whole string.

Input Format

first line - expression
second line - space separated parameters, n - number of states, a - number of accept states, t - number of transition pairs.
third line - space separated state indexes
followed by n lines of transition function definition, first integer represents how many pairs of transactions are followed. i-th line denotes i-th state.

expression
n a t
accept states
Ki symbol state

Examples are provided.

USAGE

You must be in Homework1 directory to run program using command:

python3 main.py

The program takes test files as an input from directory:

Public_Tests/P2/In 

Input/Output file name format must be:

inXXX.txt outXXX.txt

where XXX is any decimal number

About

Theory of computation course (Free university of Tbilisi) assignments.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages