female('jane)! // jane is female
parent('jane,'john)! // jane is john's parent
parent('jane, 'wendy)! // jane is wendy's parent
mother('Mother, 'Child) :- parent('Mother, 'Child) & female('Mother) //'// a mother of a child is the child's parent and is female
mother('X, 'john)? // find john's mother
mother('jane, 'X)? // find's all of jane's children
的:-,!,?和 & 符号定义为普通方法。在 C + + 中仅 & 将是有效的,因此尝试将这个 DSL 映射到 C + + 将需要一些符号,这些符号已经引起了非常不同的概念。