Question: Does anybody know where to find a Prolog algorithm for computing the probability of a disjunction for N dependent events? For N = 2 i know that P(E1 OR E2) = P(E1) + P(E2) - P(E1) \* P(E2), so one could do:

```
prob_disjunct(E1, E2, P):- P is E1 + E2 - E1 * E2

```

But how can this predicate be generalised to N events when the input is a list? Maybe there is a package which does this?

Kinds regards/JCR

Answer: 
Im posting this because finally I could recover the corrupted table and for somenone that would find this helpful.

What I did after replacing these files: c230.dat, c241.dat and c251.dat 

I investigated how to recover corrupted tables and found this great page:

<https://givemethechills.com/recovering-a-corrupted-embedded-apache-derby-database-after-an-error-xj040-or-if-you-get-an-error-xsdg2/>

That basically gave these steps:

1. Download the latest derby bin.
2. Add **DerbyRecovery-0.0.1-SNAPSHOT.jar** to the **ij** classpath
3. Run **dataFileVTI.sql** (remember to change the route to the database in the connect string)
4. Enter **ij** and connect to the database using `upgrade=true`
5. Use `call SYSCS_UTIL.SYSCS_REGISTER_TOOL('customTool',true,'RawDBReader', 'CONTROL','RAW_','c:db','','APP',null);` -> change the db route, password, bootpassword and schema
6. Check with `select * from raw_app.table1;`

I only got the 3rd step and then decided to restore the database with this command in **ij**:

`jdbc:derby:sample;restoreFrom=c:\Derby.DB`

and this worked. After this I could access the table that I needed, with all the records.

So probably only running this command in **ij** worked after replacing the files, but I'm posting everything I did just in case.

Thanks to all that helped!
Karina S.
[This is not really a solution, but is too long to post as a comment.]

Someone else had the same problem as you (`ERROR X0Y32: Statement 'getUDTs' already exists...`). See Bug Report DERBY-5371: [Database fails to boot, complaining that the getProcedureColumns() system procedure already exists](https://issues.apache.org/jira/browse/DERBY-5371)

The final comment in the thread states: 

> 
> I had a customer who was also hit by this problem on an old database,
>  with the same error that Andreas reported.
> 
> 
> `Caused by: java.sql.SQLException: Statement 'getUDTs' already exists
>  in Schema 'SYS'.` 
> 
> 
> Running the command:
> 
> 
> `values syscs_util.syscs_get_database_property( 'DataDictionaryVersion'
>  )`
> 
> 
> returned 10.5. 
> 
> 
> I used the same trick of loading fresh c230.dat, c241.dat and c251.dat files in order to get the database to boot.
> 
> 
> 

I'm not sure what exactly has to be done to load *"fresh c230.dat, c241.dat and c251.dat files in order to get the database to boot"*, but if that makes sense to you it might be worth trying.