Simon Forman
2e301fa6c3
word works with negative numbers now.
...
symbols moved to head of machine code.
2019-11-10 10:53:55 -08:00
Simon Forman
4a39d82c75
merge_and_store, chain_link
2019-11-09 21:55:01 -08:00
Simon Forman
cde066eb86
Minor refactor.
...
It doesn't save space (but if I reuse it once it will.)
2019-11-09 21:20:31 -08:00
Simon Forman
2b9034f6d5
Pass through label.
2019-11-09 20:19:15 -08:00
Simon Forman
8405d3f863
if_literal and lookup
2019-11-09 18:39:39 -08:00
Simon Forman
7a821a4eaf
incr stack
...
Really decr, but I'm abstracting.
2019-11-09 18:28:01 -08:00
Simon Forman
67583716f2
Refactoring and cleanup.
2019-11-09 18:15:56 -08:00
Simon Forman
04b021846a
load
2019-11-09 18:02:07 -08:00
Simon Forman
8ee9a05780
Bleah.
2019-11-09 15:20:06 -08:00
Simon Forman
e4c17f8c24
Base address in unpack_pair.
2019-11-09 15:12:44 -08:00
Simon Forman
bcadc95aa3
unpack_pair
2019-11-09 15:03:17 -08:00
Simon Forman
a1ecea341a
Minor refactor.
2019-11-09 14:02:18 -08:00
Simon Forman
c211848d5c
Refactoring, with oddball quoting "symbols".
2019-11-09 13:59:06 -08:00
Simon Forman
a38d8153cd
That works nicely, again.
2019-11-09 13:42:14 -08:00
Simon Forman
b7659bdeaa
Convert to ? DCG and it's macro-time!
2019-11-09 13:34:51 -08:00
Simon Forman
632161b6d1
I think that does it for cons.
...
Offsets in pair records can be negative.
2019-11-09 12:14:51 -08:00
Simon Forman
ab0ff48c54
That's the mainloop converted to permit negative offsets.
2019-11-09 12:03:13 -08:00
Simon Forman
9ce9d967cf
Minor cleanup, bug fixes.
2019-11-09 11:27:29 -08:00
Simon Forman
3c796310a5
Minor bugfix.
...
asr not ror.
2019-11-08 15:24:09 -08:00
Simon Forman
4c13868e7c
Cons
2019-11-08 14:06:28 -08:00
Simon Forman
d67420ae68
Just do it in asm.
2019-11-08 08:08:53 -08:00
Simon Forman
5172be7a0a
hmm...
2019-11-07 20:21:26 -08:00
Simon Forman
3f843ed4cc
WIth push2 finished that's the mainloop converted.
2019-11-07 17:25:04 -08:00
Simon Forman
65d55cf7b4
lookup
2019-11-07 16:28:28 -08:00
Simon Forman
7bab15c64a
if_literal
2019-11-07 16:15:41 -08:00
Simon Forman
0ce64f2ec4
A start on converting the mainloop.
2019-11-07 15:53:07 -08:00
Simon Forman
b924350c6d
Take two on the compiler.
2019-11-07 14:57:41 -08:00
Simon Forman
53ef16bee4
Minor cleanup.
2019-11-07 07:55:01 -08:00
Simon Forman
3751107a09
Modify error reporting a lil; words word.
2019-11-07 07:54:04 -08:00
Simon Forman
99f9534a10
Call for_serial/2
2019-11-07 07:43:21 -08:00
Simon Forman
22b34aba05
Using partial deduction to inline literals, functions, and combinators.
2019-08-22 15:45:24 -07:00
Simon Forman
558f45bf47
minor cleanup
2019-08-20 22:00:27 -07:00
Simon Forman
6e646c012f
small func recognizes [] and [X].
2019-08-19 22:02:06 -07:00
Simon Forman
b59e70f96d
Rename bar to korf and some docs.
2019-08-18 16:59:31 -07:00
Simon Forman
26c2730273
minor cleanup
2019-08-18 12:17:37 -07:00
Simon Forman
7d44742317
reintroduce definition of fork; it doesn't shadow func(fork, ...).
2019-08-18 11:47:48 -07:00
Simon Forman
a5fb17cc48
read child output after local thun/3
2019-08-18 11:09:36 -07:00
Simon Forman
2057d9ee74
truly fork, sort of
2019-08-18 10:53:25 -07:00
Simon Forman
11fdc81409
minor cleanup
2019-08-13 11:58:31 -07:00
Simon Forman
8116b83086
Minor cleanup.
2019-08-13 11:51:41 -07:00
Simon Forman
bbc0f750bc
Move DCG stuff to own file.
2019-08-13 11:48:08 -07:00
Simon Forman
defedcbd12
Parse ints; move line/{1,2} to main.pl.
2019-08-13 11:29:49 -07:00
Simon Forman
3f19b2b210
Parse floating point numbers.
2019-08-13 11:24:28 -07:00
Simon Forman
4c78a31bd9
minor cleanup
2019-08-12 22:29:09 -07:00
Simon Forman
d22e6e86dc
minor cleanup
2019-08-12 21:59:19 -07:00
Simon Forman
86bf875841
Numbers can be followed by space or [.
2019-08-12 21:29:26 -07:00
Simon Forman
8947dff010
Parse negative numbers.
2019-08-12 21:13:11 -07:00
Simon Forman
143b711028
swapd function
2019-08-12 21:08:35 -07:00
Simon Forman
aae0e91c44
assert_defs/1 got upset about not finding combo/5
2019-08-12 21:08:17 -07:00
Simon Forman
e67ef3951c
Minor cleanup of the parser.
2019-08-12 20:59:02 -07:00
Simon Forman
120610cd6b
rework parser DCGs
2019-08-12 20:12:35 -07:00
Simon Forman
b25ef2d5f7
Oops! Regression.
2019-08-12 19:25:13 -07:00
Simon Forman
dd42c7c0bc
minor cleanup
2019-08-12 19:17:15 -07:00
Simon Forman
cae79ded8f
swoncat and fiddling with parser.
2019-08-12 19:09:49 -07:00
Simon Forman
2e1f598aa2
Experiment with putting logic vars on the stack.
2019-08-11 21:30:02 -07:00
Simon Forman
222c472449
Remove a cut that sucked.
2019-08-11 20:45:49 -07:00
Simon Forman
40148fced9
unstack, least_fraction
2019-08-11 19:57:28 -07:00
Simon Forman
7a4e58fe15
Copyright notices.
2019-08-11 19:41:11 -07:00
Simon Forman
afec650c7b
The sqrt/1 predicate wasn't working.
2019-08-11 19:35:05 -07:00
Simon Forman
79aa2f972d
Multifile func/3.
2019-08-11 18:45:57 -07:00
Simon Forman
cd60816429
Build math & comparision functions.
2019-08-11 17:48:29 -07:00
Simon Forman
ab454375c0
Clean up REPL formatting.
2019-08-11 17:00:38 -07:00
Simon Forman
4d33f32674
Don't shadow funcs and combos.
2019-08-11 15:12:56 -07:00
Simon Forman
adf0e96f84
Don't shadow funcs & combos.
2019-08-11 14:56:20 -07:00
Simon Forman
9e180e8173
Extract mainloop to own file.
2019-08-11 14:51:13 -07:00
Simon Forman
6bc1b5ec8b
Use double-quoted string for codes.
2019-08-10 22:21:57 -07:00
Simon Forman
f6705f3fa0
cleanup old files
2019-08-10 22:07:17 -07:00
Simon Forman
e49b0b70cb
Build defs.pl from defs.txt.
2019-08-10 22:03:44 -07:00
Simon Forman
90bccece6a
build defs.pl
2019-08-10 21:46:48 -07:00
Simon Forman
731c59088e
build defs.pl
2019-08-10 21:45:59 -07:00
Simon Forman
32e77f6d73
Move parser to own file.
2019-08-10 20:57:11 -07:00
Simon Forman
3af9e7e174
map combo
2019-08-10 20:42:48 -07:00
Simon Forman
c8c1df8d88
Bring in funcs and combos.
2019-08-10 20:12:41 -07:00
Simon Forman
ab587beaa9
Omit Prolog toplevel.
2019-08-10 20:06:12 -07:00
Simon Forman
dc5737eb45
Do not need thses files.
2019-08-10 20:03:52 -07:00
Simon Forman
1d31ca99c3
Fold in parser, main loop, and support.
2019-08-10 19:57:00 -07:00
Simon Forman
fd5f54992a
Rename foo to thun.
2019-08-10 19:25:48 -07:00
Simon Forman
1ce9544bcc
Make a version for GNU Prolog compiler.
2019-08-10 12:19:09 -07:00
Simon Forman
10a23c5c68
Also don't shadow combinators.
...
(I realized that the way defs are parsed now means that each def
(but the last) is first asserted with the wrong definition expression
(it includes the symbol of the following definition at the end) and
then the parser figures out that there's another defintion following
and re-asserts the correct expression. It would be nice to fix that
but it's kind of a PITA. I used to build a list of definitions and
then assert them all at the end. For now there aren't enough defs to
justify the extra work.
2019-08-09 16:58:34 -07:00
Simon Forman
cbf2af18e5
Prevent definitions from shadowing functions.
2019-08-09 16:53:40 -07:00
Simon Forman
49491bceef
Demo grow/shrink.
2019-08-09 16:37:33 -07:00
Simon Forman
b9ae00cecb
A few more functions.
...
reverse, shift, shunt, take, split_at
2019-08-09 07:26:37 -07:00
Simon Forman
712f0a0267
merge
2019-08-07 23:36:38 -07:00
Simon Forman
976b8302be
grow/shrink as DCGs.
2019-08-07 23:28:28 -07:00
Simon Forman
4ea77cf1be
Integer DCGs that work in both directions.
2019-08-07 11:40:49 -07:00
Simon Forman
0048ee212d
loop combinator handles ambiguity.
...
remove some old notes.
2019-08-04 09:28:01 -07:00
Simon Forman
177d6cd433
Experiment in formatting stacks for output.
...
Tracing, sort of...
2019-08-03 19:01:45 -07:00
Simon Forman
3b1a89d1c4
Minor refactor.
...
crbo/4 to to_fixed_point/3
2019-08-03 19:01:00 -07:00
Simon Forman
cb0078f3bc
Gnarly fun with metaprogramming.
2019-08-03 17:56:25 -07:00
Simon Forman
2ba9242b76
Comparisions are literals too.
...
Also a bunch of reformatting.
Maybe I can modify the term_expansion/2 to also write the literal/1 clauses for math and comps?
2019-07-22 10:25:34 -07:00
Simon Forman
97a99ac3c4
Bits of formatting.
2019-07-22 10:04:32 -07:00
Simon Forman
df94c8feed
Minor cleanup.
2019-07-21 18:48:11 -07:00
Simon Forman
66d8a3be47
Remove write_state/5.
2019-07-21 17:56:34 -07:00
Simon Forman
6818abb3ce
Build a list of the moves taken.
2019-07-21 17:55:19 -07:00
Simon Forman
523cb3913b
Refactor a bit.
2019-07-21 17:25:22 -07:00
Simon Forman
c1442945a6
Assert definitions as they are read.
...
Instead of building a list then asserting them all after parsing.
2019-07-21 14:13:48 -07:00
Simon Forman
482ac3023e
Messing with TLA+ in Prolog.
2019-07-21 11:50:27 -07:00
Simon Forman
32d5953f29
Implement map combinator.
2019-07-21 08:28:56 -07:00
Simon Forman
84a2de7790
Tiny edits. Almost nothing.
2019-07-21 07:32:20 -07:00
Simon Forman
1b5d1c0b82
Remove cuts from branch combinator.
2019-07-20 19:34:56 -07:00