A Mathematical Introduction to Logic by Herbert B. Enderton

"1". 3 Using data abstraction The GAPLog concept of external procedure supports a kind of data ab­ the external procedures im­ plementing an abstract data type are seen as "black boxes" hiding the implementation details. This statement will be illustrated here by an ex­ ample taken from the world of music.

Functions over the domain A s di sc ussed in the previous domain consists of pitches and intervals. We want to rep­ resent such objects in GAP log in a way close to the notation used in music. As mentioned above the pitch names used in music denote not actual pitches, but equivalence classes of pitches in different octaves. Following this observation we i nt ro duce functions selecting a pitch in a specific octave from the class denoted by a pitch name . Let a pitch class be a set of all pitches with the same name .

Length ) . + 1) . Transformation- l yields: length ( [] , 0 , Ein , Eout ) : ­ normalize (Ein . Eout ) . length ( [X I List] , Z , Ein . Eout ) normalize ( [Z == Length + 1 I Ein] length (List . Length . E l . Eout ) . and Trans{ormation-2 J E1) . (which does not implement Rule 8) yields: length ( [] . 0) . lengt h ( [X I List] , Z) : gfreeze (Leng th + 1 . funcall (Length length (List , Length) . + 1 , Z» , A query is transformed as a clause body except that the constraint set given to the first goal atom in the query is empty, and that an extra call is added at the end to verify that there are no unsolved constraints left.

Download PDF sample

Rated 4.07 of 5 – based on 35 votes