As you see I'm new with Prolog and POO.
I enconter many difficulties with VP, but I'm persevering...
Today I can't run program I wrote with data declared as class facts.
it give me a compile error on Clause Run:
e631 The predicate 'main::run/0', which is declared as 'procedure', is actually 'nondeterm' main.pro
The error seems to be on the line : "male(X).." in Run Clause.
But I don't know why..?
Could you help ?
Thanks
Jeangil
NB(Forgot my last topic 2 days ago..)
see my listing below:
Code: Select all
implement main
    open core
 
domains
    person = symbol.
    subject = symbol.
    age_year = integer.
    college_year = integer.
 
class facts
    male : (person) nondeterm.
    female : (person) nondeterm.
    year : (person, college_year) nondeterm.
    studies : (person, subject) nondeterm.
    age : (person, age_year) nondeterm.
 
clauses
    male("tim").
    male("marc").
    male("simon").
 
    female("louise").
    female("hazel").
    female("marie").
 
    year("tim", 4).
    year("marc", 1).
    year("simon", 2).
    year("louise", 3).
    year("hazel", 1).
    year("marie", 4).
 
    studies("tim", "history").
    studies("marc", "philosophy").
    studies("simon", "mathematic").
    studies("louise", "computer_science").
    studies("hazel", "chemistry").
    studies("marie", "art").
 
    age("tim", 24).
    age("marc", 18).
    age("simon", 25).
    age("louise", 21).
    age("hazel", 22).
    age("marie", 32).
 
clauses
    run() :-
        console::init(),
        male(X),
        stdio::writef("% is a male \n", X).
 
end implement main
 
goal
    console::runUtf8(main::run).