welcome: please sign in
location: attachment:Visit-all-ENCODING.txt of OfficialProblemSuite

Attachment 'Visit-all-ENCODING.txt'

Download

   1 %
   2 % IPC 2011 Visit-all domain
   3 %
   4 %
   5 % ASP Competition 2013 version, by GB Ianni. Adaptment from a plasp PDDL2ASP conversion 
   6 % (http://www.cs.uni-potsdam.de/wv/pdfformat/gekaknsc11a.pdf)
   7 % 
   8 % 
   9 %
  10 % initial status
  11 %
  12 visited(X) :- at(X).
  13 atrobot(X,0) :- at(X).
  14 
  15 % GENERATE  >>>>>
  16 1 <= { move( Curpos,Nextpos,T ) : connected( Curpos,Nextpos ) , Curpos != Nextpos } <= 1 :- step(T).
  17 % <<<<<  GENERATE
  18 % 
  19 
  20 % 
  21 % 
  22 % EFFECTS APPLY  >>>>>
  23 
  24 % move/3, effects
  25 atrobot( Nextpos,T ) :- move( Curpos,Nextpos,T ).
  26 del( atrobot( Curpos ),T ) :- move( Curpos,Nextpos,T ).
  27 visited( Nextpos ) :- move( Curpos,Nextpos,T ).
  28 % <<<<<  EFFECTS APPLY
  29 % 
  30 
  31 % 
  32 % 
  33 % INERTIA  >>>>>
  34 atrobot( X,T ) :- step(T), atrobot( X,T-1 ), not del( atrobot( X ) ,T  ).
  35 %
  36 % GB: it is not needed to let 'visited' subject to timestamping 
  37 %
  38 % <<<<<  INERTIA
  39 % 
  40 
  41 % 
  42 % 
  43 % PRECONDITIONS HOLD  >>>>>
  44 
  45 % move/3, preconditions
  46  :- move( Curpos,Nextpos,T ), not atrobot(Curpos, T-1), step(T).
  47 % <<<<<  PRECONDITIONS HOLD
  48 % 
  49 
  50 goalreached :- N = #count{ X : visited(X) , visit(X) }, N = #count{ X : visit(X) }.
  51 :- not goalreached.
  52 
  53 
  54 
  55 % Gringo directives to show / hide particular literals
  56 %#hide.
  57 %#show move/3.

Attached Files

You are not allowed to attach a file to this page.