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: add tree-kdl subcommand #6

Merged
merged 3 commits into from
May 13, 2024
Merged

cli: add tree-kdl subcommand #6

merged 3 commits into from
May 13, 2024

Conversation

uakci
Copy link
Contributor

@uakci uakci commented May 12, 2024

Hey, and it looks nice too:

image

(One thing that I'm not very fond of here is how the leaf nodes are quoted – the KDL spec does not require this but kdljs won't consider whether a value can be left unquoted, unlike with identifiers for example. Might PR this since the library appears nascent.)

(edit for posterity: the spec does in fact require these to be quoted, so it’s all fine)

@uakci uakci requested a review from lynn May 12, 2024 18:09
@uakci
Copy link
Contributor Author

uakci commented May 13, 2024

OK, went ahead with the denotation (pretty)printing agenda but replaced KDL with JSON with nice type annotations that could be expanded into stubs later down the line. Also made the printing pretty because that’s what we deserve here at kuna HQ:

[ { "claim": { "apply": { "constant": "assert" },
               "to": { "lambda": "s0",
                       "body": { "claim": { "some": "v0",
                                            "body": { "infix": "and",
                                                      "left": { "infix": "subinterval",
                                                                "left": { "apply": { "constant": "temporal_trace" },
                                                                          "to": { "variable": "v0" } },
                                                                "right": { "variable": "i1" } },
                                                      "right": { "verb": "taı",
                                                                 "args": [ { "constant": "ji" },
                                                                           { "variable": "e0" } ],
                                                                 "event": { "variable": "v0" },
                                                                 "world": { "variable": "s0" } } } },
                                 "presupposing": { "some": "v0",
                                                   "body": { "infix": "and",
                                                             "left": { "infix": "subinterval",
                                                                       "left": { "apply": { "constant": "temporal_trace" },
                                                                                 "to": { "variable": "v0" } },
                                                                       "right": { "variable": "i0" } },
                                                             "right": { "verb": "raı",
                                                                        "args": [ { "variable": "e0" } ],
                                                                        "event": { "variable": "v0" },
                                                                        "world": { "variable": "s0" } } } } } } },
    "presupposing": { "some": "v0",
                      "body": { "infix": "and",
                                "left": { "infix": "subinterval",
                                          "left": { "apply": { "constant": "temporal_trace" },
                                                    "to": { "variable": "v0" } },
                                          "right": { "constant": "speech_time" } },
                                "right": { "infix": "and",
                                           "left": { "infix": "equals",
                                                     "left": { "apply": { "apply": { "constant": "agent" },
                                                                          "to": { "variable": "v0" } },
                                                               "to": { "constant": "real_world" } },
                                                     "right": { "constant": "ji" } },
                                           "right": { "verb": "nıka",
                                                      "args": [ { "variable": "e0" } ],
                                                      "event": { "variable": "v0" },
                                                      "world": { "constant": "real_world" } } } } } } ]

@uakci uakci requested a review from lynn May 13, 2024 18:13
@uakci uakci merged commit 9914b49 into main May 13, 2024
10 checks passed
@uakci uakci deleted the kdl branch May 13, 2024 18:38
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.

2 participants