<s> """<STR_LIT>""" <EOL> from logpy import run , fact , eq , Relation , var <EOL> adjacent = Relation ( ) <EOL> coastal = Relation ( ) <EOL> coastal_states = '<STR_LIT>' . split ( '<STR_LIT:U+002C>' ) <EOL> for state in coastal_states : <EOL> fact ( coastal , state ) <EOL> with open ( '<STR_LIT>' ) as f : <EOL> adjlist = [ line . strip ( ) . split ( '<STR_LIT:U+002C>' ) for line in f <EOL> if line and line [ <NUM_LIT:0> ] . isalpha ( ) ] <EOL> for L in adjlist : <EOL> head , tail = L [ <NUM_LIT:0> ] , L [ <NUM_LIT:1> : ] <EOL> for state in tail : <EOL> fact ( adjacent , head , state ) <EOL> x = var ( ) <EOL> y = var ( ) <EOL> print run ( <NUM_LIT:0> , x , adjacent ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> print run ( <NUM_LIT:0> , x , adjacent ( '<STR_LIT>' , x ) ) <EOL> print run ( <NUM_LIT:0> , x , adjacent ( '<STR_LIT>' , x ) , <EOL> coastal ( x ) ) <EOL> print run ( <NUM_LIT:5> , x , coastal ( y ) , <EOL> adjacent ( x , y ) ) <EOL> print run ( <NUM_LIT:0> , x , adjacent ( '<STR_LIT>' , x ) , <EOL> adjacent ( '<STR_LIT>' , x ) ) </s>
