
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
A Python implementation of the subset construction algorithm to convert a Non-Deterministic Finite Automaton (NFA) with ε-transitions to an equivalent Deterministic Finite Automaton (DFA).
Define your NFA as follows:
nfa_states
: Set of NFA states (e.g., {'q0', 'q1', 'q2'}
).nfa_alphabet
: List of symbols including 'ε'
(e.g., ['a', 'b', 'ε']
).nfa_transitions
: Dictionary where keys are tuples (state, symbol)
, and values are sets of next states. (e.g., { ('q0', 'ε'): {'q1'}, ('q1', 'a'): {'q1', 'q2'}, ('q1', 'b'): {'q1'}, ('q2', 'a'): {'q2'}, }
).nfa_start
: The start state (e.g., 'q0'
).nfa_accept
: Set of accept states (e.g., {'q2'}
).from computation_toolkit import nfa_to_dfa
dfa_states, dfa_alphabet, dfa_transitions, dfa_start, dfa_accept = nfa_to_dfa(
nfa_states, nfa_alphabet, nfa_transitions, nfa_start, nfa_accept
)
A program to determine if a given string has more than one parse tree under a provided context-free grammar (CFG), indicating ambiguity for that string. Uses an shift-reduce bottom up parser to handle common sources of ambiguity.
Specify your CFG as a dictionary where:
"E"
).[["E", "+", "E"], ["a"]]
).Example (ambiguous arithmetic grammar):
from computation_toolkit import has_multiple_parses
grammar = {
"E": [["E", "+", "E"], ["E", "*", "E"], ["a"]]
}
start_symbol = "E"
input_string = "a+a*a"
print(has_multiple_parses(grammar, start_symbol, input_string))
A Python implementation of a Turing Machine that computes the sum of two unary numbers separated by a +
symbol.
from computation_toolkit import tm_add
input_str = "111+11"
print(tm_add(input_str))
To run the tests, use the following command:
python -m unittest discover tests -v
FAQs
Theory of Computation
We found that computation-toolkit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.