https://github.com/harisali-git/validwebaddresses
This code does not include all valid web addresses because of several restrictions for the simplification purposes.
https://github.com/harisali-git/validwebaddresses
automata cpp toa toc validaddresses webaddress
Last synced: 8 months ago
JSON representation
This code does not include all valid web addresses because of several restrictions for the simplification purposes.
- Host: GitHub
- URL: https://github.com/harisali-git/validwebaddresses
- Owner: HarisAli-git
- Created: 2021-08-12T07:17:40.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-12T07:20:32.000Z (over 4 years ago)
- Last Synced: 2025-03-28T06:31:58.376Z (about 1 year ago)
- Topics: automata, cpp, toa, toc, validaddresses, webaddress
- Language: C++
- Homepage: https://github.com/HarisAli-git/ValidWebAddresses
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LinkAutomata
## DFA Diagram

### In the above DFA, q0 is the starting state whereas, q10 and q12 are the final states
## Program Specs:
Program first asks user to input ‘y’ or ‘n’ as a yes or no. If the user enters a valid input then program asks the user to input a string.
After the string is entered program checks step-by-step each state of the DFA. If any change of the state occurs, program changes itself accordingly.
It outputs the character with its current state at each iteration. If at any iteration, the input goes on a trap state, then it will remain there till the rest of the string iteration is completed.
There are separate functions to check the states and to change the state accordingly. After an input is completed, the program then prints Accepted or Rejected based on the string evaluation. The string is only considered accepted if it terminates on either q10 or q12. In the rest of the all cases, the string is rejected.
The program has handled almost every case that I have given to it. For mine test case the program is working effectively.
## Some of the string that I have tested:
1. ww.com (accept)
2. www.com (accept)
3. wwww.com (accept)
4. 1.com (trap - reject)
5. 2.com (trap - reject)
6. www.google.com (accept)
7. www.lhr.nu (trap – reject)
8. www.google (reject)
9. www.lhr.nu.edu.pk (trap-reject)
10. .com (trap-reject)
11. .pk (trap – reject)
12. lhr.com (accept)
These are just some of the strings, however, I have tested many.