Syntax - Internal Format (PR-format)

Pro/3 home page  -  documentation overview - What is Pro/3? 

» syntaxes

This syntax describes the syntax for the PR-format ("PROLOG"-format). The PR-format can be used for input and output of sentences and functions, but is otherwise an internal format corresponding to format used to store knowledge internally in the KB. Sentences, functions and non-set sentence rules are genuine PROLOG-formats, while set-type sentence rules and certainty rules differ from PROLOG-syntax in certain ways, and has a non-PROLOG interpretation in Pro/3. 

COMMENTS

Refer to syntax - Comments.

 

<ActualCR_Parameter> ass_opr ( de , <ActualParameter> )
ass_opr is a domain-qualified assignment operator (e.g. "isIN"), while de is the formal parameter's  name.
<ActualParameter> <DataElement>
<Variable>
<AndRule> p3_iCand ( name , dom , <LogCalls> , prior , outofcontext , <Context> , <Parameters> )
name is the rule's name, dom is the return domain, prior is the rule's prior probability while outofcontext is the value returned if out of context.

<ArgumentVariable>

<EntityArgument>
<OpenArgumentVariable>
<AssignmentOperator> <DeterministicAssignmentOperator>
<NondeterministicAssignmentOperator>
<BayCall> name ( <Increment> , <Decrement> , <ParameterPart> )
Iname is the called rule's name.
<BayRule> p3_iCbay ( name , dom, p3_iBay ( <BayCall> { , <BayCall> }+ ) , prior , outofcontext , <Context> , <Parameters> )
name is the rule's name, dom is the return domain, prior is the rule's prior probability while outofcontext is the value returned if out of context.
<BinaryOperator> The binary operators include +, -, *, /, ^,  div and mod.
<BinarySentence> pt ( <Entity> , <Entity>  { , <DataElement>  }* )
pt is the name of a binary predicate type.
<Call> name ( <ParameterPart> )
name is the called rule's name.
<CertaintyRule> <AndRule>
<BayRule>
<MapRule>
<NotRule>
<OrRule>
<QueryRule>
<QuestionRule>
<RuleSwitchRule>
<ParameterSwitchRule>
<ParameterRule>

<CertaintyRuleAndFuzzySet>

<CertaintyRule>
<FuzzySet>
<CertaintyRuleCall> p3_iCR ( name { , <SimpleExpression> }* ) 
name is the name of the certainty rule.
<ComparisonOperator> { <| > | <= | >= | = | <> | like | unlike }
<ComplexCondition> <Condition> [ , <ComplexCondition> ]
<ConCall> name ( oper , <SimpleDataElement> , nill , nill , <ParameterPart> )
name ( oper , <SimpleDataElement> , oper , <SimpleDataElement> , <ParameterPart> )
name is the called rule's name, while oper is one of the operators =,<,>,<=,>=,<>.
<Conclusion> <ST_Variable>

<Condition>

<ST_Variable>
<VariableCondition>
<SentenceCountCondition> 
cmp("not",[<Condition>])
cmp("true",[<Condition>])
<Context> nill
p3_iCon ( <ConCall> { , <ConCall> }* )
<D_Variable> <DE_Variable>
<OpenVariable>
<DataElement> <SimpleDataElement>
<ListDataElement>
<DE_Condition> <DE_Variable> <ComparisonOperator> <Expression>
<DE_Variable> A data element variable name on the format: argument name with first letter in upper case, followed by underscore, followed by an argument number followed by a data element name [e.g. EVehicle_11dLicensenumber].
<DE_Variable> <DE_Variable>
<DE_Reference> p3_iDdrf ( <SimpleVariable> , DE_Variable , SentenceCondition )
p3_iNdrf ( <SimpleVariable> , DE_Variable , SentenceCondition )
p3_iDdrf represents a deterministic data element reference, while p3_iNdrf represents a non-deterministic data element reference. DE_Variable is a string-representation of a a <DE_Variable> while SentenceCondition is a string representation of a <SentenceCondition>.
<Decrement> <Call>
dec
dec is a fixed-point number in the range <0.0...1.0>.
<DeterministicAssignmentOperator> isDD
DD is the short form of the destination domain.
<DeterministicFunctionCall> name ( p3_iDtFn , <SimpleVariable> [ <ActualParameter> { , <ActualParameter> }*] )
name is the name of a deterministic function. <SimpleVariable> represents the return value.
<Entity> et ( <DataElement> { , <DataElement> }* )
 et is the name of entity type.
<EntityArgument> et ( <D_Variable> { , <D_Variable> }* )
et is the name of entity type.
<Expression> <SimpleExpression>
( <Expression> <BinaryOperator> <Expression> )
<UnaryOperator> ( <Expression> )
<FunctionDefinition> <FunctionDefinitionHeader> :- <Statement> { , <Statement> }*
<FunctionDefinitionHeader> name ( var { , <ParameterVariable> }* )
name is the name of the function, while var is a variable representing the return-value (the name is the same as the function, but with the first letter in upper-case. 
<FunctionCall> <DeterministicFunctionCall>
<NondeterministicFunctionCall>
<FunctionDeclaration> q ( f ( name , domain , [ [ de { , de }*] ] ) , segment )
q ( g ( name , domain , [ [ de { , de }*] ] ) , segment )
The function-declaration is represented as any other sentence (f is used for deterministic functions while g is used for non-deterministic functions). name is the function's name, domain  return value domain, de is a formal parameter, while segment is the segment name.
<FuzzyComplement> p3_iZnot ( name, domain, <FuzzyCombination>, <Parameters> )
name is the name of the fuzzy set, while domain is the return domain (always p3_dmg).
<FuzzyIntersection> p3_iZand ( name, domain, <FuzzyCombination>, <Parameters> )
name is the name of the fuzzy set, while domain is the return domain (always p3_dmg).
<FuzzyOWA> p3_iZowa ( name, domain, <OWA_Combination>, <Parameters> )
name is the name of the fuzzy set, while domain is the return domain (always p3_dmg).
<FuzzySet> <FuzzyComplement>
<FuzzyIntersection>
<FuzzyUnion>
<FuzzyOWA>
<FuzzyCombination> combination ( <Call> { , <Call> }+ )
combination is one of p3_iZaand, p3_iZband, p3_iZdand, p3_iZaor, p3_iZbor, p3_iZdor or p3_iZnot.
<FuzzyUnion> p3_iZor ( name, domain, <FuzzyCombination>, <Parameters> )
name is the name of the fuzzy set, while domain is the return domain (always p3_dmg).
<Increment> <Call>
inc
inc is a fixed-point number in the range [1.0...10.0].
<ListDataElement> [ [ <SimpleDataElement> { , <SimpleDataElement> }*] ]
The simple data elements in the list must be from the same domain.
<LogCalls> p3_iLand ( <Call> { , <Call> }+ )
p3_iLor ( <Call> { , <Call> }+ )
There should be at least two calls.
<Map> nill
p3_iDmap ( p3_iVls ( <SimpleDataElement> { , <SimpleDataElement> }* ) , p3_iCfs ( <SimpleDataElement> { , <SimpleDataElement> }* ))
p3_iNmap ( p3_iVls ( <SimpleDataElement> { , <SimpleDataElement> }* ) , p3_iCfs ( <SimpleDataElement> { , <SimpleDataElement> }* ))
p3_iDmap signifies a discrete value map while p3_iVmap signifies a numerical map. p3_iVls are map argument values while p3_iCfs are the corresponding values mapped into.
<MapRule> p3_iCmap ( name , dom , <Call> , <Map> , prior , outofcontext ,<Default>,<Context>,<Parameters>)
name is the rule's name, prior is the rule's prior probability, dom is the rule's return domain, while outofcontext is the value returned if out of context.
<NondeterministicAssignmentOperator> nisDD
DD is the short form of the destination domain.
<NondeterministicFunctionCall> name ( <SimpleVariable> [ <ActualParameter> { , <ActualParameter> }*] )
name is the name of a non-deterministic function. <SimpleVariable> represents the return value.
<NotRule> p3_iCnot ( name , dom , <Call>, prior , outofcontext , <Context> , <Parameters> )
name is the rule's name, dom is the return domain, prior is the rule's prior probability while outofcontext is the value returned if out of context.
<OpenArgumentVariable> <SimpleVariable>
<OpenVariable> An underscore character.
OPR OPR is the internal KB representation of an assignment or comparison operator (assignment operator is on the format {n}isDD>>D where DD>>D is the domain short form).
<OrRule> p3_iCor ( name , dom , <LogCalls> , prior , outofcontext , <Context> , <Parameters> )
name is the rule's name, dom is the return domain, prior is the rule's prior probability while outofcontext is the value returned if out of context.
<OWA_Combination> p3_iZowa ( name ( <Weight>, <ParameterPart> ) { , name ( <Weight>, <ParameterPart> ) }+ )
<ParameterCall> name ( parameter, <ParamerPart> )
<ParameterPart> p3_iAps ( )
p3_iAps ( <ActualCR_Parameter> { , <ActualCR_Parameter> }* )
<ParameterRule> p3_iCpar( name , domain, <Call> , p3_iPCal ( <ParameterCall> { , <ParameterCall> }* ) , prior , outofcontext , <Context> , <Parameters> )
Iname is the rule's name, domain is the return-domain, prior is the rule's prior probability, while outofcontext is the value returned if out of context.
<Parameters> p3_iPar ( )
p3_iPar ( fstr ( de , dom , format , width ) { , fstr ( de , dom , format , width ) }* )
de is the name (data element type) of the formal parameter, dom is its domain, format is a format-string while width is a field-width integer.
<ParameterVariable> A parameter-variable is either a function parameter variable or a certainty rule parameter variable. The format is Ff..f__dd..d i.e.  the function or certainty rule name with the first letter in upper case, followed by two underscores followed by the name of the format parameter (i.e. a data element type name). 
<ProcedureCall> proc
proc ( <ActualParameter> { , <ActualParameter> }* )
proc is the name of a procedure.
<Query> p3_iQry ( dom , <QueryElement> )
dom is the domain of the value returned by the query. 
<QueryElement> <DE_Reference>
<DeterministicFunctionCall>
<SentenceCountCondition>
<QueryRule> p3_iCdat ( name , dom , <Query> , <Map> , prior , outofcontext , <SimpleDataElement> , <Context> , <Parameters> )
name is the rule's name, dom is the return domain, prior is the rule's prior probability while outofcontext is the value returned if out of context.
<Question> p3_iQst ( dom , <QuestionElement> )
dom is the domain of the value returned by the query. 
<QuestionAnswerAlternatives> alt [ ; alt ]
alt is an identifier correspondjng to  a valid answer alternative.
<QuestionElement> <QuestionText> [ [ <QuestionAnswerAlternatives> ] ]
<QuestionRule> p3_iCdat ( name , dom , <Question> , <Map>, prior , outofcontext , <SimpleDataElement> , <Context> , <Parameters> )
name is the rule's name, dom is the return domain, prior is the rule's prior probability while outofcontext is the value returned if out of context.
<QuestionText> { text | { ident } }+
text is any text, however not including the following characters: [ , ] , { or }. ident  is an identifier which will be translated to NL when question-prompt is generated during run-time.
<Sentence> <UnarySentence>
<BinarySentence>
<SentenceCondition> <ST_Variable> [ , <DE_Condition> { , <DE_Condition> }*]
<SentenceCountCondition> p3_iSSS ( <SimpleVariable> , SentenceCondition )
SentenceCondition is a string representation of a <SentenceCondition>.
<SentenceRule> <Conclusion> :- <NonSetRuleCondition>
<Conclusion> :- <SetRuleCondition>

<SetRuleCondition>

rt ( p , SentenceCondition , DE_Var_List , DE_Assignments , <DE_Variable> { , <DE_Variable> }* )
rt is the name of a rule type [e.g. p3_iRsta]. p is a rule partition integer (0,1,..). SentenceCondition is a string corresponding to a <SentenceCondition> syntax element. DE_Var_List is a string representing a list-structure (list(V1,list(V2,list(V3,nill)))) where the list-elements are on the format fstr(<DE_Variable>,domain,format,width), however where ` are used In place of "DE_Assignments is a list-structure where the elements are <Expression>'s representing the value (on structure-format, but with ` used In place of "), assigned to the data elements in the DE_Var_List.    
<SimpleDataElement> A simple data element is either a string (in quotes) [e.g. "this is a_string  "], an identifier i.e. a KB name [e.g. tHisIs_KBname03], an integer [e.g. 1239] or a fixed point number [e.g. 123.0001]. 
<SimpleExpression> <DataElement>
<Variable>
<CertaintyRuleCall>
<FunctionCall>
<ProcedureCall>
<DE_Reference>
Note that <ProcedureCall> and <Certainty RuleCall> only are allowed if within a DE_Assignments string in a <SetRuleCondition> element.
<SimpleVariable> Either an uppercase letter optionally followed by letters, digits or underscores [e.g. This_is_a_variable], or an underscore followed by letters, digits or underscores [e.g. _thisIsVar100]. Simple variable names must be constructed to avoid confusion with <DE_Variables>, also avoid names starting with P3_ .
<ST_Variable> pt ( <ArgumentVariable> { , <ArgumentVariable> }* { ,  <D_Variable> }* )
pt is the name of a predicate type. The <D_Variables>'s pertain to the data elements of the predicate (if any).
<Statement> <VariableCondition>
<DE_Reference>
<SentenceCountCondition>
<SwitchCall> name ( nill , nill , nill , nill , <ParameterPart> )
name ( oper , <SimpleDataElement> , nill , nill , <ParameterPart> )
name ( oper , <SimpleDataElement> , oper , <SimpleDataElement> , <ParameterPart> )
name is the called rule's name, while oper is one of the operators =,<,>,<=,>=,<>.
<SwitchCallRule> p3_iCswi( name , domain, <Call> , p3_iSwi ( <SwitchCall> { , <SwitchCall> }* ) , prior , outofcontext , <SimpleDataElement> , <Context> , <Parameters> )
Iname is the rule's name, domain is the return-domain, prior is the rule's prior probability, while outofcontext is the value returned if out of context.
<SwitchParameterRule> p3_iCswi( name , domain, parameter , p3_iSwi ( <SwitchCall> { , <SwitchCall> }* ) , prior , outofcontext , <SimpleDataElement> , <Context> , <Parameters> )
name is the rule's name, parameter is parameter (data element type name) used as criterion for the switch, domain is the return-domain, prior is the rule's prior probability, outofcontext is the value returned if out of context, while default is the rule's default return value.
<UnaryOperator> The unary operators include - and +.
<UnarySentence> pt ( <Entity> { , <DataElement>  }* )
pt is the name of a unary predicate type.
VAR Name of variable (first letter always upper case).
<Variable> <SimpleVariable>
<DE_Variable>
<ParameterVariable>
<VariableCondition <Variable> {<AssignmentOperator>|<ComparisonOperator>} <Expression>
<Weight> <Call>
weight
weight is a fixed-point number > 0