packages feed

hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/validate/paths.json

{
  "name": "hydra.core.validate.paths",
  "metadata": {
    "description": "The TermGraph : TypeGraph conformance relation: path erasure (a subterm position maps to the subtype position of its type) plus node typing, partial on the computation fragment.",
    "comments": [],
    "seeAlso": [],
    "provisions": []},
  "dependencies": [
    {"module": "hydra.core.lib.lists"},
    {"module": "hydra.core.lib.logic"},
    {"module": "hydra.core.lib.optionals"},
    {"module": "hydra.core.lib.pairs"},
    {"module": "hydra.core.paths"}],
  "definitions": [
    {
      "term": {
        "name": "hydra.core.validate.paths.eraseSubtermPath",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.paths.SubtermPath"}, "isLazy": false}],
          "result": {"type": {"optional": {"variable": "hydra.core.paths.SubtypePath"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "path",
                "domain": {"variable": "hydra.core.paths.SubtermPath"},
                "body": {
                  "let": {
                    "bindings": [
                      {
                        "name": "steps",
                        "term": {"application": {"function": {"unwrap": "hydra.core.paths.SubtermPath"}, "argument": {"variable": "path"}}},
                        "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.paths.SubtermStep"}}, "constraints": []}}],
                    "body": {
                      "let": {
                        "bindings": [
                          {
                            "name": "go",
                            "term": {
                              "lambda": {
                                "parameter": "acc",
                                "domain": {
                                  "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}},
                                "body": {
                                  "lambda": {
                                    "parameter": "step",
                                    "domain": {"variable": "hydra.core.paths.SubtermStep"},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {
                                                      "typeApplication": {
                                                        "body": {"variable": "hydra.core.lib.optionals.match"},
                                                        "type": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}},
                                                    "type": {
                                                      "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}}},
                                                "argument": {"variable": "acc"}}},
                                            "argument": {
                                              "typeApplication": {
                                                "body": {"optional": null},
                                                "type": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}}}},
                                        "argument": {
                                          "lambda": {
                                            "parameter": "stateP",
                                            "domain": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}},
                                            "body": {
                                              "let": {
                                                "bindings": [
                                                  {
                                                    "name": "out",
                                                    "term": {
                                                      "application": {
                                                        "function": {
                                                          "typeApplication": {
                                                            "body": {
                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                            "type": {"literal": "boolean"}}},
                                                        "argument": {"variable": "stateP"}}},
                                                    "typeScheme": {"variables": [], "body": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "constraints": []}}],
                                                "body": {
                                                  "let": {
                                                    "bindings": [
                                                      {
                                                        "name": "pendingEntry",
                                                        "term": {
                                                          "application": {
                                                            "function": {
                                                              "typeApplication": {
                                                                "body": {
                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                                "type": {"literal": "boolean"}}},
                                                            "argument": {"variable": "stateP"}}},
                                                        "typeScheme": {"variables": [], "body": {"literal": "boolean"}, "constraints": []}}],
                                                    "body": {
                                                      "application": {
                                                        "function": {
                                                          "application": {
                                                            "function": {
                                                              "application": {
                                                                "function": {
                                                                  "typeApplication": {
                                                                    "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                                    "type": {
                                                                      "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}}},
                                                                "argument": {"variable": "pendingEntry"}}},
                                                            "argument": {
                                                              "application": {
                                                                "function": {
                                                                  "cases": {
                                                                    "typeName": "hydra.core.paths.SubtermStep",
                                                                    "default": {
                                                                      "typeApplication": {
                                                                        "body": {"optional": null},
                                                                        "type": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}},
                                                                    "cases": [
                                                                      {
                                                                        "name": "pairFirst",
                                                                        "handler": {
                                                                          "lambda": {
                                                                            "parameter": "_",
                                                                            "domain": "unit",
                                                                            "body": {
                                                                              "optional": {
                                                                                "typeApplication": {
                                                                                  "body": {
                                                                                    "typeApplication": {
                                                                                      "body": {
                                                                                        "pair": {
                                                                                          "first": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"variable": "hydra.core.paths.SubtypeStep"}}},
                                                                                                  "argument": {"variable": "out"}}},
                                                                                              "argument": {"list": [{"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "mapKeys", "term": "unit"}}}]}}},
                                                                                          "second": {"literal": {"boolean": false}}}},
                                                                                      "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                                                  "type": {"literal": "boolean"}}}}}}},
                                                                      {
                                                                        "name": "pairSecond",
                                                                        "handler": {
                                                                          "lambda": {
                                                                            "parameter": "_",
                                                                            "domain": "unit",
                                                                            "body": {
                                                                              "optional": {
                                                                                "typeApplication": {
                                                                                  "body": {
                                                                                    "typeApplication": {
                                                                                      "body": {
                                                                                        "pair": {
                                                                                          "first": {
                                                                                            "application": {
                                                                                              "function": {
                                                                                                "application": {
                                                                                                  "function": {
                                                                                                    "typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"variable": "hydra.core.paths.SubtypeStep"}}},
                                                                                                  "argument": {"variable": "out"}}},
                                                                                              "argument": {"list": [{"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "mapValues", "term": "unit"}}}]}}},
                                                                                          "second": {"literal": {"boolean": false}}}},
                                                                                      "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                                                  "type": {"literal": "boolean"}}}}}}}]}},
                                                                "argument": {"variable": "step"}}}}},
                                                        "argument": {
                                                          "application": {
                                                            "function": {
                                                              "cases": {
                                                                "typeName": "hydra.core.paths.SubtermStep",
                                                                "default": {
                                                                  "application": {
                                                                    "function": {
                                                                      "application": {
                                                                        "function": {
                                                                          "typeApplication": {
                                                                            "body": {
                                                                              "typeApplication": {"body": {"variable": "hydra.core.lib.optionals.map"}, "type": {"variable": "hydra.core.paths.SubtypeStep"}}},
                                                                            "type": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}},
                                                                        "argument": {
                                                                          "lambda": {
                                                                            "parameter": "st",
                                                                            "domain": {"variable": "hydra.core.paths.SubtypeStep"},
                                                                            "body": {
                                                                              "typeApplication": {
                                                                                "body": {
                                                                                  "typeApplication": {
                                                                                    "body": {
                                                                                      "pair": {
                                                                                        "first": {
                                                                                          "application": {
                                                                                            "function": {
                                                                                              "application": {
                                                                                                "function": {
                                                                                                  "typeApplication": {"body": {"variable": "hydra.core.lib.lists.concat2"}, "type": {"variable": "hydra.core.paths.SubtypeStep"}}},
                                                                                                "argument": {"variable": "out"}}},
                                                                                            "argument": {"list": [{"variable": "st"}]}}},
                                                                                        "second": {"literal": {"boolean": false}}}},
                                                                                    "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                                                "type": {"literal": "boolean"}}}}}}},
                                                                    "argument": {
                                                                      "application": {"function": {"variable": "hydra.core.validate.paths.eraseSubtermStep"}, "argument": {"variable": "step"}}}}},
                                                                "cases": [
                                                                  {
                                                                    "name": "mapEntry",
                                                                    "handler": {
                                                                      "lambda": {
                                                                        "parameter": "_",
                                                                        "domain": {"literal": {"integer": "int32"}},
                                                                        "body": {
                                                                          "optional": {
                                                                            "typeApplication": {
                                                                              "body": {
                                                                                "typeApplication": {
                                                                                  "body": {"pair": {"first": {"variable": "out"}, "second": {"literal": {"boolean": true}}}},
                                                                                  "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                                              "type": {"literal": "boolean"}}}}}}}]}},
                                                            "argument": {"variable": "step"}}}}}}}}}}}}}}}}},
                            "typeScheme": {
                              "variables": [],
                              "body": {
                                "function": {
                                  "domain": {
                                    "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}},
                                  "codomain": {
                                    "function": {
                                      "domain": {"variable": "hydra.core.paths.SubtermStep"},
                                      "codomain": {
                                        "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}}}}},
                              "constraints": []}}],
                        "body": {
                          "let": {
                            "bindings": [
                              {
                                "name": "result",
                                "term": {
                                  "application": {
                                    "function": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "typeApplication": {
                                                "body": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.lib.lists.foldl"},
                                                    "type": {
                                                      "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}}},
                                                "type": {"variable": "hydra.core.paths.SubtermStep"}}},
                                            "argument": {"variable": "go"}}},
                                        "argument": {
                                          "optional": {
                                            "typeApplication": {
                                              "body": {
                                                "typeApplication": {
                                                  "body": {
                                                    "pair": {
                                                      "first": {"typeApplication": {"body": {"list": []}, "type": {"variable": "hydra.core.paths.SubtypeStep"}}},
                                                      "second": {"literal": {"boolean": false}}}},
                                                  "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                              "type": {"literal": "boolean"}}}}}},
                                    "argument": {"variable": "steps"}}},
                                "typeScheme": {
                                  "variables": [],
                                  "body": {
                                    "optional": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}},
                                  "constraints": []}}],
                            "body": {
                              "application": {
                                "function": {
                                  "application": {
                                    "function": {
                                      "typeApplication": {
                                        "body": {
                                          "typeApplication": {
                                            "body": {"variable": "hydra.core.lib.optionals.bind"},
                                            "type": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}}}},
                                        "type": {"variable": "hydra.core.paths.SubtypePath"}}},
                                    "argument": {"variable": "result"}}},
                                "argument": {
                                  "lambda": {
                                    "parameter": "stateP",
                                    "domain": {"pair": {"first": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}, "second": {"literal": "boolean"}}},
                                    "body": {
                                      "application": {
                                        "function": {
                                          "application": {
                                            "function": {
                                              "application": {
                                                "function": {
                                                  "typeApplication": {
                                                    "body": {"variable": "hydra.core.lib.logic.ifElse"},
                                                    "type": {"optional": {"variable": "hydra.core.paths.SubtypePath"}}}},
                                                "argument": {
                                                  "application": {
                                                    "function": {
                                                      "typeApplication": {
                                                        "body": {
                                                          "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.second"}, "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                        "type": {"literal": "boolean"}}},
                                                    "argument": {"variable": "stateP"}}}}},
                                            "argument": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.paths.SubtypePath"}}}}},
                                        "argument": {
                                          "optional": {
                                            "wrap": {
                                              "typeName": "hydra.core.paths.SubtypePath",
                                              "body": {
                                                "application": {
                                                  "function": {
                                                    "typeApplication": {
                                                      "body": {
                                                        "typeApplication": {"body": {"variable": "hydra.core.lib.pairs.first"}, "type": {"list": {"variable": "hydra.core.paths.SubtypeStep"}}}},
                                                      "type": {"literal": "boolean"}}},
                                                  "argument": {"variable": "stateP"}}}}}}}}}}}}}}}}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {"literal": {"string": "Erase a subterm path to the subtype path of its type, if wholly within the data fragment"}}}]}}}}},
    {
      "term": {
        "name": "hydra.core.validate.paths.eraseSubtermStep",
        "signature": {
          "typeParameters": [],
          "parameters": [{"name": "arg0", "type": {"variable": "hydra.core.paths.SubtermStep"}, "isLazy": false}],
          "result": {"type": {"optional": {"variable": "hydra.core.paths.SubtypeStep"}}}},
        "body": {
          "annotated": {
            "body": {
              "lambda": {
                "parameter": "step",
                "domain": {"variable": "hydra.core.paths.SubtermStep"},
                "body": {
                  "application": {
                    "function": {
                      "cases": {
                        "typeName": "hydra.core.paths.SubtermStep",
                        "default": {"typeApplication": {"body": {"optional": null}, "type": {"variable": "hydra.core.paths.SubtypeStep"}}},
                        "cases": [
                          {
                            "name": "listElement",
                            "handler": {
                              "lambda": {
                                "parameter": "_",
                                "domain": {"literal": {"integer": "int32"}},
                                "body": {"optional": {"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "listElement", "term": "unit"}}}}}}},
                          {
                            "name": "setElement",
                            "handler": {
                              "lambda": {
                                "parameter": "_",
                                "domain": {"literal": {"integer": "int32"}},
                                "body": {"optional": {"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "setElement", "term": "unit"}}}}}}},
                          {
                            "name": "optionalGiven",
                            "handler": {
                              "lambda": {
                                "parameter": "_",
                                "domain": "unit",
                                "body": {
                                  "optional": {"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "optionalElement", "term": "unit"}}}}}}},
                          {
                            "name": "injectField",
                            "handler": {
                              "lambda": {
                                "parameter": "n",
                                "domain": {"variable": "hydra.core.model.Name"},
                                "body": {
                                  "optional": {"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "unionField", "term": {"variable": "n"}}}}}}}},
                          {
                            "name": "recordField",
                            "handler": {
                              "lambda": {
                                "parameter": "n",
                                "domain": {"variable": "hydra.core.model.Name"},
                                "body": {
                                  "optional": {"inject": {"typeName": "hydra.core.paths.SubtypeStep", "field": {"name": "recordField", "term": {"variable": "n"}}}}}}}}]}},
                    "argument": {"variable": "step"}}}}},
            "annotation": {
              "map": [
                {
                  "key": {"variable": "description"},
                  "value": {
                    "literal": {"string": "The subtype-side analog of a subterm step on the data fragment, or nothing on the computation fragment"}}}]}}}}}]}