πΊ Watch Demo Video (Google Drive)
- Description
- Features
- Installation
- File Structure
- Usage
- Modules Overview
- Testing
- Sample Input Guide
- Development
UNIDISC Engine is a comprehensive C++ application that implements discrete mathematics concepts for university course management. Built as a project for FAST NUCES University, it demonstrates practical applications of discrete structures including sets, relations, functions, logic, induction, and combinatorics in a real-world educational management system.
β¨ Highlights:
- Interactive CLI-based university management system
- 11+ discrete mathematics modules with practical implementations
- Course prerequisite verification using mathematical induction
- Automated consistency checking across all entities
- Complete validation system with error handling
- Save/Load functionality (optional extension)
- Course Management: Add courses, define prerequisites, view course chains
- Student Management: Enroll students, track completed courses, manage enrollments
- Faculty Management: Assign faculty to courses, track teaching assignments
- Room Management: Allocate rooms to courses with occupation tracking
- Union, intersection, difference operations
- Subset and superset verification
- Power set generation (2^n subsets)
- Practical application: Find students in multiple courses
- Mathematical induction for prerequisite verification
- Strong induction for multi-level prerequisite chains
- Recursive verification algorithm
- Base case and inductive step validation
- Propositional logic rule system
- IF-THEN conditional rules
- Forward chaining inference
- Automatic conclusion derivation
- Binary relation validation (Student-Course, Faculty-Course, Course-Room)
- Reflexive property checking
- Symmetric property verification
- Transitive property validation
- Equivalence relation detection
- Function mapping (StudentβCourse, CourseβFaculty, FacultyβRoom)
- Injective (one-to-one) verification
- Surjective (onto) validation
- Bijective function checking
- Function composition support
- Project group assignments using C(n,r)
- Lab session distribution
- Elective course assignment
- Combination and permutation calculations
- All possible combinations generation
- System-wide validation
- Prerequisite enforcement
- Credit overload detection
- Faculty assignment verification
- Room allocation consistency
- Input Validation: All inputs validated against existing records
- Error Handling: User-friendly error messages
- Data Persistence: Room occupation tracking
- Modular Architecture: Each module independently testable
- Clone or download the repository:
git clone https://github.com/yourusername/UNIDISC-Engine.git-
Ensure all source files are in the same directory:
- All
.cppand.hfiles - Main.cpp or TestingMain.cpp
- All
-
Compile the interactive program:
g++ -o unidisc Main.cpp Course.cpp Student.cpp Faculty.cpp Room.cpp \
SetOperations.cpp InductionModule.cpp LogicEngine.cpp \
RelationsModule.cpp FunctionsModule.cpp CombinationModule.cpp \
ConsistencyChecker.cpp- Or compile the automated testing version:
g++ -o test TestingMain.cpp Course.cpp Student.cpp Faculty.cpp Room.cpp \
SetOperations.cpp InductionModule.cpp LogicEngine.cpp \
RelationsModule.cpp FunctionsModule.cpp CombinationModule.cpp \
ConsistencyChecker.cpp- Run the program:
./unidisc # Interactive version
./test # Automated testing versionπ¦ No external libraries needed. Only standard C++ headers are used.
Main.cpp # Interactive user interface
TestingMain.cpp # Automated unit testing
Course.h / Course.cpp # Course entity with prerequisites
Student.h / Student.cpp # Student entity with enrollments
Faculty.h / Faculty.cpp # Faculty entity with assignments
Room.h / Room.cpp # Room entity with occupation tracking
SetOperations.h / .cpp # Set theory operations
InductionModule.h / .cpp # Mathematical induction verification
LogicEngine.h / .cpp # Logic and inference system
RelationsModule.h / .cpp # Binary relations and properties
FunctionsModule.h / .cpp # Function mappings and properties
CombinationModule.h / .cpp # Combinatorics and group assignments
ConsistencyChecker.h / .cpp # System-wide validation
README.md # This file
SampleInput.md # Complete testing guide
Run ./unidisc and navigate through menus:
- Course Management β Add courses and prerequisites
- Student Management β Add students and manage enrollments
- Faculty Management β Assign faculty to courses
- Room Management β Allocate rooms to courses
- Discrete Modules β Test set operations, induction, logic, etc.
Run ./test for automated demonstration:
- All modules tested with hardcoded data
- Shows step-by-step operations
- Validates all discrete structure implementations
Discrete Concepts: Partial orders, directed acyclic graphs (DAGs)
- Generate valid course sequences
- Handle prerequisite dependencies
- Verify course chains using induction
Discrete Concepts: Combinations C(n,r), permutations P(n,r)
- Assign students to project groups
- Distribute students across lab sessions
- Calculate possible elective combinations
Discrete Concepts: Mathematical induction, recursive verification
- Base case: Course with no prerequisites
- Inductive step: If prerequisites satisfied, course can be taken
- Strong induction: Check all transitive prerequisites
Discrete Concepts: Propositional logic, forward chaining
- Define IF-THEN rules
- Apply modus ponens
- Derive conclusions from facts
Discrete Concepts: Set theory, power sets, Cartesian products
- Find students in multiple courses (intersection)
- Combine student sets (union)
- Check subset relationships
- Generate power sets P(A) = 2^|A|
Discrete Concepts: Binary relations, equivalence classes, partial orders
- Reflexive: βx, (x,x) β R
- Symmetric: βx,y, (x,y) β R β (y,x) β R
- Transitive: βx,y,z, (x,y) β R β§ (y,z) β R β (x,z) β R
- Equivalence: Reflexive β§ Symmetric β§ Transitive
Discrete Concepts: Injective, surjective, bijective functions
- Injective: f(a) = f(b) β a = b
- Surjective: βy β B, βx β A, f(x) = y
- Bijective: Injective β§ Surjective
- Function composition: (f β g)(x) = f(g(x))
Discrete Concepts: Proof techniques, formal verification
- Step-by-step prerequisite proofs
- Induction-based verification
- Logic rule validation
Discrete Concepts: Constraint satisfaction, graph coloring
- Detect conflicts using set intersections
- Verify prerequisites using graph traversal
- Check student overload using sum constraints
Discrete Concepts: Recursion, dynamic programming
- Memoization for prerequisite checks
- Efficient set operations
- Optimized relation composition
# Compile and run test
g++ -o test TestingMain.cpp *.cpp
./testExpected output:
- β Course added: CS101 - Programming (3 credits)
- β Student added: S001 - Ali Ahmed
- β Prerequisite added: CS201 requires CS101
- β All 11 modules tested successfully
See SampleInput.md for complete step-by-step guide with:
- Sample data for all entities
- Test cases for each module
- Expected outputs
- Pass/fail scenarios
# Add Courses
CS101 β Programming β 3 credits
CS201 β Data Structures β 3 credits (requires CS101)
CS301 β Algorithms β 4 credits (requires CS201)
# Add Students
S001 β Ali (completed CS101, CS201)
S002 β Sara (completed CS101)
S003 β Ahmed (no courses completed)
# Test Induction
S001 β CS301 β (has all prerequisites)
S002 β CS301 β (missing CS201)
For complete testing guide, see SampleInput.md
bool verifyPrerequisites(course, student, depth) {
// Base case
if (course has no prerequisites)
return true;
// Inductive step
for each prerequisite:
if (student hasn't completed prerequisite)
return false;
// Strong induction: recursively check prerequisites
if (!verifyPrerequisites(prerequisite, student, depth+1))
return false;
return true;
}PowerSet(S) {
n = |S|
P = {}
for i = 0 to 2^n - 1:
subset = {}
for j = 0 to n-1:
if (i & (1 << j)):
subset.add(S[j])
P.add(subset)
return P
}isInjective(f) {
for each pair (a,b) where a β b:
if (f(a) == f(b))
return false
return true
}
isSurjective(f, codomain) {
for each y in codomain:
if (no x exists where f(x) = y)
return false
return true
}- Language: C++ (C++11 or higher)
- Paradigm: Object-Oriented Programming
- Data Structures: Vectors, custom classes
- Design Pattern: Modular architecture with separation of concerns
- Encapsulation: Each entity (Course, Student, Faculty) is self-contained
- Modularity: Each discrete structure module is independent
- Validation: Input validation at every step
- Extensibility: Easy to add new modules or features
- Graph visualization of prerequisite chains
- Web-based UI using C++ backend
- Database integration for persistence
- Multi-semester planning
- AI-based course recommendation
- Conflict resolution algorithms
- Performance optimization for large datasets
Course: Discrete Structures (CS-212)
Institution: FAST NUCES University
Semester: Fall 2024
Concepts Covered:
- Set Theory & Operations
- Relations & Functions
- Mathematical Induction
- Propositional Logic
- Combinatorics
- Graph Theory (Prerequisites as DAG)
- Proof Techniques
Students in CS201 = {S001, S002, S003}
Students in CS301 = {S001, S004}
Union = {S001, S002, S003, S004}
Intersection = {S001}
Difference (CS201 - CS301) = {S002, S003}
Prove: S001 can take CS301
Base case: CS101 has no prerequisites β
Inductive step:
CS301 requires CS201 β (S001 completed)
CS201 requires CS101 β (S001 completed)
Conclusion: S001 can take CS301 β
Relation: "enrolled in same course"
R = {(S001,S001), (S001,S002), (S002,S001), (S002,S002)}
Reflexive: β (everyone related to themselves)
Symmetric: β (if a~b then b~a)
Transitive: β (if a~b and b~c then a~c)
Result: Equivalence relation β
π οΈ This project is open to collaboration!
Ways to contribute:
- Add new discrete structure modules
- Improve algorithm efficiency
- Add visualization features
- Enhance error handling
- Write additional test cases
- Improve documentation
Fork it, make improvements, and submit a pull request!
This project is open source and available for educational purposes.
Developer: Muhammad Arslan, Muhammad Dawood, Mian Dawood
University: FAST NUCES
Email: [arslanumar0326@gmail.com]
GitHub: arslan0umar
- FAST NUCES University for project requirements
- Discrete Structures course instructors
- Open source community for inspiration
β If you find this project helpful, please give it a star!
Built with π» and discrete mathematics π’