I have a problem defining procedures in Prolog. I have two source files and you want to consult the Prolog engine with both of them. This can be done by calling Prolog as swipl -g "['1.pl', '2.pl'].
Both files are generated by another program written in a different programming language, and I cannot predict the exact contents of the files in advance.
The problem is that one of the files always has a rule
predicate1(X):-predicate2(X).
But sometimes the rule
predicate2(something):-body
does not exist in both files, and I get the error "predicate2" undefined when I execute some queries for predicate1.
If I include the string
:- dynamic(predicate2/2).
, /2 ( - " , 2/2?". -, .
, , "". SWI-Prolog SICStus Prolog. ( , , )