Commit Graph

75 Commits

Author SHA1 Message Date
97fcae9c2c Tweak render rules to handle precedence
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-25 18:32:15 -08:00
c192193c57 Add some more builtins to support rendering rules
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-25 18:24:55 -08:00
287562619d Use 'value' for textarea inputs
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-25 13:51:44 -08:00
7d07b2dee9 Put lazy2 back
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-25 13:45:40 -08:00
10d1edbc32 Add error reporting
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-25 13:42:20 -08:00
aac1c7f961 Rename some parser functions in ObjectLanguage.elm
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-25 11:51:50 -08:00
bc83f0ed53 Add bidirectional inference for int(?x) and str(?x).
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-22 21:59:41 -08:00
12d823e944 Configure prommpts via a Bergamot program, too.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-22 15:58:52 -08:00
9fd60b4013 Reorganize the UI somewhat and add conclusion-only view
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-22 15:22:46 -08:00
aa7fd44a6d Slightly tweak code for proving a term
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-22 14:39:52 -08:00
da470f5caa Add an occurss check to avoid infinite terms
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-22 14:39:35 -08:00
abd6a848f8 Add support for editing the meta rules
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 16:57:46 -08:00
535c714b47 Remove yields and switch to depth-based gas.
This considerably speeds up forward inference, but we do get lost when
trying to prove more difficult things, or doing backwards search.

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 16:47:56 -08:00
363e52ec5e Switch entirely to using rules to render rules.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 14:45:04 -08:00
84c79ddb50 Render sections in widget
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 14:06:37 -08:00
678e51f146 Allow implicit sections to have more than one rule
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 14:06:10 -08:00
401883c1da Update the object language parser to use 'number' and 'string'
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 14:05:03 -08:00
fd301806c6 Add sections to the language syntax
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-21 13:31:53 -08:00
18d524a0d2 Avoid checking for out-of-gas on each 'andThen'
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-02 23:46:24 -08:00
d6d610c038 Save the current rules I'm using for rendering LaTeX.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-02 00:27:41 -08:00
11dd5ee9fd Put render rules separately from regular rules
This should let us hide them from the user and maybe speed up rendering

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-02 00:25:23 -08:00
1d3f3fd3f8 Use 'lazy' to speed up re-rendering
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-02 00:07:01 -08:00
f964a60412 Perform metavariable substitution from quoting
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-02 00:06:33 -08:00
1fca9171b1 Unify conclusion before instantiating premises to save some time
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 23:40:29 -08:00
12fa4dc1fd WIP: Use bergamot to render inference rules.
Not the proof trees yet, but it should be about the same.
2023-12-01 23:31:43 -08:00
549527d0cc Add a 'call' primitive
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 18:15:32 -08:00
905b760dd7 Fix a few bugs with encoding / decoding strings
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 18:15:17 -08:00
a1ae15d84c Add a new builtin to identify symbols
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:56:27 -08:00
012c1b0d0c Extract common utility functions and convert symbols to strings
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:40:39 -08:00
1e12dc8032 Ensure metavariables aren't re-used in rules and queries
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:35:22 -08:00
f4619672a9 Implement more builtins
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:26:34 -08:00
faa65ff77b Don't encode '\n' for now
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:26:08 -08:00
66fbfd1962 Add necessary escape characters for LaTeX and pretty printing
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:25:39 -08:00
22f3937523 Fix a parser bug to parse '1' as IntLit
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 16:24:19 -08:00
3232d80376 Add syntax sugar for lists
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 14:11:40 -08:00
a8f07dd422 Tweak pretty printing of LaTeX
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 14:09:12 -08:00
e659172320 Add a builtin rule for string concatenation
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 13:10:51 -08:00
546265f2e6 Add string literals to the term language
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 12:55:11 -08:00
45a04cc59c Add a mode for entering the object language to parse
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-12-01 11:31:38 -08:00
51c78af138 Add an initial parser for the Bergamot 'object language' 2023-11-30 22:44:20 -08:00
d9f9522365 Add a tab to switch between editor and rendered view 2023-11-30 21:29:37 -08:00
bb18c8bd8c Tweak the HTML tags generated by Bergamot.
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-29 22:20:55 -08:00
524796d74f More strictly control what goes into elm.nix 2023-11-30 04:22:02 +00:00
cd2d6366b0 Add a flake file to build the project 2023-11-30 04:02:58 +00:00
a34e143408 Add Nix-specific generated dependencies
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-29 19:47:30 -08:00
e1c6e5e83f Use 'gas' instead of yields to limit recursion
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-26 21:28:27 -08:00
9d287a37d5 Add flags for setting rules and query before starting
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-26 20:53:31 -08:00
f30752a2c6 Minor tweaks to pretty printing and CSS
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-26 20:48:48 -08:00
e0532fb581 Fix the parser and add more syntax pretty printing
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-26 20:44:27 -08:00
ff1ea05784 Add yielding to help proof search
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2023-11-26 17:17:10 -08:00