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

New tool: Magmas CLI. Takes eq list,op table as args, and returns JSON with 1/0 for each equation. #764

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

riccitensor
Copy link

Run 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,
..

@pitmonticone
Copy link
Collaborator

pitmonticone commented Oct 31, 2024

Hi @riccitensor, thank you for your contribution.

Could you please provide more context and details regarding the aim of this tool? It's preferable if contributors follow the workflow described in the CONTRIBUTING guide.

I need to make sure to know what problem is supposed to solve and as a consequence where the script should be located.

@pitmonticone pitmonticone self-assigned this Oct 31, 2024
@pitmonticone pitmonticone marked this pull request as draft October 31, 2024 07:44
@riccitensor
Copy link
Author

Yes, absolutely.

I'm writing an RL agent and need the CLI logic behind the op table verification. Especially, for a given subset of equations. It's a Python script that takes the operation table and the equation list as arguments, and returns a JSON where for every equation 0 means "refutes", 1 means "satisfies".

@riccitensor
Copy link
Author

I also want to create an optable dataset, and I need this tool for that. The optable dataset would let us learn how to introduce perturbations into magmas. My feeling is that long-context perturbations could help us reach solutions that are currently impossible to reach.

@riccitensor
Copy link
Author

riccitensor commented Oct 31, 2024

Example:

riccitensor@timetravel magmastool % python3 magmas.py optable.txt 854_n_413.txt
{
"Equation413": 0,
"Equation854": 0
}

@riccitensor riccitensor marked this pull request as ready for review October 31, 2024 08:47
@pitmonticone pitmonticone removed their assignment Oct 31, 2024
@Shreyas4991
Copy link
Collaborator

@riccitensor, please follow the steps in the contribution guide. We don't encourage direct PRs bypassing those steps.

@riccitensor
Copy link
Author

@Shreyas4991 I guess this is just a tool and I don't see any related tickets in the GitHub project dashboard that I can claim (regarding this tool). How should I proceed?

@Shreyas4991
Copy link
Collaborator

Basically:

  1. Create an issue and bring it up on Zulip.
    2.Wait for others respond and refine the proposed tool idea.
  2. If the discussion tends to "yeah sounds good", we make it a project task.

All this and more is detailed in CONTRIBUTING.md

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

Successfully merging this pull request may close these issues.

3 participants