prolog scripting

I am running a tool in prolog and after the running is finished i have the fllowing result:

Graph Size statistics: Nodes = 1 Abstract Edges = 0 Cases = 1

-- Pruning outputs --

-- Print pruned output- (clock-2) MDGs options --
No printing (Return) / Statistics only (%) /
To screen (Space) / To file (FILE-NAME) :

pruned output- (clock-2)

t

Graph Size statistics: Nodes = 1 Abstract Edges = 0 Cases = 1

Error detected!

=== The Counterexample ===

-------- Assumptions --------

-------- Initial state --------
input = z3
nxa = 1
reg_output_signal = 1

-------- Clock cycle 1 --------

-- The symbolic input --

t_ls6 = 1
glitch_signal = dg
select2 = 1

-- The symbolic state --

reg_output_signal = dgp

-------- Clock cycle 2 --------

-- The symbolic input --

-- Symbolic Output --

flag = 1

=== End of counterexample ===

Generating counter example took 0.040 seconds.

=== Property checking failed ===

=== Performance statistics ===

Compiling:
Compiling individual components took: 0.300 seconds
Building the transition relations took: 0.020 seconds
Sub-total (component+transition relation): 0.320 seconds
Compiling (loading+deriving all the relations) took: 0.530 seconds
Garbage_collection: 0.000 seconds
Memory: 535924 bytes
Nodes: 495; Abstract Edges: 1;

-- Detailed statistics --
Run time: 0.530 seconds;
System time: 0.020 seconds;
Real time: 4.196 seconds

Virtual memory in use: 535924 bytes; Virtual memory free: -535924 bytes
Program space: 142732 bytes
Global stack memory: 393192 bytes; Local stack memory: 0 bytes
Global stack in use: 763424 bytes; Global stack free: -461084 bytes
Local stack in use: 604 bytes; Local stack free: -604 bytes
Trail 200
Garbage_collection 0 times: 0.000 seconds; 0 bytes freed
Global stack shift 0 times; Local stack shift 3 times; in 0.000 seconds
Number of atoms: 6; Atom space in use: 216 bytes; free: -48 bytes
Atom Garbage_collection 0 times: 0.000 seconds; 0 bytes freed

Verification:
Building initial state MDG took 0.010 seconds
Computing reachable states took : 0.030 seconds
Misc took : 0.060 seconds
Sub-total (reachability analysis) : 0.090 seconds
Verification (rechability analysis + init states generation) : 0.100 seconds
Garbage_collection: 0.020 seconds
Memory: 68764 bytes
Nodes: 169; Abstract edges : 0

but I only need the text in bold. so how can I copy it from prolog to another text file.

thanks

ghaith

#!/bin/sh

START="=== The Counterexample ==="
END="=== End of counterexample ==="
PRINTING=0

while read LINE
do
        if [[ "${PRINTING}" -eq 1 ]]
        then
                [[ "${LINE}" == "${END}" ]] && exit 0
                echo "${LINE}"
        else
                [[ "${LINE}" == "${START}" ]] && PRINTING=1
        fi
done
$ ./between.sh < input > output

hi,
thanks for replying,
but to which file you are copying the data I mean what is the name of the output file.?

and I did not understand the following part and where should I but it:
$ ./between.sh < input > output

thanks again,

Ghaith,

The output file is called 'output'.

In the shell. The script I gave you should be saved into a file named between.sh, and set executable with 'chmod +x'. Once that's done you can run it in the shell to process files like:

./between.sh < input > output

substitute the filenames you want, but the < > aren't decorations, they open files for input and output.

the problem here is the result is not in file it is on show in screen so I need some kind of command to copy it from prolog.

thanks,

So redirect its output into a file using the same syntax I just did above.

$ program_that_runs_prolog_code < input > output

or you could just pipe it into the program directly.

$ program_that_runs_prolog_code | ./between.sh