typescript 3.18 KB
Script started on Tue 23 Jun 2015 10:50:19 AM JST
spa@khawasaki:~/work/src/paccs/fzn-parser$ ./  , ./fznslurp examples/a.fzn > examples/
/a.ast 
| ?- 
spa@khawasaki:~/work/src/paccs/fzn-parser$ ./fznslurp examples/a.fzn > examples/
/a.ast wasaki:~/work/src/paccs/fzn-parser$ ./fznslurp examples/a.fzn > examples/a.ast 

spa@khawasaki:~/work/src/paccs/fzn-parser$ ./
examples/ fznslurp  fzp       
spa@khawasaki:~/work/src/paccs/fzn-parser$ ./ examples/a.fzn > examples/a.ast f examples/a.fzn > examples/a.ast  pa@khawasaki:~/work/src/paccs/fzn-parser$ ./fz examples/a.fzn > examples/a.ast 
 pa@khawasaki:~/work/src/paccs/fzn-parser$ ./fzp examples/a.fzn > examples/a.ast a@khawasaki:~/work/src/paccs/fzn-parser$ ./fzp


spa@khawasaki:~/work/src/paccs/fzn-parser$ ./fznslurp 
GNU Prolog 1.3.0
By Daniel Diaz
Copyright (C) 1999-2007 Daniel Diaz
| ?- slurp(e 'examples/a.f ast'< , X)('examples/a.ast', X).

X = [satisfy,[],constrs([constraint(int_lin_ne,(_,array(_),int):(id('X_INTRODUCED_0'),alit((_,_):(id(wa),id(nt))),lit(0)),[])]),vars([var(nt,int(1,3),[],[_:id(output_var)]),var(wa,int(1,3),[],[_:id(output_var)]),var('X_INTRODUCED_0',array(int,1,2),array(_):alit((int,int):(lit(1),lit(-1))),[])]),preds([])]

yes
| ?- slurp('examples/a.ast', X)._X).X). , member(Y X, _X)(X, _X).

X = satisfy ? ;

X = [] ? ;

X = constrs([constraint(int_lin_ne,(_,array(_),int):(id('X_INTRODUCED_0'),alit((_,_):(id(wa),id(nt))),lit(0)),[])]) ? ;

X = vars([var(nt,int(1,3),[],[_:id(output_var)]),var(wa,int(1,3),[],[_:id(output_var)]),var('X_INTRODUCED_0',array(int,1,2),array(_):alit((int,int):(lit(1),lit(-1))),[])]) ? ;

X = preds([]) ? ;

no
| ?- slurp('examples/a.ast', _X), member(X, _X).X, _X). _, _X)., _X). v, _X).a, _X).r, _X).s, _X).(, _X)._, _X).Y, _X).), _X).(_Y), _X). , member(_ Y, _Y)(Y, _Y).

Y = var(nt,int(1,3),[],[_:id(output_var)]) ? ;

Y = var(wa,int(1,3),[],[_:id(output_var)]) ? ;

Y = var('X_INTRODUCED_0',array(int,1,2),array(_):alit((int,int):(lit(1),lit(-1))),[]) ? ;

no
| ?- slurp('examples/a.ast', _X), member(vars(_Y), _X), member(Y, _Y).(_Y), _X), member(Y, _Y). (_Y), _X), member(Y, _Y). (_Y), _X), member(Y, _Y). (_Y), _X), member(Y, _Y). c(_Y), _X), member(Y, _Y).o(_Y), _X), member(Y, _Y).n(_Y), _X), member(Y, _Y).s(_Y), _X), member(Y, _Y).t(_Y), _X), member(Y, _Y).r(_Y), _X), member(Y, _Y).e(_Y), _X), member(Y, _Y).(_Y), _X), member(Y, _Y). s(_Y), _X), member(Y, _Y).(_Y), _X), member(Y, _Y).

Y = constraint(int_lin_ne,(_,array(_),int):(id('X_INTRODUCED_0'),alit((_,_):(id(wa),id(nt))),lit(0)),[]) ? ;

no
| ?- 

spa@khawasaki:~/work/src/paccs/fzn-parser$ exit

Script done on Tue 23 Jun 2015 10:52:37 AM JST