From b5af43294e9be75719c4d0b134b469d365d18d1f Mon Sep 17 00:00:00 2001 From: ccremers Date: Tue, 17 May 2005 13:00:45 +0000 Subject: [PATCH] - Added inverse keys to output. --- src/xmlout.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/xmlout.c b/src/xmlout.c index e6d0dec..ec6c63c 100644 --- a/src/xmlout.c +++ b/src/xmlout.c @@ -196,15 +196,21 @@ xmlTermlistPrint (Termlist tl) } //! Print a term for an element +/** + * If the first parameter (the tag) is NULL then only the term is printed without a wrapper tag. + */ void xmlOutTerm (const char *tag, const Term term) { if (term != NULL) { xmlIndentPrint (); - printf ("<%s>", tag); + if (tag != NULL) + printf ("<%s>", tag); xmlTermPrint (term); - printf ("\n", tag); + if (tag != NULL) + printf ("", tag); + printf ("\n"); } } @@ -239,6 +245,30 @@ roleTermPrint (const Term t) } } +//! Show inverses +void +xmlInverses (const System sys) +{ + Termlist invlist; + + xmlPrint (""); + xmlindent++; + invlist = sys->know->inverses; + while (invlist != NULL && invlist->next != NULL) + { + xmlPrint (""); + xmlindent++; + xmlOutTerm (NULL, invlist->term); + xmlOutTerm (NULL, invlist->next->term); + xmlindent--; + xmlPrint (""); + + invlist = invlist->next->next; + } + xmlindent--; + xmlPrint (""); +} + //! Show initial knowledge void xmlInitialKnowledge (const System sys) @@ -252,6 +282,7 @@ xmlInitialKnowledge (const System sys) termlistDelete (knowlist); xmlindent--; xmlPrint (""); + xmlInverses (sys); } //! Determine whether a protocol is involved in the current semitrace.