forge

House

A house written down the way you would tell someone about it: a room's name, then a sentence a line. is east of the kitchen. is 12 by 11. has a window on the south, 3 feet from the west end. A few sheets of it, each for one trade: what rooms there are and what each stands beside, how big each is and where its doors and windows go, what is fitted in it, how it is finished, what runs through it. An engine reads the sheets, lays the house out, draws the walls between the rooms, and holds the house to Christopher Alexander's patterns, proving each for each room or saying in words what is open and what to do about it. A page of the plan alone is a house already; the other sheets refine it.

It is made for two readers: a person, who can read a sheet aloud, and a language model, which can write one in a few hundred tokens and fix it from what the engine says back, in the same words. The format is the product. The plan draws it, in the browser, from the same engine; the same program runs on the desktop and on Android.

To have one drawn for you, build a house step by step: say what it must have, answer a few questions, and watch the plan drawn a layer at a time, saying what to change before each next one.

A house as sheets

A house is written down the way you would tell someone about it: a room's name, then one sentence a line about it. What it is beside. How big it is. Where its doors and windows are. Numbers are feet unless they say inches. A web page keeps what things are apart from how they measure and look, and a browser lays it out from the two with its own defaults for whatever is left unsaid; the house takes that shape, one sheet for each concern, every sheet naming rooms by the same words.

the living room
 has the front door
 has a window on the south
 opens to the kitchen
 opens to the hall

the kitchen
 is east of the living room
 has a pocket door to the pantry

the hall
 runs along the north side of the living room to the utility room

bedroom 1
 is north of the hall
 has a door to the hall
 has an egress window on the west

That is a plan sheet: the kitchen stands east of the living room, the hall runs along their north side as far as the utility room, a bedroom opens off the hall and has a window a person could climb out of. It lays out at once, each room its usual size. A size sheet says is 20 by 15 and has a door to the hall, 10 feet from the west end; a fit sheet says has a counter along the south wall, from the west end, 10'10" long and has an island 6 by 3 at 7 7'6"; a finish sheet says has an oak floor under every room and has a carpet floor under every bedroom. The whole house above, four sheets, is a page.

The patterns

A house is good or bad in ways that have names. Christopher Alexander gave two hundred and fifty-three of them in A Pattern Language: each a number and a name, the problem it answers, what to do, and two stars where he was sure, one where he was fairly sure, none where it is a start. He meant them as a language: a house is made by taking them in order, the large before the small, each pattern placed in a house the earlier ones have already shaped, and a family is meant to make the language its own. The engine carries the ones a plan can be held to, under his numbers.

patternholdsfor
110 Main entrance **a door to the outside on the house's front sidehouse
112 Entrance transition *that door opens into a porch, foyer, hall or mud room, not straight into the roomshouse
127 Intimacy gradient **no bedroom opens straight off the living, dining or kitchen, and every bedroom is more doors from the front than the living roomhouse
128 Indoor sunlight **a window on the south sideliving dining
132 Short passages *no longer than 25 feethall
138 Sleeping to the east *a window to the eastbed
139 Farmhouse kitchen *an opening or no wall to the living or dining roomkitchen
159 Light on two sides of every room **windows on two outside sidesliving dining kitchen bed office den study
180 Window place *one window at least 5 feet wideliving
191 The shape of indoor space *no side more than twice the otherthe same rooms
196 Corner doors *every door within 3 feet of a cornerthe same rooms
198 Closets between rooms *on a wall the room shares with another roomcloset

Each pattern is a proposition about the house, and the engine proves or fails it for every room it is for, the way a proof checker holds a proof to its statements. A pattern unmet is advice, never an error: a lint named by its number with ** where Alexander was sure, and the line reads as every lint does: the room, the pattern, what is missing, then what to do. ! A159 bedroom 2: light on two sides of every room (159) **; it has windows on one side only, the north; give it a window on a second outside side, or place it at a corner of the house. Some a plan cannot meet: a room between two others has one outside wall. Then gives up light on two sides under the room accepts the goal, and it is shown as given up, not proved, so whoever reads the house sees it. A house writes its own patterns as it writes a room, and writes one of the engine's again, by name, to change it.

a pattern: a view from the sink
 for the kitchen
 is likely
 wants a window on the north
 if not, turn the sink to a window

unlock the grammar by joining

The grammar

Three rules. A sheet is headings and sentences; a heading is a room's name at the start of a line; a sentence is one line indented under it. Nothing else.

sheet      = { heading NL { SP sentence NL } } ;
heading    = "the house" | "the" floor | room's name | "every" kind | "a pattern:" name ;
sentence   = verb phrase { "," clause } ;              verb = is | has | opens to | runs along | fills | faces | gives up | wants | if not

A room's name is whatever the family calls it: the kitchen, bedroom 2, Ella's room, the stairwell. The words say its kind (a bedroom, a bath, a hall, the stairs), or its first sentence does: is a bedroom. Only the headings that mean something else are not names: the house, a floor (the second floor, the basement), every … and a pattern: …. A number is feet unless it says inches or is written 13'8". A size is width across (east to west) by depth (north to south), clear, finished wall to finished wall; the engine adds the walls around it. A place along a wall is the distance from one end to the near edge of what is placed: from the west end (a north or south wall) or the south end (an east or west wall); from the east end counts from the other end to its east edge (the ends are the room's own corners, whatever is beyond the wall), near the west end is a foot from the corner, nothing is the middle. A line starting with # is a comment.

The cascade. The engine's defaults come first, then the sheets in the order they are loaded, then the headings in order. For one room and one thing the later sentence wins, and a named room beats every bedroom whatever the order. A sentence about one thing (a size, a floor, a placement) replaces; sentences about many (doors, windows, counters) add up: three has a window on the north under one heading are three windows. Across sheets, the first north window of a later sheet refines the first of the earlier, the second the second: numbers fill in, words add, and a distance from an end replaces the earlier one with its end (at the east end, then 12'6" from the west end, is 12'6" from the west end). So the plan's has a door to the hall and the size sheet's has a door to the hall, 10 feet from the west end are one door, and a wall with two windows is written twice in the plan and twice in the size sheet, in the same order.

Propositions. A pattern heading is a statement about the house: for what it holds for, wants the test, if not, what to do, is certain or is likely how sure. The engine proves each for every room it is for, or fails it with the room, the pattern, what is missing and the if not. gives up light on two sides under a room accepts an open goal and is shown as such. A pattern written again by name replaces the engine's. The kernel is the three rules, the cascade and the geometry; the patterns are a library written in the language itself, and a house adds to it.

Edits. A change is lines sent to the engine for one sheet: - bedroom 1: has a door to the hall, 10 feet from the west end takes a sentence out, + bedroom 1: has a door to the hall, 8 feet from the west end puts one in at the end of that room, = bedroom 1: the guest room renames a room through the sheet. A - must match a sentence as it reads, spacing aside, or nothing changes and the engine quotes the room. A change that would leave a sheet unreadable is refused; one that leaves the house with a gap or an overlap is taken and the gap reported, since a house being built has them.

Lining up. A room's placement fixes one edge on each axis; its size sets the other, the free edge. When a free edge ends less than a foot from a wall of a room in line with it (beside it, or meeting it at a corner) or from the house's outside wall, the engine moves it onto that wall, and the room's readback says (written 13' by 12'; lined up: the east wall with our bedroom). A room never moves more than that, its placed edges never move, and a move that would make it overlap a room is not made. A heading written twice on one sheet is an error (E31): one room, one block a sheet.

Partis. A house is best begun from a known arrangement, written in these same sentences: the engine keeps six (the cottage, the narrow house, the front-garden house, the ranch, the house with a second suite, the centre-hall house), each a plan sheet that loads with no error and none of the good-house warnings, turned so its front door faces the street. Start from one and change its rooms; keep its bones.

unlock the vocabulary by joining

The vocabulary

The sentences, by the sheet they usually live in. Any sentence may go in any sheet; a sentence the engine does not understand is said back to you, and a finish it does not know (has quartz counters) is kept and shown.

plan
is a bedroomits kind, when the heading does not say (bedroom 1 is a bedroom, the bath a bath): living, kitchen, dining, bedroom, bathroom, hall, closet, pantry, laundry (the laundry closet too: 5'6" by 3' unless said, and noisy), utility, garage, porch, deck, office, den, foyer, mud room, nook, loft, family room, guest room, study, music room, studio, alcove (a recess open to the room it is in or beside; a bay is one, and placed beside a room it adds floor beyond that room instead of taking it), workshop (attached, in the area and noisy; a detached workshop is a shed), sitting room (private-ish, like a den), ramp (outside like a path; rises 2 feet gives its slope, held to 1 in 12), carport (outside and roofed, not counted), shed (an outbuilding, apart from the house, not counted), yard or garden (open ground, in no area: no walls, no roof); the terrace and the patio are decks (is a patio too). A kind the engine does not know (is a gazebo) is an error and the room is not laid out
is 12 by 11 is 11 deep is 6 widethe clear size, inside the finished walls; the engine adds the walls. One side given, the other stretches to the room it is placed against or the room after to. An edge that ends less than a foot from a wall in line with it is lined up with that wall, and the readback says so: whole feet are enough, never inches for the walls' sake. Lining up never shrinks a room you sized to meet the house's outside wall far off, only to meet a room in line with it or to clear an overlap. Size a room on one sheet: two different sizes on two sheets is a W63, the later used
is east of the living roomagainst that room on that side, start corners together; runs along the north side of the living room to the utility room stretches to the far room; , aligned to the far end puts the far corners together; , shifted 2 feet slides along the shared wall; is east of bedroom 2 to the hall stretches it to the far edge of the hall in another row, or to the near edge of a room in its own row; to places it after that room, so do not place that room from it
fills the rest of the rowwith a placement (is east of the half bath), it reaches the house's outside wall on that side, as far as the other rooms go (never through an attached garage), so a row adds up without guessing a width
is in the northwest corner of bedroom 1wholly inside that room, carved from it; is inside the loft at 16'8" 2'6" from its southwest corner
is above the living room and the dining roomon the floor above, filling those rooms; is below …; is on the second floor when nothing else says. A room placed from another (runs along the north side of the well) is on that room's floor unless it says another
has stairs along the west wall, climbing north to the second floorthe stairs, in the plan: against that wall from the end they climb from (, 2 feet from the south end to move them), 3 feet wide unless , 3'6" wide, as long as the floor heights need (risers of at most 7¾", treads of 10": 13 treads, 10'10", for 9 feet). The floor above gets an opening over them, drawn there as the stairs going down; it must lie in a landing, a hall, a loft or a void, and something walkable must be at their top
has the front door has a door to the hall has a door to the outside on the southa door; has a pocket door to the pantry: pocket, bifold, sliding, french, overhead, double (drawn as what they are; a sliding or pocket door has no swing); , with a cat flap, , with a flush threshold. opens to the kitchen a cased opening; has a window on the north; has an egress window on the north one a person can climb out of. has a door to the dining room on the south picks the wall when the two rooms meet on two. A french or sliding door lights a room as a window does
has a hatch to the front porch has a pass-through to the dining room has a serving window on the southan opening at counter height (sill at 3 feet unless said) that things are handed through; it may face a room or a porch
has no wall to the dining roomone space, two names; has a half wall to the dining room, 3'6" high
gives up light on two sidesthis room will not meet that pattern; the goal is accepted and shown, not proved; under the house for a pattern of the whole house
size
is 20 by 15width by depth; is 4 feet deep lets the width reach whatever the room runs to
has a door to the hall, 10 feet from the west end, 3 feet wide, hinged at the eastwhere along the wall, how wide, which end it hangs from; , swinging out; , near the east end; , at the west end
has a window on the north, 5 feet from the west end, 4 feet wide, 2 feet high, head at 7 feeta window placed and sized
has 3 windows on the south, 4 feet wideseveral at once, spaced evenly along the side unless you say , spread to the ends, , together in the middle or , 2 feet from the west end (packed from that end); , 1 foot apart sets the gap between them for the last two (2 feet unless said). Doors too: has 2 doors to the outside on the south
opens to the dining room, at the west end, 8'4" wide, sill at 3'6"a cased opening with a sill: a kitchen bar
fit
has a counter along the south wall, from the west end, 10'10" longa run 25 inches deep and 36 high unless , 1 foot deep, 3'6" high; , as a peninsula sticks out
has the sink on the south wall, 4'6" from the west end, 3 feet longsink, range, dishwasher, fridge, toilet, tub, shower (in any room: a dog shower in the mud room), vanity (a double vanity), corner sink or hand basin (1'6" by 1'2"), washer, dryer, water heater, panel, air handler, oven (a wall oven, and a second one as another line), grab bar, shower seat, litter box (a pet corner); a shower is 3 by 3 unless , 5 feet long, 4 feet deep; has the tub on the north wall, from the west end, 5 feet long, in an alcove
has an island 6 by 3 at 7 7'6"free-standing: its size, then its centre from the room's finished southwest corner; , with a table-height end (3 feet unless a 30 inch table-height end, at the east unless at the west) is drawn as two parts
has stairs at 16'8" 2'6", 3 feet wide, climbing north to the second floorits corner from the finished faces, its width, the way it climbs, the floor it reaches; replaces the plan's has stairs along …
has hooks for two bikes on the east wall has a place for the pram on the west wall has hooks on the north wallbikes hung on the wall (5 by 2 feet, 2 feet clear in front); a parking place for a pram, drawn as a dashed outline whose floor nothing else may take; coat hooks, over anything
has a window seat along the north wall, 6 feet long, with a cave under ita seat with a children's cave under it, drawn as one
finish
has an oak floor has tile walls to 4 feet has a vaulted ceiling has a 9 foot ceiling has quartz counters has flush thresholdsfree words; the engine keeps and shows them. On the finish sheet a door or a fixture named is only words, attached to the room: has grab bars by the toilet, has marble on the baking counter
has a skylight has a skylight over the stairs has a skylight, 2 by 4a skylight, drawn dashed over the room's middle or over the stairs; it lights a room that has no window to spare (W61)
has a fence all round, with a gate on the north has a fence on the north and the east has a gate on the north, 3 feet wideunder a yard, a porch or a deck: a fence along its sides (all round: every side nothing stands against), a gate in it
patterns
a pattern: a view from the sinka heading; under it for the kitchen (or for bedrooms, for the house), is certain or is likely (two stars or one: an error or a hint when unmet), wants a window on the north, if not, turn the sink to a window
wants …light on two sides a window on the east a window at least 5 feet wide no side more than twice the other to be no longer than 25 feet every door within 3 feet of a corner to open to the living room or the dining room to sit between rooms; for the house the front door to open into a porch or a hall the bedrooms behind the living room
the house and the floors
the housefaces south is built to irc 2021 has 2x6 outside walls has 2x4 inside walls has a hip roof at 6 in 12, with 18 inch overhangs has a gable over the living room on the west has a stack at 19'8" 25' has neighbours close on the east and the west; the house may stand on any sheet and they merge, so the roof can go under it on the finish sheet
the second floor the basementis 10 feet up is 9 feet down has 8 foot ceilings (the first floor too); a floor not given a height stands on the one below, its ceiling and a foot of floor. A room is on the first floor unless it says, is above or below something, or is placed from a room upstairs

Fixtures measure from the finished face of the wall; doors and windows from the wall's line. Every fixture has a footprint and a clearance in front of it (a toilet wants 21 inches, a range 30, a washer 36), and a door's swing is a footprint too; the engine says when they meet. A bifold door folds over a closet's rod and shelves but not over a washer or a dryer: a laundry closet wants a sliding or a pocket door. Between two fixtures is the larger of the gap east to west and the gap north to south between their footprints, on one wall or on two.

unlock the engine by joining

The engine

The engine is a long-running process with the house in memory. It listens on a port for one line at a time and answers with lines, the last of them a verdict that starts with a tick or a cross and the house's version. Any program can drive it; a model does, through a tool that sends a line and reads the answer.

file size 38then 38 lines: replaces that sheet whole; answers what moved and the lints
edit size 2 v12then 2 lines of - and +, each a room's heading, a colon and a sentence: a change, all or nothing, refused if the house has moved past v12
roomsone line a room, in feet: where it stands, its clear size, what is on each side and the openings there; the wall lines of each floor; where the stack falls
show the kitchenthe room as the sheets made it, each sentence with the sheet and line it came from, the rooms placed from it, its line, the largest free rectangle in it, its goals, its lints
free the baththe largest empty rectangle once the fixtures and the door's swing are out
goalsevery pattern for every room it holds for: ✓ proved, ✗ open with what is missing, ? given up; the verdict counts the open ones
errorsevery lint: E for what must change, W for what should, each ending in what to do; a two-digit code is the geometry, a three-digit one a pattern by its number
walls openingsthe derived segments and the resolved openings and fixtures, for a drawing
changes v12every edit since that version, as it was sent
sheets sheet size house levels status save

A model is given the skill, the same words as this page in the order a model works, and on the plan a member can ask one to change the house: the sheets go to it with the ask, its sheets come back, are linted by the engine, and are drawn.

What it says back after a change: the rooms the change moved, as ~ the hall moved: 0,15' 40' by 4' > 0,16' 40' by 4', since a room placed against another moves when that one grows; the lints; the line of every room the change touched. What it never asks the model to do is geometry. Positions, walls, clear sizes, unions, clearances and the way from the front door to every room are its own, and come back as numbers.

Look