loa

Virtual machine for the Logic of Assumptions
git clone git://juanmeleiro.mat.br/loa
Log | Files | Refs

commit 8da2cc4dbdb425d56384cce0612fbd6a4c8a47f4
parent 7d12dd1a564c85f780c8aed3b463b7e3bf46ab25
Author: Juan F. Meleiro <juan@juanmeleiro.mat.br>
Date:   Thu,  9 May 2024 15:47:41 +0200

Add a syntax test

Diffstat:
Acoding/test.zen | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mcoding/zen.c | 10+++++-----
2 files changed, 69 insertions(+), 5 deletions(-)

diff --git a/coding/test.zen b/coding/test.zen @@ -0,0 +1,64 @@ +@ being + +^ attitude precontext +fill name wft +{ vars var + fill name a + { rest nil } } +{ pressupositions nil } + +^ attitude precontext +fill name is +{ vars var + fill name a + { rest var + fill name b + { rest nil } } } +{ pressupositions cons + { car term + fill head wft + { subterms cons + { car term + fill head b + { subterms nil } } + { cdr nil } } } + { cdr nil } } + +^ assumption precontext +fill name type_is_wft +{ subcontext being } +{ judgment term + fill head wft + { subterms cons + { car term + fill head a + { subterms nil } } + { cdr nil } } } +{ proof done } + +^ assumption precontext +fill name any_type_is_wft +{ subcontext assumption + fill name a_is_type + { judgment term + fill head is + { subterms cons + { car term + fill head a + { subterms nil } } + { cdr cons + { car term + fill head type + { subterms nil } } + { cdr nil } } } } + { precontext being } + { subcontext being } + { proof done } } +{ judgment term + fill head wft + { subterms cons + { car term + fill head a + { subterms nil } } + { cdr nil } } } +{ proof done } diff --git a/coding/zen.c b/coding/zen.c @@ -77,15 +77,15 @@ get_status(garden *g) op_type symbol_to_op(symbol s) { - if (s == intern("start")) + if (s == intern("start") || s == intern("@")) return OP_START; - else if (s == intern("fill")) + else if (s == intern("fill") || s == intern("!")) return OP_FILL; - else if (s == intern("done")) + else if (s == intern("done") || s == intern("}")) return OP_DONE; - else if (s == intern("sub")) + else if (s == intern("sub") || s == intern("{")) return OP_SUB; - else if (s == intern("sup")) + else if (s == intern("sup") || s == intern("^")) return OP_SUP; else return OP_NOOP;