DIRECTORY G2dBasic, Rope; G3dNats: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; IntegerPairSequence: TYPE ~ G2dBasic.IntegerPairSequence; NatSequence: TYPE ~ G2dBasic.NatSequence; NatTable: TYPE ~ REF NatTableRep; NatTableRep: TYPE ~ RECORD [ length: CARDINAL ¬ 0, element: SEQUENCE maxLength: CARDINAL OF NatSequence]; NewNatSequence3: PROC [v0, v1, v2: INT] RETURNS [NatSequence]; EqualNatSequences: PROC [s1, s2: NatSequence] RETURNS [BOOL]; GetCommonElementInNatSequences: PROC [n1, n2: NatSequence] RETURNS [INT]; GetNatSequenceIndex: PROC [nats: NatSequence, nat: NAT] RETURNS [INT]; ReplaceNatInSequence: PROC [n: NatSequence, old, new: NAT] RETURNS [NatSequence]; RemoveNatInSequence: PROC [n: NatSequence, old: NAT] RETURNS [NatSequence]; GetUniqueElement: PROC [ns: NatSequence] RETURNS [INT]; GetRepeatedElement: PROC [ns: NatSequence] RETURNS [INT]; GetElementNotShared: PROC [v: NAT, ns: NatSequence] RETURNS [INT]; NatInSequence: PROC [nat: NAT, seq: NatSequence] RETURNS [BOOL]; NatSequenceLength: PROC [seq: NatSequence] RETURNS [INT]; CopyNatSequenceSequence: PUBLIC PROC [nats: NatTable] RETURNS [NatTable]; AddToNatSequenceSequence: PUBLIC PROC [nats: NatTable, nat: NatSequence] RETURNS [NatTable]; LengthenNatSequenceSequence: PUBLIC PROC [nats: NatTable, amount: REAL ¬ 1.3] RETURNS [new: NatTable]; ObtainScratchNats: PROC [length: INTEGER] RETURNS [NatSequence]; ReleaseScratchNats: PROC [scratch: NatSequence]; ObtainScratchIntegerPairs: PROC [length: INTEGER] RETURNS [IntegerPairSequence]; ReleaseScratchIntegerPairs: PROC [scratch: IntegerPairSequence]; END. € G3dNats.mesa Copyright Σ 1984, 1992 by Xerox Corporation. All rights reserved. Glassner, February 18, 1991 8:08 pm PST Jules Bloomenthal August 26, 1992 3:21 pm PDT Basic Types NatSequence Support Procs Return a new NatSequence containing these three elements (useful to make triangles) RETURN TRUE iff s1.length=s2.length and Ai: s1[i]=s2[i] Get an element shared by both sequences, or -1 if none shared (uses a dumb n2 test) Return index into sequence where nat appears, else -1 Return a new sequence where all occurences of old are replaced with new Return a new NatSequence with all occurances of old deleted Returns the unrepeated element in ns, raises an error if 0 or >1 unrepeated elements found Return the first element in the list that repeats an earlier element, else -1 Returns the single element in ns that is not v. If 0 or more such elements, returns -1 Returns TRUE iff nat is in seq. IF seq = NIL THEN RETURN[0] ELSE RETURN [seq.length]; NatTable Operations Scratch Pool Return a scratch sequence from a pool. Return nats to the scratch pool. Return a scratch sequence from a pool. Return nats to the scratch pool. Κb•NewlineDelimiter –"cedarcode" style™™ Jšœ Οeœ5™AJšœ'™'J™-J˜—šΟk œ˜J˜—JšΡblnœžœž ˜Jšœž˜headšΟl ™ š žœžžžžœžœ˜J˜—Jšœžœ ˜:Jšœžœ˜-J˜Jšœ žœžœ ˜&šœžœžœ˜ Jšœ ž œ˜Jšœ ž œ žœžœ˜=——š ™šΟnœžœžœžœ˜>J™SJ™—š‘œžœžœžœ˜=Jšœ(Οmœ™7J™—š‘œžœžœžœ˜IJšœLΟuœ™SJ™—š ‘œžœžœžœžœ˜FJ™5J™—š‘œžœžœžœ˜QJ™GJ™—š‘œžœžœžœ˜KJ™;J™—š‘œžœžœžœ˜7J™ZJ™—š‘œžœžœžœ˜9J™MJ™—š ‘œžœžœžœžœ˜BJ™W—J˜š ‘ œžœžœžœžœ˜@Jšœ™—J˜š‘œžœžœžœ˜9Jš žœžœžœžœžœžœ™5——š ™Jš‘œžœžœžœ ˜IJ˜š‘œžœžœ#˜HJšžœ ˜—J˜š‘œΟsž€ž€œ€œ €œ€ž€œ€œ˜MJšžœ˜——š  ™ š‘œžœ žœžœ˜@J™&J™—š‘œžœ˜0J™ J™—š‘œžœ žœžœ˜PJ™&J™—š‘œžœ ˜@J™ J™——Jšžœ˜J˜—…—dF