AARCHMRS Schema 2.7.4

↚ Home

BinaryOp oneOf [ ... ]

A model representing binary operations such as A == B, A ==> B etc.

definition

Definitions Type Description
expression
oneOf [
Set
#
]

A definition used to easily compose all of the known AST in different parts of the schema.

oneOf Types.String
oneOf Types.Field
oneOf Values.Value
oneOf Bool
oneOf Real
oneOf Integer
oneOf Set
oneOf Function
oneOf SquareOp
oneOf Concat
oneOf Tuple
oneOf DotAtom
oneOf Identifier
oneOf UnaryOp
oneOf #

oneOf object

A BinaryOp composition (only valid when composing constraints) allows the following:

  • FEAT_A ==> FEAT_B
  • FEAT_A <=> FEAT_B
Properties Type Description
_meta Meta
See Meta for more information.
_type
Enum
AST.BinaryOp
left

The left-hand-side of the constraint.

See definitions.expression for more information.
op

The operation to be performed between left and right. See Traits.HasConstraints for more detail around the meaning of the enums listed below.

Enum
==> <=>
right

The right-hand-side of the constraint.

See definitions.expression for more information.
Additional Properties
Not Allowed
Examples
{
    "_type": "AST.BinaryOp", 
    "left": {
        "_type": "AST.Identifier", 
        "value": "FEAT_A"
    }, 
    "op": "==>", 
    "right": {
        "_type": "AST.Identifier", 
        "value": "FEAT_B"
    }
}
◊ Required
Properties marked with ◊ are required properties.

oneOf object

A BinaryOp composition (used for every other expression other than constraints) allows the following:

  • A || B
  • A << 2
  • B IN {1, 2, 3}
Properties Type Description
_meta Meta
See Meta for more information.
_type
Enum
AST.BinaryOp
left

The left-hand-side of the expression

See definitions.expression for more information.
op

The operation to be performed between left and right.

Enum
|| && <= >= == != < > << >> + - OR XOR AND * / ^ :: ++ IN MOD DIV DIVRM
right

The right-hand-side of the expression

See definitions.expression for more information.
Additional Properties
Not Allowed
Examples
{
    "_type": "AST.BinaryOp", 
    "left": {
        "_type": "AST.Identifier", 
        "value": "A"
    }, 
    "op": "||", 
    "right": {
        "_type": "AST.Identifier", 
        "value": "B"
    }
}
{
    "_type": "AST.BinaryOp", 
    "left": {
        "_type": "AST.Identifier", 
        "value": "A"
    }, 
    "op": "<<", 
    "right": {
        "_type": "AST.Integer", 
        "value": 2
    }
}
{
    "_type": "AST.BinaryOp", 
    "left": {
        "_type": "AST.Identifier", 
        "value": "B"
    }, 
    "op": "IN", 
    "right": {
        "_type": "AST.Set", 
        "values": [
            {
                "_type": "AST.Integer", 
                "value": 1
            }, 
            {
                "_type": "AST.Integer", 
                "value": 2
            }, 
            {
                "_type": "AST.Integer", 
                "value": 3
            }
        ]
    }
}
◊ Required
Properties marked with ◊ are required properties.

Schema http://json-schema.org/draft-04/schema#

{
  "definitions": {
    "expression": {
      "info": [
        "A definition used to easily compose all of the known $(AST.) in different parts of the schema."
      ],
      "oneOf": [
        {
          "$ref": "../Types/String.json"
        },
        {
          "$ref": "../Types/Field.json"
        },
        {
          "$ref": "../Types/PstateField.json"
        },
        {
          "$ref": "../Types/RegisterType.json"
        },
        {
          "$ref": "../Types/RegisterMultiFields.json"
        },
        {
          "$ref": "../Values/Value.json"
        },
        {
          "$ref": "Bool.json"
        },
        {
          "$ref": "Real.json"
        },
        {
          "$ref": "Integer.json"
        },
        {
          "$ref": "Set.json"
        },
        {
          "$ref": "Function.json"
        },
        {
          "$ref": "SquareOp.json"
        },
        {
          "$ref": "ArrayAccessOp.json"
        },
        {
          "$ref": "Concat.json"
        },
        {
          "$ref": "Tuple.json"
        },
        {
          "$ref": "DotAtom.json"
        },
        {
          "$ref": "Identifier.json"
        },
        {
          "$ref": "TypeAnnotation.json"
        },
        {
          "$ref": "UnaryOp.json"
        },
        {
          "$ref": "#"
        }
      ]
    }
  },
  "info": [
    "A model representing binary operations such as `A == B`, `A ==> B` etc."
  ],
  "oneOf": [
    {
      "info": [
        "A BinaryOp composition (only valid when composing constraints) allows the following:",
        [
          " - `FEAT_A ==> FEAT_B`",
          " - `FEAT_A <=> FEAT_B`"
        ]
      ],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "_meta": {
          "$ref": "../Meta.json"
        },
        "_type": {
          "enum": [
            "AST.BinaryOp"
          ]
        },
        "left": {
          "info": [
            "The left-hand-side of the constraint."
          ],
          "$ref": "#/definitions/expression"
        },
        "op": {
          "info": [
            [
              "The operation to be performed between `left` and `right`. ",
              "See $(Traits.HasConstraints) for more detail around the meaning of ",
              "the enums listed below."
            ]
          ],
          "enum": [
            "==>",
            "<=>"
          ]
        },
        "right": {
          "info": [
            "The right-hand-side of the constraint."
          ],
          "$ref": "#/definitions/expression"
        }
      },
      "examples": [
        {
          "_type": "AST.BinaryOp",
          "left": {
            "_type": "AST.Identifier",
            "value": "FEAT_A"
          },
          "op": "==>",
          "right": {
            "_type": "AST.Identifier",
            "value": "FEAT_B"
          }
        }
      ],
      "required": [
        "left",
        "op",
        "right"
      ]
    },
    {
      "type": "object",
      "info": [
        "A BinaryOp composition (used for every other expression other than constraints) allows the following:",
        [
          " - `A || B`",
          " - `A << 2`",
          " - `B IN {1, 2, 3}`"
        ]
      ],
      "additionalProperties": false,
      "properties": {
        "_meta": {
          "$ref": "../Meta.json"
        },
        "_type": {
          "enum": [
            "AST.BinaryOp"
          ]
        },
        "left": {
          "info": [
            "The left-hand-side of the expression"
          ],
          "$ref": "#/definitions/expression"
        },
        "op": {
          "info": [
            "The operation to be performed between `left` and `right`."
          ],
          "enum": [
            "||",
            "&&",
            "<=",
            ">=",
            "==",
            "!=",
            "<",
            ">",
            "<<",
            ">>",
            "+",
            "-",
            "OR",
            "XOR",
            "AND",
            "*",
            "/",
            "^",
            "::",
            "++",
            "IN",
            "MOD",
            "DIV",
            "DIVRM"
          ]
        },
        "right": {
          "info": [
            "The right-hand-side of the expression"
          ],
          "$ref": "#/definitions/expression"
        }
      },
      "examples": [
        {
          "_type": "AST.BinaryOp",
          "left": {
            "_type": "AST.Identifier",
            "value": "A"
          },
          "op": "||",
          "right": {
            "_type": "AST.Identifier",
            "value": "B"
          }
        },
        {
          "_type": "AST.BinaryOp",
          "left": {
            "_type": "AST.Identifier",
            "value": "A"
          },
          "op": "<<",
          "right": {
            "_type": "AST.Integer",
            "value": 2
          }
        },
        {
          "_type": "AST.BinaryOp",
          "left": {
            "_type": "AST.Identifier",
            "value": "B"
          },
          "op": "IN",
          "right": {
            "_type": "AST.Set",
            "values": [
              {
                "_type": "AST.Integer",
                "value": 1
              },
              {
                "_type": "AST.Integer",
                "value": 2
              },
              {
                "_type": "AST.Integer",
                "value": 3
              }
            ]
          }
        }
      ],
      "required": [
        "left",
        "op",
        "right"
      ]
    }
  ],
  "title": "BinaryOp",
  "$schema": "http://json-schema.org/draft-04/schema#"
}