users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Global Stack Overflow


From: Michael Closson
Subject: Global Stack Overflow
Date: Tue, 17 Jul 2001 10:48:20 -0600

Hello,

I am using gprolog to solve Temporal Reasoning, Constraint Satisfaction
Problems.  This is basically a standard CSP but using Temporal Intervals
as the variables.  I am using the built-in CLP/FD solver to do this.

My problem is that when solving a 30 variable problem with 435
constraints arcs, a Global Stack Overflow occurs.  I can increase the
size of the Global Stack to 229376 Kb but still have this problem.

Is there a way to get around this?  Posted below is a stripped down
sample problem if someone is interested what kind of code using.

Thanks,
Mike Closson


% temp1.pro - temporal reasoning in gprolog.

% assert some facts.

duration( john, 20 ).
duration( mike, 25 ).
duration( lisa, 30 ).

temp( J, M, L ) :-

        % assert domains.

        fd_domain( J, 20, 26 ),
        fd_domain( M, 30, 35 ),
        fd_domain( L, 20, 30 ),

        % specify constraints

        spec_constr( J, M, L ),

        % find a labeling

        fd_labeling( [ J, M, L ] ).

spec_constr( J, M, L ) :-

        % get durations

        duration( john, DJ ),
        duration( mike, DM ),
        duration( lisa, DL ),

        % constraint #1, M D L - Mike During Lisa

        M #> L,                         % Start time of Mike greater then start 
time of Lisa.
        ( M + DM ) #< ( L + DL ),       % End time of Mike less than end time 
of Lisa.

        % constraint #2, J S L, John starts Lisa.

        J #= L,                         % start time of John equal to start 
time of Lisa.
        ( J + DJ ) #< ( L + DL ),       % end time of John less than start time 
of Lisa.

        % constraint #3, J O M - John overlaps Mike.

        J #< M,                         % start time of John less than start 
time of Mike.
        ( J + DJ ) #< ( M + DM ),       % end time of John less then end time 
of Mike.
        M #< ( J + DJ ).                % start time of Mike less than end time 
of John.

        


reply via email to

[Prev in Thread] Current Thread [Next in Thread]