Re: Decision Tables




"Ben Bacarisse" <ben.usenet@xxxxxxxxx> wrote in message
news:87abmo9n9b.fsf@xxxxxxxxxxxx
"Bartc" <bc@xxxxxxxxxx> writes:

The business part is the half-dozen lines of Match(), which I'd imagine
would not be impossible in C, depending on the actual types of the fields
being tested.

It would not be that hard in C (though a little messy) but see below.

Function Match(A, B, map)=

forall i in map do
if A.[i]<>B.[I] then return 0 fi
end

return 1
End

What you a showing, I think, is a language that can index record
(or structure) members. In the posted C++, this is done by using
pointers to member functions. Both are key to one part of the OP's
problem but neither really gets to the heart of the OP's question --
how to represent (or denote) compound match predicates.

You mean how to specify which fields are to be compared and to what?

What from I could understand, the OP wanted to compare certain fields of
records A and B. A is input data and B is some reference data. In my code
example the fields are specified as a list of field numbers.

Another way was in Malcolm's example to put wildcards into B (or some
indicator to say 'ignore this field').

My example still stands, but Map disappears and the critical code (best read
as pseudo-code) becomes as follows. (My language just happens to have the
..fields attribute). This is a little less efficient however (must look at
all fields of B), but there are other possibilities too.

I don't think the requirements went any deeper than that and to avoid
writing 2**N laborious functions. My point was to show things could be kept
simple without dragging in external libraries.

Function Match(A, B)=
For i:=1 to A.Fields do
if B.[i]<>"*" and A.[i]<>B.[i] then return 0 fi
end
return 1
End

--
Bart


.



Relevant Pages

  • Re: subsystem routing configuration
    ... CPF1124 will show the sbs the job was started in, CPI1125 will show the job attributes, where you should see also RTGDTA attribute. ... From your previous post, I'm not sure, but I'm wondering that the RTGDTA you specified in JOBD, included apostrophes too as part of the compare value. ... Being the compare value LCRTVCHR1 jou can also specify without delimiters, both in CHGJOBD RTGDTAand CHGRTGE SBSDSEQNBRCMPVAL ...
    (comp.sys.ibm.as400.misc)
  • Re: Well Ordering the Reals
    ... >>> If you do not specify the number of bits, then you don't know what number ... >>> number in order to compare it with another number. ... A TO-number starting with a zero and having infinitely many zeros ... So how does one tell, strictly from their representations, which is ...
    (sci.math)
  • Re: script to compare dates
    ... I want to write a script whose input data would be a csv file and records ... Please help me as to how do I compare dates, ... use DateTime to manage all aspects of dates and times. ...
    (perl.beginners)
  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... then convert onto the expected integer ... specify the validation criteria for all input data and to handle all ...
    (comp.lang.pl1)
  • Re: Well Ordering the Reals
    ... >>> But suppose it is impossible to represent the two strings this way? ... >> If you do not specify the number of bits, then you don't know what number you ... >> number in order to compare it with another number. ... >> The digit positions we define in the infinite string are going to be ...
    (sci.math)