From iscp9142@nus.edu.sg Tue Jan 22 10:06:29 2002 Date: Tue, 22 Jan 2002 13:53:50 +0800 From: "Sun, Jing" To: Andrew Martin Subject: Fw: Some reading for the holidays [CZT] [ The following text is in the "iso-8859-1" character set. ] [ Your display is set for the "US-ASCII" character set. Some ] [ characters may be displayed incorrectly. ] ----- Original Message ----- From: "Sun, Jing" To: "Ian Toyn" Cc: Sent: Friday, January 18, 2002 6:01 PM Subject: Re: Some reading for the holidays [CZT] > Dear Dr. Ian Toyn, > > I've read the draft of "Comparing Z Annotated Syntaxes: Towards an XML > Markup for Standard Z", and as a matter of fact I found some similarities > between the requirement in the draft and our fully annotated ZML approach. > I think this is due to that we both referred to the standard Z syntax > definition. > The difference is that we defined it in XML Schema instead of DTD. And I > will show some examples using XML Schema later in this message. The > following are some of my comments toward the requirement. I also cc the > message to the CZT mailing list, hope to get more comments on the topic. > > First issue I want to address is about XML Schema. In the draft, DTD was > chosen to define Z syntax. I agree that DTD can fulfil the job fine, but > compare to XML Schema it has certain limitations, see at > http://www.cse.ucsc.edu/~douglas/proximl/node5.html . XML Schema was > originally proposed by Microsoft, then became an official W3C recommendation > in May 2001. Many believe that very soon XML Schemas will be used in most > applications as a replacement and successor for DTDs due to its simplicity, > extensibility, datatype, namespace supports and so on, see at > http://www.cse.ucsc.edu/~douglas/proximl/node6.html . According to Z > standard syntax, an annotated Z markup can be specified via XML Schema more > easily. The attached jpg files are the screen captures of part of the Z > schema, declaration, predicate and expression definitions in XML Schema > represented in a diagramatic view. Sometimes I find that visulizing in this > way is more readable than reading those texture tag definitions. The files > are: > > schema.jpg -> Z-schema definition > declaration.jpg -> Z-declaration defintion > predicate.jpg -> Z-predicate definition > expression.jpg -> Z-expression defintion > zml.jpg -> overview of ZML > > The above diagramatic views are generated from the XML Schema authoring > tool. A > complete version of ZML definition is also available at > http://nt-appn.comp.nus.edu.sg/fm/zml/zml.xsd . It uses the standard W3C XML > Schema format, and includes the definition for Z, Object-Z and TCOZ > notations. The Z syntax was referred to the appendix in the "Z user manual" > and the Object-Z syntax was referred to the appendix in "The Object-Z > Specification Language" by Graeme. > > The following is part (given type and state schema only) of the example > (BirthdayBook) in ZML: > > =================================================================== > > xsi:noNamespaceSchemaLocation="http://nt-appn.comp.nus.edu.sg/fm/zml/zml.xsd > "> > This is a simplified version of the BirthdayBook example in Z > represented in Z Markup Language. > > DATE > NAME > > > BirthdayBook > > known > > pset > NAME > > > > birthday > > > NAME > > tfun > DATE > > > > > known > > = > > dom > > birthday > > > > > ...... > > ============================================ > > As I mentioned earlier since we both refer to the standard Z syntax, the > specs are quite similar to that in the requirement draft. One obvious > difference might be the use of "WORD" in the draft and the "name" in ZML. > > I also attached the complete example file of the BirthdayBook in XML > (birthdaybook.xml). This XML file can be validated by XML parsers against > its XML Schema syntax definition. For the visualized BirthdayBook example in > Latex please refer to the "birthdaybook.ps" (attached). > > Another issue is that I agree that the validation function of XML parser can > be used as a facility for checking syntactical errors in Z specs. And for > this purpose XML Schema also has its advantage. Let's look at a simple > example. If we agreed that the Z schema name can only be starting by an > alphabetical letter following by the others, then we could define a nameType > in XML Schema which extense the string type and with restrictions as > follows. > > > > > > > > Then defining the syntax for schema names as " type="nameType"/>". Any violation of mis-type value of the name will be > checked by XML validator parser as "value does not match facet pattern="[A-Z > a-Z}.* in element name". This type of validating process will certainly > beyond the capablity of DTD. > > Finally, as Ian mentioned in the draft is the encoding of relation between > declarations and reference to them. We treat this as using the annotation of > "type" and "name" (see the datatype in the declaration.jpg). The name of a > given type, schema type will become future type refernce to other type > definitions, which annotated as "type" in a data declaration section. It > might be one way of tackle the to the problem. > > In the above message we presented a similar annotation of Z in XML using XML > Schema, which we though would be more flexible and extensiable. Any comment > is welcome. Thanks. > > > Best regards. > > Jing Sun > > > ----- Original Message ----- > From: "Ian Toyn" > To: "Sun, Jing" > Sent: Tuesday, January 15, 2002 6:29 PM > Subject: Re: Some reading for the holidays [CZT] > > > > Dear Jing, > > > > > We have been using XML to represent Z/Object-Z languages, attached as > > > follows. > > > > > > 1) light annotated version (upto predicate level): objectZschema.xml > > > 2) fully annotated version (downto expression level): zml.xsd > > > > I looked at zml.xsd and found your mark-up of Z expressions, > > but I didn't see any mark-up for annotations on those expressions. > > > > > As our project is still in the initial stage, we would be grateful to > have > > > more comments. > > > And I'd also like to help with any questions on XML/DTD too. > > > > Thanks for your offer to help. > > I've attached my latest draft to this message. > > That draft sets out my requirements for an interchange mark-up for Z. > > I suspect the requirements for your XML mark-up are different from mine. > > What do you think? > > > > Regards, > > Ian Toyn > > > > [ Part 2, Image/JPEG 34KB. ] [ Unable to print this part. ] [ Part 3, Image/JPEG 54KB. ] [ Unable to print this part. ] [ Part 4, Image/JPEG 60KB. ] [ Unable to print this part. ] [ Part 5, Image/JPEG 83KB. ] [ Unable to print this part. ] [ Part 6, Image/JPEG 30KB. ] [ Unable to print this part. ] [ Part 7, Text/XML (Name: "birthdaybook.xml") 198 lines. ] [ Unable to print this part. ] [ Part 8, Application/POSTSCRIPT 108KB. ] [ Unable to print this part. ]