Domains specification in both .i and .cl files
Posted: 24 May 2020 16:37
Is there a way to expose a user-defined domain in both the .i and .cl files of a class that doesn't require using an additional 'helper' class (faceHelper.cl in the example below)?
I get error e205 Unknown domain/interface 'expressionDOM' in pack 'main.pack' face.i if I define the domain only in the .cl file, and a similar error if define it only in the .i file. Of course, defining the same domain in both the .i and .cl files is forbidden.
I get error e205 Unknown domain/interface 'expressionDOM' in pack 'main.pack' face.i if I define the domain only in the .cl file, and a similar error if define it only in the .i file. Of course, defining the same domain in both the .i and .cl files is forbidden.
Code: Select all
class face : face
open core
%domains
% expressionDOM = smiling; frowning.
constructors
new : (faceHelper::expressionDOM).
end class face
Code: Select all
interface face
open core
predicates
setExpression : (faceHelper::expressionDOM).
getExpression : () -> faceHelper::expressionDOM.
end interface face
Code: Select all
implement face
open core, faceHelper
%domains
% expressionDOM = smiling; frowning.
facts
expression : expressionDOM := erroneous.
clauses
new(Exp) :- expression := Exp.
setExpression(Exp) :- expression := Exp.
getExpression() = expression.
end implement face
Code: Select all
class faceHelper
open core
domains
expressionDOM = smiling; frowning.
end class faceHelper