Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI tool that takes equation list and operation table as args, and returns JSON with 1/0 for each equation #802

Open
riccitensor opened this issue Nov 7, 2024 · 1 comment

Comments

@riccitensor
Copy link

Is your feature request related to a problem? Please describe.
I want to be able to build Python software that can deal with operation tables like the FMT tool.

Describe the solution you'd like
A Python function + CLI that takes the equation list as input, an operation table as an argument, and returns JSON with 1/0 for each equation.

Describe alternatives you've considered
I've been using the FMT tool, but I can't use it in my Python scripts.

Additional context
The tool is ready. See: #764

You can run it like this:

python3 magmas.py operation.txt equation_list.txt > solution.txt

Optable in this format:

1 0 3 0 0 0 0 1
3 1 1 1 1 1 1 1
2 2 1 2 4 2 2 2
3 3 3 3 3 3 3 3
4 4 4 4 3 4 4 4
5 5 5 5 5 3 5 5
6 6 6 6 6 6 6 6
7 7 7 7 7 7 7 7

Equation list in this format (already available):

Equation1 x = x
Equation2 x = y
Equation3 x = x ◇ x
Equation4 x = x ◇ y
Equation5 x = y ◇ x
Equation6 x = y ◇ y
Equation7 x = y ◇ z
Equation8 x = x ◇ (x ◇ x)
Equation9 x = x ◇ (x ◇ y)
Equation10 x = x ◇ (y ◇ x)
Equation11 x = x ◇ (y ◇ y)
Equation12 x = x ◇ (y ◇ z)
Equation13 x = y ◇ (x ◇ x)
Equation14 x = y ◇ (x ◇ y)

Then you'll get the solutions as a JSON file:

{
  "Equation1": 1,
  "Equation2": 0,
  "Equation3": 0,
  "Equation4": 0,
  "Equation5": 0,
  "Equation6": 0,
  "Equation7": 0,
  "Equation8": 1,
  "Equation9": 0,
  "Equation10": 0,
  "Equation11": 0,
  "Equation12": 0,
  "Equation13": 0,
  "Equation14": 0,
  "Equation15": 0,
..
@vlad902
Copy link
Contributor

vlad902 commented Nov 8, 2024

Equations should really uses the JSON format from lake exe export_equations.

Also, isn't this scripts/explore_magma.py ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants