Path: utzoo!attcan!uunet!midway!linac!pacific.mps.ohio-state.edu!tut.cis.ohio-state.edu!snorkelwacker!ai-lab!rice-chex!bson From: bson@rice-chex.ai.mit.edu (Jan Brittenson) Newsgroups: comp.sys.handhelds Subject: Re: Forming boolean expressions Message-ID: <10987@life.ai.mit.edu> Date: 25 Sep 90 11:13:18 GMT References: <1990Sep22.163700.15239@mathrt0.math.chalmers.se> <996@halley.UUCP> Sender: news@ai.mit.edu Organization: nil Lines: 36 In article <996@halley.UUCP> pedz@halley.UUCP writes: > I don't have much insight as to when to use ^MATCH as oppose to > VMATCH. I understand (sorta) how they differ but don't understand > when to use one or the other. Assume you want to make the (very reasonable) reduction of '&A+(&B+&C)' to '&A+&B+&C'. With the simple algebraic '1+(2+3)' everything will be just fine, you'll end up with '1+2+3' either way. But try it with '1+(2+(3+4))', and you'll end up with vMATCH ==> '1+2+(3+4)' ^MATCH ==> '1+(2+3+4)' Why is this? Well, ^MATCH looks at the innermost subexpression first (the bottommost, if you regard the expression as a tree), so the matching order will be (with the algebraic '1+(2+(3+4))'): &A+(&B+&C) vs. '3+4' (no match) - "" - vs. '2+(3+4)' -> '2+3+4' - "" - vs. '1+(2+3+4)' (no match) ==> '1+(2+3+4)' vMATCH attempts to substitute the topmost level first, so the order with vMATCH will be: &A+(&B+&C) vs. '1+(2+(3+4))' -> '1+2+(3+4)' - "" - vs. '3+4' (no match) ==> '1+2+(3+4)'