without an e

beware of forward chaining [12/20/2006 06:21:28]

Warning: long, rambling, meta-introspective self-reflective forward chaining stream of consciousness rant ahead.

I admit it. I am a forward chainer.

As a forward chainer, I'm rarely bored and I come up with all kinds of cool ideas, but forward chaining naturally leads to excess:

A perfect example: right now, as I type this, my mind is on chess. I was going to say that chess is a perfect example of a forward-chaining game, but then I realized it only seems that way to me because of how I play chess. I play like a computer: asking "what would happen if I did this?" for a large number of moves. But unlike a computer, I can't follow all the chains and pick the best one. Forward chaining works great for computers, but not so great for me. The best players, though, only consider one or two moves each turn. Could it be because they only consider the moves most likely to get them what they want?

These sorts of tangents run through my brain all the time, and I often have trouble distinguishing between productive and unproductive lines of thought. I know for certain I'm off track whenever my thoughts turn to lojban, but most of the time it's not so cut and dry. :)

Another thing I've been thinking about lately is super-powers, and how super heroes tend to use their power as the answer to every problem. I was thinking about how abilities such as persuasion, marketing, programming, and so on work the same way. To a marketer, everything is a marketing problem. To me, everything seems like a programming problem - or at least a system-manipulation problem of some kind (perfect example: learning piano by writing piano training software). Forward chaining might be such a "super-power" because I sure do come up with some clever stuff some times. But it's the type of power you gotta learn to control, or else it's going to wreak havoc.

One alternative to forward chaining, is (of course) backward chaining.

I was going to write a post called Writing for Real. The difference between what I do here and "real" writing is that with the real writing, I'd organize my thoughts. The important stuff would come first, and I'd have a thesis and I'd think a lot about the reader, and where I want to take them. Then I'd work backwards to figure out how to get them there. This is the essence of backward chaining.

Sometimes putting a different label on things makes a huge difference. One of the seven habits of highly effective people is "begin with the end in mind". Another is "be proactive". Both of these hint at the idea of backward chaining. I try to follow both of these habits, but I guess in my mind, they were reserved for bigger issues. For example, my list of 1-year goals is very much along these lines, but I still have a hard time really visualizing what it means to "release my web framework" or "spec and implement tangentstorm".

Until now, my approach to my goal has been very much about the next action. What's the next action for tangentstorm? Well, one feature it will have is an outliner, so I made an outline class. The "next action" concept, as described by David Allen in Getting Things Done, is very much about forward chaining. I mean, you could have your entire project planned out, working backwards from the goal, and then when it comes time to ask what's the next action? you can just look it up on the plan. But that's not how Mr. Allen describes it.

In the Getting Things Done system, you have this thing that you don't know what to do with (he calls it "stuff") and you figure out the next action. Basically, you consult your intuition and come up with a small step that will lead you toward the bigger goal. Then you chain backwards from this small step until you find the action you can physically do. (For example, if the step you come up with is call Bob, the next action might actually be to ask Sally for Bob's number.) So basically, GTD shows one way to combine forward and backward chaining.

One problem I see with the GTD approach is that sometimes the next actions I come up with seem to bring me closer to the end goal, but then it turns out the path I was following is a dead end, and I have to come up with a new path to the end goal. This is a common problem with forward chaining, and of course the solution is to backtrack.

(Oh yeah: by the way, forward chaining, backward chaining, and backtracking are all terms from the development of expert systems and logic programming. So I'm using the terms in a technical sense, though fuzzed up a bit because I'm talking about brains rather than computers.)

In his book, It's Not Luck, Eli Goldratt presents a set of thinking tools, many of which are all about forward and backward chaining:

(Also handy are the classic PERT and Gantt charts, though these fit better with larger, multi-person projects.)

I use all these tools from time to time, whenever I set a big goal. I also use an outliner. But the software I have available to me is crude. Each piece of software gives me only one view of my thoughts (granted, tinderbox has both outline and map views, but the map view doesn't work the way I want). So my drawings don't talk to my outlines and my outlines don't talk to a database, so it's hard for me to take an idea from concept, to plan, to a task list I can share with other people, and so I'm constantly wanting to create a new tool that works better for me.

The "tangentstorm" program I keep talking about is of course my answer to these problems. It's a diagramming tool and an outliner, and it can talk to the same amorphous backend database that my web stuff uses. It's on the goal list because I was tired of half-starting it and then deciding something else was more important before I got anywhere with it. I wanted to just sit down and write it once and for all.

I really think that having tangentstorm working will make me a better backwards chainer, and provide me with a tool for choosing how and when to unleash my forward chaining superpowers. :)

But.

Well... I can't shake the feeling that I'm onto a core problem here. It's not sufficent to be a better backward chainer a few hours a week when I'm planning out my day or the goals for the week. If so many of the problems I listed at the top of this post are caused by one mode of thinking, then maybe I should make an effort to change that one thing. How hard can it be to stop whatever I'm doing and ask myself am I working toward a clear goal here? In places, it could be as simple as making sure I have a grocery list before I go to the store.

Well, let's try it. Am I working toward a clear goal with this post? No, I'm just exploring an idea. It's fun. It seems educational. I feel like I'm getting a benefit. I suppose the reason I sat down was to think about forward chaining and whether it really is a major cause of my problems. I suppose I've convinced myself that it is, so now I'm just... Well forward chaining about that idea.

I should note that forward chaining logic is still logic. It's not about being irrational, it's about how you choose what to think rationally about.

See, but here's my problem. Whenever I get to a point like this... Well, I feel I've gained some insight here, but I'm not sure what to do with it. I guess what I'm thinking is that if I could get in the habit of backward chaining as the default -- on a minute to minute basis, and not just for the big things -- then I'd be a lot more effective.

The disconnect is that backward chaining means looking at my list of goals and focusing on those. And here I'm chaining forward on something and I don't know if it connects to those goals or not. That's the whole point of forward chaining. I come up with tons of cool ideas, but I'm off on a tangent. And of course this one is particularly tricky because it's not about my goals but about my strategy for meeting my goals. Going down my list here, I see that every one of these goals would benefit from better backwards chaining and less forward chaining.

I suppose what I've done here is create a very rough current reality tree in my mind showing how a bunch of problems boil down to a core problem, and now I'm sort of half-visualizing the corresponding future reality tree where all these problems get solved if I somehow change my habitual way of thinking. I haven't filled in all the links, though, and my mind is already working on the problem of how I'd make this happen, before I even see how it needs to work in order to reach my goals.

I'm stuck. I see the direction, but I don't see the connection.

... Just went to grab Six Thinking Hats off my shelf only to discover I no longer seem to own it. Probably for the best. Why did I want it? Because I don't know where I'm going with this idea and I wanted a list of things to try. I approach a lot of problems this way. Forward chaining. My bad.

Okay, so... Why am I still doing this? Because I feel like I have something actionable here that will help me reach all my goals much more quickly, but I yet see how to apply it. So I'm looking to test out a bunch of ways to apply the idea, and see if any of those are interesting. Holy crap. I just can't stop.

What would backward chaining look like, then?

I'd begin with the end in mind. The goal is to reveal to myself how each of my goals is much more doable once this idea is applied. And either I'll figure out how, or I would realize I'm wrong and toss this whole idea. But I don't think I'm wrong.

So, working backwards, my search begins with my lists of goals: my 12 personal goals, and the 14 or so goals I've listed out for my company. Well, obviously, some of these are projects, and the way to chain backwards would be to make a project plan, either as a pert chart or a prerequisite tree, or a transition tree. So I could go down the list, and make plans for each project goal.

Negative branch: this is not "agile". What does that mean? I mean I could spend months doing nothing but detailed planning, and not actually get any work done. A refinement would be to prioritize the project list, and do one thing at a time. In other words, make it a depth-first backward chain rather than breadth first backward chain. That's easy.

Next issue: I can't make plans for all these things, or sort them, because it's not clear to me what a solution would actually look like for each goal, nor do I have a clear sense of the time and energy costs involved. Solution: write a paragraph or so explaining how I'll know when each goal will be accomplished, then prioritize, and then begin following the depth-first backward chaining algorithm; creating a detailed plan for the highest priority project, and then implementing that plan, and then starting over with the next highest priority project.

Next issue: while all my company goals appear to be projects, some of my personal goals are not. Instead, they are goals about changing habits. Some, such as going on six dates and writing a novel and visiting 25 groups could be either project goals or habit goals. The dating thing is kind of weird there. The real intent is that I'd change my ongoing habits when it comes to dealing with attractive female strangers. The point is to be more friendly and outgoing, not to fill a quota - that's creepy. I'm trying to change a habit and the numbers are just a simple indicator that I've changed my anti-social ways. :)

Same thing with the money goals. I'm not currently in a position to save my way to 10,000 dollars. The goals specify that something dramatic will have changed in my relationship to money, but I'm not clear what that would be. Creating a systematic, well defined marketing pipeline that I can then optimize seems to fit the bill, but is one such tool enough? I don't know.

These are not good goals. They're just reminders of some ill-defined changes I want to make in my life. I suppose it's not surprising that I haven't made much progress on any of them.

Three of my habit goals are very well defined. I broke rondo alla turca into the small repeating pieces and I hacked up some software to help me practice a small piece, and I'm doing quite well with it. With my bookshelf, I've divided the books into piles of ten and I'm reading one after another. With getting in shape, the goal is well defined and it's very clear to me what I need to do to get in shape, but I have a very hard time getting myself to do those things. It's not lack of motivation, it's lack of organization: not exercising because it always seems to be the middle of the night, not eating right because I don't have a meal plan - or I plan a few meals and then exhaust the plan and just wind up snacking on whatever's quick and easy. Forward chaining in action.

...

Had to take a break for a few minutes. Some thoughts that occurred to me:

Anyway. My weight issue is certainly the most visible manifestation of forward chaining. As I said, I know what I need to do to get in shape. And I often do those things. I eat right, and I exercise. But I also eat junk food and avoid exercise. There's a plate of chocolate chip cookies in my kitchen right now, and just typing this makes me want to go eat one. The thing is, most of the time I would eat the cookie. I wouldn't even to stop to think whether it was in line with my goals or not. The chain of thought that leads me to eat the cookie (or buy the cookie) is a completely different and disconnected mindset from the one that leads me to go work out.

Same thing with sleep. I've spent the last few nights forward chaining on ideas (hopefully in the general direction of some of my goals) and reacting to my inbox. And so now it's 4:30 in the morning and I'm wide awake. I know this sort of nocturnal schedule is bad for me and interferes with all kinds of things, but in the moment I'm not thinking about that. I'm caught up in some other idea that may or may not even be connected to any of my goals.

Even the six dates and twenty-five groups goals are indicative of this way of thinking. The real goals of course are to have a great relationship and make some friends here in Atlanta to hang out with. That's what I want. But when I tried to make those into a specific goal, the thinking was: well, just meet a bunch of women. Go to a bunch of groups and meet people. Perform a bottom-up, forward-chaining search.

In a sense, there's nothing wrong with that. I mean, part of the idea behind the number six was that I don't necessarily want to just jump into a relationship with the first nice woman I hit it off with. It's a protection mechanism. But what it's protecting me from is jumping into a relationship with someone when I don't have a clear idea what I want out of a relationship. My last girlfriend was great, but she doesn't want to move to Atlanta or give up smoking and so it was pretty much doomed from the start.

A backward chaining solution would be to figure out what I want in a girlfriend, figure out what kinds of things I'd have to do and what qualities I'd have to cultivate in order to attract that kind of person, and what sort of places I'd have to visit to meet someone like that, and go make all those things happen. I guess it was easier to say "go have 6 dates, even if they're bad" than do all that work. Also, going on six dates is a numbers game. Dates are not hard to come by if you don't have any standards. But it turns the whole concept into... Well, a project. It's just a dumb goal. At least I had the sense to add an escape clause in case I got involved with someone.

...

Anyway, so I have habit goals and project goals and a few goals that aren't yet clear to me at all. I need to clarify all the goals, prioritize the project goals, and then somehow need to break all this down to the level of daily action.

That's the stumbling block. How do I put these ideas into action without becoming a robot?

That's not fair. Many people are very goal driven yet manage to have fun, well-balanced lives. In fact I can easily see how this kind of thinking would result in more fun and balance in my own life, if I could just do it.

There's still a disconnect here though. How do I make this happen in the moment? Is practice sufficient? What, specifically, do I do?

Well, I guess I know what it would look like if I were to do this. I would have outlines or diagrams showing clear paths to all the habit goals, and for the highest priority project goals. I'd have a very clear cut eating plan and exercise every day. I'd have some sort of system in place to let me know what I would be eating each day, and so I would be able to generate grocery lists from that, either by computer or by hand. I'd have to have some kind of flexibility in there though or I'd go crazy. This could be as simple as committing to the Body for Life system - but as a lifestyle, not a 12-week plan. I'd have a daily checklist, or schedule.

Uh-oh. I've had schedules in the past. I tended to drift. But I've drifted from goals I've had in the past, too, whereas the current batch have remained pretty solid for me.

Of course in the past, I was trying to schedule my life in spite of my habit of coming up with millions of unfocused ideas and distracting myself. Whereas now I know my priorities (even though the actual lists are not yet prioritized), and I'm aware of this forward chaining habit and its consequences, and I can make decisions about when to use it and when to turn it off.

... 
Some psuedocode:
habits = [
('sleep', 8.0),
('workout', 1.0),
('shower', 0.5),
('meal_01', 0.25), # 6 small meals/day on BFL
('support', 2.0),
('piano', 0.25),
('gtd', 0.25),
('meal_02', 0.25),
('work_code', 2.0),
('meal_03', 0.25),
('goal_code', 2.0),
('meal_04', 0.25),
('reading', 0.5),
('social', 1.0),
('meal_05', 0.25),
('support', 0.5),
('meal_06', 0.25),
('write', 0.5),
]
slack = 4
assert slack + sum([time for (_,time) in habits]) == 24
while True:
if today==SUNDAY:
pass # free day
else:
for area, time in habits:
focus_on(area, time)
except Exception, e:
handle(e)

...

Yeah. That's pretty rough, but it seems to cover my priorities. If I don't have a clear next action in an area, I would spend the time revisiting my goal and working backward until I had a clear plan.

...

I'm trying hard to come up with some negative branches here. I've got a lot of doubts but nothing explicit.

I guess the most basic is: how do I know this is going to make a difference? If I imagine trying to live this way, I see weird things happening:

I dunno, this seems right to me. It makes sense to me, it's clearly connected all the way back from my list of goals, and I can start taking action on it right this minute. I guess I'm done here. Neat.

Heya, I followed your code-reading link from reddit and have been working through some of your other posts. Good stuff. When I came across this one I knew I had to comment... while describing yourself you've also described me perfectly! I'm also into programming and was just today considering writing a blog entry titled ADD: Attention Deficit Development, about how people like us start tons of projects that eventually get eclipsed by yet others, which often have the same fate. Example: I made a crime mapping web app for my campus, which led me to create geopy (geocoding for Python), dmath (Decimal math for Python), a complete geocoder web service for my campus, contour mapping in JavaScript, all distinct projects where one thing led to another. I'm even interested in things like your diet management concerns, because I think about the same things. Anyway, just though I'd say thanks for the reading. I wonder what happens when you connect a bunch of guys like us together? Particularly the cool-ideas aspect. If we all shared ideas, would we get more actual work done because other people might implement our ideas for us, or less work because we'd be tempted by others' ideas? Or would people only be delighted by their own ideas? Blog on, dude.
by Brian Beck [01/07/2007 00:40:37]

(new comments disabled for now)