Commit Graph

217 Commits

Author SHA1 Message Date
Oliver Payne 6e08a14960 Complete up to exercise 4.59 2024-04-09 23:08:14 +01:00
Oliver Payne 3978de8110 Complete up to exercise 4.56 2024-04-03 23:11:09 +01:00
Oliver Payne 911dc3512d Fix error with eval in query.rkt
Racket handles the initial environment a bit differently to MIT scheme.
2024-04-03 23:10:33 +01:00
Oliver Payne 69d6bb6a37 Racket version of query interpreter 2024-03-23 23:05:38 +00:00
Oliver Payne 7a16a3efd8 Add exercise 4.53 2024-01-30 22:48:03 +00:00
Oliver Payne c07eef9e9e Move exercises 4.50 and onwards out of amb-natural-language.rkt 2024-01-30 22:25:52 +00:00
Oliver Payne 2d7944f89b Add exercise 4.52 (if-fail) 2024-01-30 22:22:23 +00:00
Oliver Payne 174d563782 Add exercise 4.51 2024-01-30 19:41:57 +00:00
Oliver Payne 3632855fe5 Add possibly useful utility procedures 2024-01-30 18:01:24 +00:00
Oliver Payne 6529021476 Add exercise 4.50 2024-01-30 17:59:40 +00:00
Oliver Payne 804d66afdb Add Exercise 4.49 2024-01-12 22:58:37 +00:00
Oliver Payne 43d230f0e6 Exercise 4.48: add parsing complex sentences 2024-01-12 22:35:22 +00:00
Oliver Payne b99442949d Exercise 4.48: add parsing of adjectives 2024-01-08 23:02:00 +00:00
Oliver Payne dfd65eed08 Add exercise 4.47 2024-01-04 22:59:53 +00:00
Oliver Payne 2caab6255f Add exercise 4.46 2024-01-04 22:56:06 +00:00
Oliver Payne a3b0a23812 Reformat output 2024-01-04 22:55:35 +00:00
Oliver Payne 3a8944ad0b Formatting fix 2023-11-30 23:24:17 +00:00
Oliver Payne cb17f567b8 Add exercise 4.45 2023-11-23 22:47:06 +00:00
Oliver Payne 78bfc38b81 Add output for original 8-queens in exercise 2.42 2023-11-17 21:50:39 +00:00
Oliver Payne 1bc48e4e78 Add amb-8-queens.rkt (exercise 4.44)
Currently fixed for n = 8.
2023-11-17 21:48:52 +00:00
Oliver Payne 1c6d87d844 Rewrite 2.42 more clearly and add 2.43 (was missing) 2023-11-15 23:02:06 +00:00
Oliver Payne 32eabfa3e0 Add map to amb-utilities 2023-11-15 22:47:11 +00:00
Oliver Payne 3d5db17a33 Add racket version of original 8-queens for comparison 2023-11-12 22:29:12 +00:00
Oliver Payne a1fb98ddad Tidy up code and add second part of exercise 4.42 2023-11-09 23:06:19 +00:00
Oliver Payne 1f0a3948b2 Fix an error in ambeval that cleared the environment after each problem 2023-11-09 21:55:49 +00:00
Oliver Payne d6591f3169 Better solution for fathers and daughters 2023-11-09 20:04:00 +00:00
Oliver Payne a98257368e First cut at fathers-daughters
Not quite working yet, but feels close
2023-11-07 23:14:09 +00:00
Oliver Payne 23278d7ad4 Add exercise 4.41 2023-11-06 22:32:58 +00:00
Oliver Payne 6e6c4dd8d0 Add exercise 4.40 2023-11-05 22:35:10 +00:00
Oliver Payne d794e64d06 Completed up to exercise 4.40 2023-11-04 21:22:55 +00:00
Oliver Payne 6df1a27539 Add primitive timing to ambeval
This shows the cumulative number of milliseconds in the current problem
2023-11-04 21:16:57 +00:00
Oliver Payne a457194e11 Refactoring 2023-11-04 21:16:20 +00:00
Oliver Payne fd1d3682f3 Move timing out into a separate module 2023-11-04 21:13:32 +00:00
Oliver Payne a16df8cca2 Add exercise 4.38 2023-11-01 22:57:51 +00:00
Oliver Payne 34400a1bc4 Add amb utilities that are loaded at startup 2023-11-01 22:50:31 +00:00
Oliver Payne f769d990ec Add exercise 4.37 2023-11-01 22:41:55 +00:00
Oliver Payne 0e99db8285 Add exercise 4.36 Pythagorean triples 2023-10-24 23:04:28 +01:00
Oliver Payne 5002cfe4aa Add exercise 4.35 2023-10-20 17:30:57 +01:00
Oliver Payne 32988a58a2 Initial integration of racket version of ambeval
Some of this should probably be refactored in the same way the other
evaluators were.
2023-10-19 23:01:00 +01:00
Oliver Payne c2f671c8dd Add test integral from the book 2023-10-19 22:29:06 +01:00
Oliver Payne 255723b1fe Fix bug where lazy pairs used excessive amounts of memory
This change makes cons a procedure created at startup, capturing the
environment once rather than each time a pair is created.
2023-10-19 22:16:25 +01:00
Oliver Payne a358de17d3 Exercise 4.34: Pretty printing of lazy pairs
This change makes cons a special form that returns a tagged
procedure.  This tag is used to distinguish it from normal procedures
when printing out the pair.  Apply is modified to skip over the tag
and apply the procedure as normal.
2023-10-14 22:42:22 +01:00
Oliver Payne 51d71bbfb5 Exercise 4.33: transform quoted pairs into cons for lazy lists
This turns a quoted expression into one or more conses.  If these are
defined to be the lazy versions, then we will get lazy lists.
2023-09-09 23:19:11 +01:00
Oliver Payne 01cb1c69dd Use lazy-eval rather than actual-value for stored programs
We don't care about the actual value, because these are just defines,
so we only need their side effects.
2023-09-09 23:17:56 +01:00
Oliver Payne d9f84f1ca1 Add tracing for syntax 2023-09-03 22:56:50 +01:00
Oliver Payne f5ca407f3e Add lazy lists from the book 2023-09-01 23:15:30 +01:00
Oliver Payne c5418454ed Add exercise 4.28 2023-08-14 22:58:10 +01:00
Oliver Payne 9eb77c7e02 Add files provided with the book
Just in case they become unavailable later.
2023-08-13 22:32:53 +01:00
Oliver Payne 1d4447ad2b Add missing file for exercise 3.43 2023-08-13 22:32:15 +01:00
Oliver Payne c6ccffce8a Add missing code for 4.1 2023-08-13 22:30:21 +01:00