OpenCogPrime:MetaLanguage
From OpenCog
Meta-Language
This page confronts a generic notational issue pertaining to the OCP docs generically. As always occurs when discussing (even partially) logic-based systems, there is some potential for confusion between logical relationships inside the system, and logical relationships being used to describe parts of the system. For instance, we can state as observers that two Atoms inside OCP are equivalent, and this is different from stating that OCP itself contains an Equivalence relation between these two Atoms. Our formal notation needs to reflect this difference.
Since we will not be doing any fancy mathematical analyses of OCP structures or dynamics, there is no need to formally specify the logic being used for the metalanguage. Standard predicate logic may be assumed.
So, for example, we will say things like
(IntensionalInheritanceLink Ben monster).TruthValue.strength = .5
This is a metalanguage statement, which means that the strength field of the TruthValue object associated with the link (Instance Ben monster) is equal to .5. This is different than saying
EquivalenceLink
ExOutLink
GetStrength
ExOutLink
GetTruthValue
IntensionalInheritanceLink Ben monster
NumberNode 0.5
which refers to an equivalence relation represented inside OCP. The former refers to an equals relationship observed by the author of the book, but perhaps never represented explicitly inside OCP.
In the first example above we have used the C++ convention
structure_variable_name . field_name
for denoting elements of composite structures; this convention will be stated formally below.
In the second example we have used schema corresponding to TruthValue and Strength; these schema extract the appropriate fields from the Atoms they're applied to, so that e.g.
ExOutLink
GetTruthValue
A
returns the number
A . TruthValue
Following a convention from mathematical logic, we will also sometimes use the special symbol
|-
to mean implies in the metalanguage. For example, the first-order PLN deductive inference strength rule may be written
|}
Inheritance A B <sAB> Inheritance B C <sBC> |- Inheritance A C <sAC>
where
sAC = sAB sBC + (1-sAB) ( sC - sB sBC ) / (1- sB )
This is different from saying
ForAll $A, $B, $C, $sAB, $sBC, $sAC
Implication_HOJ
AND
Inheritance $A $B <$sAB>
Inheritance $B $C <$sBC>
AND
Inheritance $A $C <$sAC>
$sAC = $sAB $sBC + (1-$sAB) ( $sC - $sB $sBC ) / (1- $sB )
which is the most natural representation of the independence-based PLN deduction rule (for strength-only truth values) as a logical statement within OCP. In the latter expression the variables $A, $sAB, and so forth represent actual Variable Atoms within OCP. In the former expression the variables represent concrete, non-Variable Atoms within OCP, which however are being considered as variables within the metalanguage.
(Recall from the PLN book that a link labeled with "HOJ" refers to a "higher order judgment", meaning a relationship that interprets its relations as entities with particular truth values. For instance,
Implication Inh $X stupid <.9> Inh $X rich <.9>
means that if (Inh $X stupid) has a strength of .9, then (Inh $X rich) has a strength of .9).

