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

add System (of relations) #12

Open
kevinbarabash opened this issue Feb 24, 2017 · 5 comments
Open

add System (of relations) #12

kevinbarabash opened this issue Feb 24, 2017 · 5 comments

Comments

@kevinbarabash
Copy link
Member

A System node can describe the following things:

  • system of equations 2x + y = 10, x - y = 3
  • system of inequalities x >= 2 - y, y > 5x

A System can be collapsed, e.g.

  • 2x = y + 3 = z - 10
  • a < x < b

Certain Systems can be interpreted as bounds, e.g. a < x < b could also be a Bounds node:

{
   type: "Bounds",
   variable: { type: Identifier, name: "x" },
   min: { type: Identifier, name: "a" },
   max: { type: Identifier, name: "b" },
}
@aliang8
Copy link

aliang8 commented Jun 17, 2017

{  type: System, args: [ equation1, inequality2, ... ], collapsed:  }

Example:

// Not collapsed
x + 2 = 1; x = 1 --> { type: System, args: [ { type: Apply, op: 'eq', args: [x + 2 = 1] }, 
{ type: Apply, op: 'eq', args: [x = 1] }, collapsed: false } 

// Collapsed
a < x < b --> { type: System, args: [ { type: Apply, op: 'lt', args: [a < x] }, 
{ type: Apply, op: 'lt', args: [x < b] }, collapsed: true } 

Is the idea of a bounds node supplementary to a system? So a < x < b can be interpreted as both a bound and a system?

@kevinbarabash
Copy link
Member Author

I think we should not parse things like a < x < b or x = y = z as a 'System'. This removes the need for the collapsed flag.

@kevinbarabash
Copy link
Member Author

Right now I believe that a < x < b is parsed as

{
  type: 'Apply',
  op: 'lt',
  args: [ a, x, b ],
}

I need to fix the demo and verify that this is the case. If not, I'll fix it so it is. x = y = z will work similarly.

@aliang8
Copy link

aliang8 commented Jun 18, 2017

I see. a < x < b and x = y = z will be parsed as above. And what do you think of parsing a System as

{  type: System, args: [ equation1, inequality2, ... ] }

@kevinbarabash
Copy link
Member Author

I think that fits a lot better with the existing structure. I need to update the spec.md with the new structure we've been working with.

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