- regex style syntax
- deal with [+-?*] suffixes
- probably not actually a problem but it bothers me
- decide how to approach precedence
- using gerunds anyway for seq
- can parse boxed items just as easily as characters
any lit on;:'^([a-z]+\w)|hel.lo*'
- can’t type raw parens in gerund
- but the boxed ‘(’ string is fine
- can use {: }: for grouping
- if using ;: could have parens translate
- [`] for charsets
- +*?|^$ are all valid gerund members
- boxed string literals
- can use {: }: for grouping
- can use {. }. for charsets
but:
- to use this syntax you’re writing a parser for the gerund anyway
- so why not just parse a string?
- no point in doing all of pcre since j already has that:
https://www.pcre.org/original/doc/html/pcresyntax.html
“Regular Expression Matching can be Simple and Fast” https://swtch.com/~rsc/regexp/regexp1.html
- syntax highlight
- push/pop parts of the sentence onto a stack
- swap the items?
- highlights for trains
- ’..’ separator support
- have a simple jod-like dictionary in the background
- find all unique J identifiers in the chunk
- see which ones are undefined
- allow ‘stub’ entries that name a part of speech
- import a text file
- add regexes for tokenizer
- to be used for the lexer
- also base for editor with gutter
(a^b)^c
eq a^(b*c) by rExpMul
eq a^(c*b) by rMulCom
eq (a^c)^b by rExpMul^:_1
Our goal will be to enter this proof into the system.
- [X] Constructor is a dyad.
- [X] Left side is always a string. Use (,x) so that rank=1.
- [X] Right side is always a rank 1 array, so use (,y) too.
- [X] length of result is always >: 1
- [X] rank of result is always 1
- [X] level of result is always >:1
C=:4 :'r=.,x if. #y do. r;,y else. <r end.'
(<'3'C<('3'C<'a'C'^'C'b')C'^'C'c') 5!:0
This is mostly just for reference, because the atomic representation deals with values, not the syntax used to create those values.
j: NB. j: → n:
n: NB. n: $ → n: v: n:
n: v: n: NB. n: v: → (n: v: n:) v:
(n: v: n:) v: n: NB. substitute
(a ^ b) ^ c
'`j n v' =:( 'j:'C])`('n:'C])`('v:'C]) NB. phrases
'`ID NP VP'=:('ID:'C])`('NP:'C])`('VP:'C]) NB. identifiers and
'`CP AP' =:('CP:'C])`('AP:'C]) NB. primitives
j a:
j < n a:
j <n <(<n a:),(<v a:),(<n a:)
j < n < (<n a:),(<v a:),(<n a:)
j < n < (<n <(<n a:),(<v a:),(<n a:)),(<v a:),(<n a:)
walk =: (3 : 'if. 1=#y do. walk each >y elseif. ({.y) e. ID VP NP 0 do. >{: y elseif. do. ;walk each }.y end.')"1
walk ast
“Wadler’s views [Wad87], for example, enable programmers to provide a “virtual representation” of their data that can be pattern-matched against without exposing any implementation details”