Skip to content
EN FR

Core syntax and terms

Documentation status: reference — see Maturity and evidence.

H-Logic keeps conceptual structure explicit. Roles are written in parentheses, attributes in brackets, interfaces are attached with ::, and explicit named-term references use &.

Definitions and instances

define .:#Person(me)[name::#string];
#alice:#Person;
_:#Person;

x:#T is a typed term. A named instance such as #alice:#Person has a stable conceptual name. _:#Person denotes an anonymous instance. The distinguished me role is the semantic support/identity role of non-singleton entities; it is not a field that must be added to YAML or XML metadata.

Roles and attributes

define .:#worksFor(person:#Person, company:#Company, context:#Context);
define .:#Order(me)[amount::#float, status:#OrderStatus];

Parenthesized positions are structural roles. Bracketed positions are descriptive attributes. A structural role may also carry role-order metadata, for example context^2:#Context; the order annotation belongs to the declared role, not to quantified variables.

Commands

A bare assertion is a tell operation. The explicit forms make intention clearer:

projectBeta:#Context;
tell projectBeta:#Context;
do projectBeta:#Context;
ask .:#A(x) and .:#R(x, y) return x;

Use ask or ? to introduce a query. Query variables are ordinary role names inside the expression; do not prefix them as ?x.

Layering rule

YAML/XML describe application metadata, H-Logic expresses conceptual logic, and functionalP is used for procedural behavior when a declarative expression is not sufficient. Do not move semantic rules into procedural code merely because code is available.