Please Make a Donation:
Support This Project

Hosted by:
Get Python Knowledge Engine (PyKE) at SourceForge.net. Fast, secure and Free Open Source software downloads

KFB Syntax

This uses the same lexical structure as KRB files, except that the only keywords are:

  • None
  • True
  • False

The name of the fact base is simply the filename with the .kfb suffix stripped. This must be a valid Python identifier.

Syntax for KFB File

file ::= [NL] {fact NL}

fact ::= IDENTIFIER '(' [{data,}] ')'

data ::= 'None' | 'True' | 'False'
       | NUMBER | IDENTIFIER | STRING
       | '(' [{data,}] ')'

Example

This is taken from the family_relations example:

# family.kfb

son_of(bruce, thomas, norma)
son_of(fred_a, thomas, norma)
son_of(tim, thomas, norma)
daughter_of(vicki, thomas, norma)
daughter_of(jill, thomas, norma)

daughter_of(nanette, arthur2, kathleen)
son_of(arthur3, arthur2, kathleen)
daughter_of(sue, arthur2, kathleen)
son_of(ed, arthur2, kathleen)
daughter_of(marilyn, arthur2, kathleen)
son_of(david_b, arthur2, kathleen)
daughter_of(m_helen, arthur2, kathleen)

son_of(m_thomas, bruce, marilyn)
son_of(david_a, bruce, marilyn)

More:

KFB Syntax

The syntax of Knowledge Fact Base (KFB) files, which is where you write your universal facts.

KRB Syntax

Syntax of the Knowledge Rule Base (KRB) files, which is where you write your rules.

KQB Syntax

The syntax of Knowledge Question Base (KQB) files, which is where you spell out your end user questions.

Page last modified Mon, Oct 27 2008.