diff --git a/src/knowledge.c b/src/knowledge.c index 1a1410c..d4b518e 100644 --- a/src/knowledge.c +++ b/src/knowledge.c @@ -339,6 +339,31 @@ knowledgePrint (Knowledge know) eprintf ("\n"); } +//! Print a knowledge set, short version (no newline) +void +knowledgePrintShort (const Knowledge know) +{ + indent (); + if (know == NULL) + { + eprintf ("Empty"); + return; + } + + if (know->basic != NULL) + { + termlistPrint (know->basic); + if (know->encrypt != NULL); + { + eprintf (", "); + } + } + if (know->encrypt != NULL) + { + termlistPrint (know->encrypt); + } +} + //! Print the inverses list of a knowledge set. void knowledgeInversesPrint (Knowledge know) diff --git a/src/knowledge.h b/src/knowledge.h index 38616f3..11fb186 100644 --- a/src/knowledge.h +++ b/src/knowledge.h @@ -41,6 +41,7 @@ void knowledgeSetInverses (Knowledge know, Termlist tl); void knowledgeSimplify (Knowledge know, Term decryptkey); int inKnowledge (const Knowledge know, Term term); void knowledgePrint (Knowledge know); +void knowledgePrintShort (const Knowledge know); void knowledgeInversesPrint (Knowledge know); int isKnowledgeEqual (Knowledge know1, Knowledge know2); Termlist knowledgeSet (const Knowledge know);