Skip to content

Leoreoreo/SAT_Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Overview

CP1: NFA Simulator

Using graph algorithm to simulate NFAs.

Input: NFA file, target string

Output: Accept/Reject, path (if accepted)

Example:

截屏2024-05-27 16 23 22 截屏2024-05-27 16 24 23

Usage:

截屏2024-05-27 16 26 11

CP2: Regular Expression Simulator

Parse regular expressions (only with '(', ')', '|', '*') with PDA, construct a tree. Then convert the tree into NFA.

Input: regexp, lines of strings

Output: strings that match the regexp

Example:

截屏2024-05-27 16 37 13 截屏2024-05-27 16 38 48

CP3: Sed Simulator

Add group to the regexp parser to simulate the mini-sed (msed). Prove msed is Turing-Complete by implementing a translation from Turing machines to msed.

截屏2024-05-28 12 02 40

Example:

截屏2024-05-28 12 24 43

Usage:

截屏2024-05-28 12 03 58

CP4: Regular Expression Matcher with Backreferences

Add backreference to the regexp parser.

截屏2024-05-28 12 28 30 截屏2024-05-28 12 29 12

Prove regexp with backreferences is NP-Complete by reducing it into SAT problem in polynomial time

Usage:

截屏2024-05-28 12 32 41

Language and Libraries

  • Language: Python
  • Standard Libraries Used: All standard libraries except re

About

Theory of Computing course project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors