Skip to content

Commit 4700891

Browse files
First and maybe last commit
Added main functionality, which supports min and max terms. Maybe I'll do the stuff on the TODO list at some point, depends on whether it interests me or not.
0 parents  commit 4700891

File tree

3 files changed

+665
-0
lines changed

3 files changed

+665
-0
lines changed

.vscode/launch.json

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python",
9+
"type": "python",
10+
"request": "launch",
11+
"stopOnEntry": true,
12+
"pythonPath": "${config:python.pythonPath}",
13+
"program": "${file}",
14+
"cwd": "${workspaceFolder}",
15+
"env": {},
16+
"envFile": "${workspaceFolder}/.env",
17+
"debugOptions": [
18+
"RedirectOutput"
19+
]
20+
},
21+
{
22+
"name": "Python: Attach",
23+
"type": "python",
24+
"request": "attach",
25+
"localRoot": "${workspaceFolder}",
26+
"remoteRoot": "${workspaceFolder}",
27+
"port": 3000,
28+
"secret": "my_secret",
29+
"host": "localhost"
30+
},
31+
{
32+
"name": "Python: Terminal (integrated)",
33+
"type": "python",
34+
"request": "launch",
35+
"stopOnEntry": true,
36+
"pythonPath": "${config:python.pythonPath}",
37+
"program": "${file}",
38+
"cwd": "",
39+
"console": "integratedTerminal",
40+
"env": {},
41+
"envFile": "${workspaceFolder}/.env",
42+
"debugOptions": []
43+
},
44+
{
45+
"name": "Python: Terminal (external)",
46+
"type": "python",
47+
"request": "launch",
48+
"stopOnEntry": true,
49+
"pythonPath": "${config:python.pythonPath}",
50+
"program": "${file}",
51+
"cwd": "",
52+
"console": "externalTerminal",
53+
"env": {},
54+
"envFile": "${workspaceFolder}/.env",
55+
"debugOptions": []
56+
},
57+
{
58+
"name": "Python: Django",
59+
"type": "python",
60+
"request": "launch",
61+
"stopOnEntry": true,
62+
"pythonPath": "${config:python.pythonPath}",
63+
"program": "${workspaceFolder}/manage.py",
64+
"cwd": "${workspaceFolder}",
65+
"args": [
66+
"runserver",
67+
"--noreload",
68+
"--nothreading"
69+
],
70+
"env": {},
71+
"envFile": "${workspaceFolder}/.env",
72+
"debugOptions": [
73+
"RedirectOutput",
74+
"DjangoDebugging"
75+
]
76+
},
77+
{
78+
"name": "Python: Flask (0.11.x or later)",
79+
"type": "python",
80+
"request": "launch",
81+
"stopOnEntry": false,
82+
"pythonPath": "${config:python.pythonPath}",
83+
"program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",
84+
"cwd": "${workspaceFolder}",
85+
"env": {
86+
"FLASK_APP": "${workspaceFolder}/quickstart/app.py"
87+
},
88+
"args": [
89+
"run",
90+
"--no-debugger",
91+
"--no-reload"
92+
],
93+
"envFile": "${workspaceFolder}/.env",
94+
"debugOptions": [
95+
"RedirectOutput"
96+
]
97+
},
98+
{
99+
"name": "Python: Flask (0.10.x or earlier)",
100+
"type": "python",
101+
"request": "launch",
102+
"stopOnEntry": false,
103+
"pythonPath": "${config:python.pythonPath}",
104+
"program": "${workspaceFolder}/run.py",
105+
"cwd": "${workspaceFolder}",
106+
"args": [],
107+
"env": {},
108+
"envFile": "${workspaceFolder}/.env",
109+
"debugOptions": [
110+
"RedirectOutput"
111+
]
112+
},
113+
{
114+
"name": "Python: PySpark",
115+
"type": "python",
116+
"request": "launch",
117+
"stopOnEntry": true,
118+
"osx": {
119+
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit"
120+
},
121+
"windows": {
122+
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit.cmd"
123+
},
124+
"linux": {
125+
"pythonPath": "${env:SPARK_HOME}/bin/spark-submit"
126+
},
127+
"program": "${file}",
128+
"cwd": "${workspaceFolder}",
129+
"env": {},
130+
"envFile": "${workspaceFolder}/.env",
131+
"debugOptions": [
132+
"RedirectOutput"
133+
]
134+
},
135+
{
136+
"name": "Python: Module",
137+
"type": "python",
138+
"request": "launch",
139+
"stopOnEntry": true,
140+
"pythonPath": "${config:python.pythonPath}",
141+
"module": "module.name",
142+
"cwd": "${workspaceFolder}",
143+
"env": {},
144+
"envFile": "${workspaceFolder}/.env",
145+
"debugOptions": [
146+
"RedirectOutput"
147+
]
148+
},
149+
{
150+
"name": "Python: Pyramid",
151+
"type": "python",
152+
"request": "launch",
153+
"stopOnEntry": true,
154+
"pythonPath": "${config:python.pythonPath}",
155+
"cwd": "${workspaceFolder}",
156+
"env": {},
157+
"envFile": "${workspaceFolder}/.env",
158+
"args": [
159+
"${workspaceFolder}/development.ini"
160+
],
161+
"debugOptions": [
162+
"RedirectOutput",
163+
"Pyramid"
164+
]
165+
},
166+
{
167+
"name": "Python: Watson",
168+
"type": "python",
169+
"request": "launch",
170+
"stopOnEntry": true,
171+
"pythonPath": "${config:python.pythonPath}",
172+
"program": "${workspaceFolder}/console.py",
173+
"cwd": "${workspaceFolder}",
174+
"args": [
175+
"dev",
176+
"runserver",
177+
"--noreload=True"
178+
],
179+
"env": {},
180+
"envFile": "${workspaceFolder}/.env",
181+
"debugOptions": [
182+
"RedirectOutput"
183+
]
184+
}
185+
]
186+
}

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Python Logic Minimizer
2+
3+
This is a script that minimizes boolean algebra expressions using the minterms/maxterms (and any don't cares) of a given expression.
4+
5+
To run, install python 3.6 (may work on older version of 3.x, but untested), and run `python minimizer.py` in a console window.
6+
7+
Currently, the minimizer only supports minimization from minterms and maxterms, but I'd like to implement an expression parser that can parse and minimize, at the very least, expressions in sum of products form.
8+
9+
Other TODOs include getting minimal "hazard-free" implementations, mainly static hazards. Another thing that would be cool (but time consuming) would be to print K-maps for up to 6 variable instructions.
10+
11+
The algorithms used in this script are the [Quine-McCluskey algorithm](https://en.wikipedia.org/wiki/Quine%E2%80%93McCluskey_algorithm#Step_2:_prime_implicant_chart) to get essential prime implicants, and [Petrick's method](https://en.wikipedia.org/wiki/Petrick%27s_method) in order to find possible minimizations to cover the rest of the function.

0 commit comments

Comments
 (0)