-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the PLN wiki!
First install
-
Hyperon-Experimental https://github.com/trueagi-io/hyperon-experimental
-
MeTTa-Morph directly in your home folder: https://github.com/trueagi-io/metta-morph
Then chekout PLN via
git clone https://github.com/trueagi-io/PLN
Running an example (the famous Tuffy Smokes) from the example folder of the repository:
metta Smokes.metta
Import it to your code via the import mechanisms of your MeTTa interpreter.
!(import! &self PLN)
Then, in order to compile a fast instance with some prior concepts and implications, execute
!(PLN.Init (kbstatic))
as in the example files.
To interact with PLN in your MeTTa code, use the following functions:
!(PLN.Derive $Tasks $Beliefs $queryTerm $maxsteps $taskqueuesize $beliefqueuesize))
: Returning all tasks and beliefs after $maxsteps inference steps.
!(PLN.Query $Tasks $Beliefs $queryTerm $maxsteps $taskqueuesize $beliefqueuesize))
: Returning truth value and evidential base of the $queryTerm sentence only, using PLN.Derive under the hood.
$Tasks / $Beliefs: A tuple of additional sentences (Sentence_1 ... Sentence_n) not known at compile-time.
$Tasks: Active sentences (Sentence_1 ... Sentence_n) not known at compile-time.
$Beliefs: Additional pieces of knowledge (Sentence_1 ... Sentence_n) not known at compile-time.
Sentence_i: (Sentence ($Term (stv $Strength $Confidence) ($EvidenceID))
$Term: The term of the item of knowledge
$queryTerm: The term the derived sentence should have
$maxsteps: Maximum inference steps (in terms of task selections)
$taskqueuesize: Size of task PQ used for inference control
$beliefqueuesize: Size of belief buffer used in inference
$EvidenceID: Running ID, so for Sentence_i
assign evidence ID i. Except if one knows 2 inputs are statistically dependent, one can give them the same ID to increase the accuracy of the uncertainty reasoning.
Once this call is formulated your PLN call from your MeTTa code is complete. In most cases $Tasks can be set to $Beliefs (in which case the distinction is made under the hood after multiple task selections), however if one wants only some active pieces of knowledge in the knowledge base to lead to derivations then the distinction becomes useful.