.EQ define DS '"$"' delim $$ define all '\(fa' .EN .H 1 "Conceptual Graph Grammars" In this appendix we present three different approaches to specifying context-free grammars for the linear form of a conceptual graph. The basic core of each is based on the sample grammar presented in [SOW84] (p. 395). Each grammar is presented here using a form of Extended Backus Naur Form that is summarised in the following table: .TS box tab(&); lfB | lfB c | l. Syntactic Object&Meaning = "$text$"&literal sequence of symbols \fItext\fP \fIsyntactic-term\fP&member of this syntactic class $object sub 1 | object sub 2$&$object sub 1$ or $object sub 2$ [$object$]&$object$ or nothing {$object$}&sequence of zero or more $objects$ ($object$)&$object$ (used only for grouping) _ \fBid\fP&identifier \fBnumber\fP&an integer .TE .P .Ws Besides the context-free conditions specified by these grammars, there are other, context-sensitive, constraints to be considered. Firstly, a string of one or more commas immediately before a period or semi-colon may be deleted. Also, each $n$-adic relation must have exactly $n$ adjacent arcs, with $n - 1$ arcs pointing toward the relation and one arc pointing away from it. .We .H 2 "CoGNO" .TS center tab(&); lcl. &::=& ("." | ";") &::=& | | &::=&"type" \fBid\fP "(" \fBid\fP ")" "is" &|&"relation" \fBid\fP "(" ")" "is" &|&"individual" "is" "(" \fBid\fP ")" "is" &|&"prototype" "for" \fBid\fP "(" \fBid\fP ")" "is" &|&"schema" "for" "(" \fBid\fP ")" "is" &::=& [] | &::=& [] | "-" "," &::=& [] | "-" "," &::=&"newline" [] {"newline" []} &::=&"newline" [] {"newline" []} &::=&"[" [":" "]"] &|&"[" [":" {} "]"] &|&"[" {} "]" &::=&"("")" &::=&\fBid\fP &::=&\fBid\fP &::=&\fBid\fP &|&"*" [\fBid\fP] &|&"$DS$"* [\fBid\fP] &|&[\fBid\fP] "#" [\fBnumber\fP] &|&["#" \fBnumber\fP] "@" \fBnumber\fP \fBid\fP &|& ["@" \fBnumber\fP] \(dg&::=&["dist"] "{" [( | )] "}" &|&"resp" "<" [] ">" &::=&"*" &|&\fBid\fP ["," ] &::=&"*" &|&\fBid\fP ["|" ] &::=&[\fBnumber\fP] {"<-" | "->"} \(dd&::=&"subtype" "of" \fBid\fP "is" \fBid\fP &::=&\fBid\fP ["," ] .TE .FS * Used to represent $all$. .FE .FS \(dg Sets are not implemented in the current version of CoGNO. .FE .FS \(dd Added to the linear form to help in constructing the concept type hierarchy. .FE .H 2 "CONGRES" The following is the grammar for CONGRES[RAO87] derived from the PROLOG source code for CONGRES. .TS tab(&); lll. &::=&"concept_type" \fBid\fP "is" &|&"relation_type \fBid\fP "is" &|&"subtype" "of" \fBid\fP "is" \fBid\fP &|&"type" \fBid\fP "(" ")" "is" &|&"individual" \fBid\fP "(" ")" "is" &|&"relation" \fBid\fP "(" ")" "is" &|&"schema" "for" \fBid\fP "(" ")" "is" &|&"prototype" "for" \fBid\fP "(" ")" "is" &|& &::=& ["<=" {}] "." &::=&[ ( | )] &::=& [( | "-" )] &::=& [( | "-" )] &::=&"," | "]" | "." | &::=&"," | "]" | "." | &::=& [":" ] "]" &::=&\fBid\fP &|&"proposition" ":" {} &|&"[" {} "]" &::=&"$DS$" [\fBid\fP] &|&"*" [\fBid\fP] &|&"#" [[\fBnumber\fP] "@" \fBnumber id\fP] &|&"@" \fBnumber id\fP &|&\fBid\fP &::=&"(" \fBid\fP ")" &::=&"<-" | "->" &::=&"." | ";" | "[" | "]" | "(" | ")" | "<=" | "," &::=&\fBid\fP | \fBid\fP "," .TE .H 2 "Knowledge Representation Environment (KRE)" The following is an adaption of the YACC grammar given for KRE [JOY88] (Appendix A). .TS tab(&); lll. &::=& | ";" &::=&] | &::=& [] | "-" &::=& [] ":" { [] ":"} &::=&"[" "]" &::=& [] | "-" &::=& [] ":" | { [] ":"} &::=& "(" ")" &::=&"<-" | "->" &::=& | | | &::=& &::=&"*" &::=&\fBid\fP &::=&\fBnumber\fP .TE