<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE nta PUBLIC '-//Uppaal Team//DTD Flat System 1.1//EN' 'http://www.it.uu.se/research/group/darts/uppaal/flat-1_2.dtd'>
<nta>
	<declaration>// Place global declarations here.
//this model checks probability by contructing secret chain
const int N = 4;//max number of pools
const int PEERS = 4; // maximum number of peers
const int MAX_WALLET = PEERS+1;
broadcast chan blockSolution;
broadcast chan secretSolution;
const int HASHSIZE = 30000; //hashes are stored as integers
const int MAX_TRANSACTION = 30000;//maximum number of transactions
const int MAX_BLOCK = 30000; //maximum number of blocks
const int MAX_ORPHAN_BLOCK = 1; //maximum number of blocks
bool flag =false;
const int MAX_POOL_SIZE = PEERS+1; //maximum size of the Pool
const int UNCONFIRMED = 0;
const int CONFIRMED = 1;
const int INVALID = 2;
typedef int[1,N] id_t;//Pool ID
typedef int[-1,HASHSIZE] BLOCKHASH; //first block will refer to -1
typedef int[-1,MAX_TRANSACTION] TXNUMBER;//first transaction will refer to -1
typedef int[0,PEERS+N] PEER;// there will be senders who do not take part in mining. These will just send transactions.


int [0, MAX_POOL_SIZE] tranIndex = 0;
int [0, MAX_POOL_SIZE] tranIndex2 = 0;
//output transaction structure
typedef struct{
    PEER Address;
}TXOUT;

int confirmation = 0;
int confirmation_counter = 0;
//input transaction structure
typedef struct{
    TXNUMBER id;
}TXIN;

//Assumption: There is  one input and two output transaction
typedef struct {
    TXNUMBER Id;
    TXIN TxInput;
    TXOUT TxOutput;	
}Tx; //transaction


//Assumption only one transaction will be included in one block
typedef struct {
BLOCKHASH num;
BLOCKHASH prevBlocknum;	
Tx tx;	
}Block; //block details


//Blockchain structure with maximum of 20 blocks
typedef struct{
    Block chain[MAX_BLOCK];
}BlockChain;

//wallet will be used by peers to maintain unspent output from every transaction
typedef struct{
    TXNUMBER Id;
}Wallet;

//Every transaction will have a unique number. Therefore stored here as global.
TXNUMBER Tx_num = PEERS+1;

//Every block will have a unique number interms of hash.
BLOCKHASH Block_num = 2;

Tx TxPool[MAX_POOL_SIZE]; //transaction pool. 
Tx MPeerPool; //this is for MPeer and MPool


meta Block Chain;
meta BLOCKHASH Blocknum;





</declaration>
	<template>
		<name x="5" y="5">Pool</name>
		<parameter>const id_t id,  const int &amp;rateX,  const int &amp;rateY</parameter>
		<declaration>// Place local declarations here.
clock x;

//This variable stores the transaction that the pool is trying to include in a block
Tx localTx;

//stores only the last block of the chain.
int chain1[4];

/**
 * This function intialises the two chains and the transaction pool
 */
void initial()
{
    int i;
    chain1[0] = 1;
    chain1[1] = 0;
    chain1[3] = 1;
    for(i = 0; i &lt; MAX_POOL_SIZE; i++)
    {
        if(TxPool[i].Id == 0) 
            TxPool[i].Id = -1;
    }
}
/**
 * This function checks for transaction in the transaction pool.
 * @param none.
 * @return boolean. It will return true if there is transaction in pool.
 */
bool checkTxPool()
{
    bool flag = false;
    int i;
    if((TxPool[tranIndex2].Id != -1  ))
    {
        flag = true;
    }
    return flag;
}
/**
 * This function gets the detail of the transaction from the transaction pool and 
 * places in local variable localTx.
 * @param none.
 * @return none.
 */
void getTransaction()
{
    localTx.Id = TxPool[tranIndex2].Id;
    localTx.TxInput.id = TxPool[tranIndex2].TxInput.id;
    localTx.TxOutput.Address = TxPool[tranIndex2].TxOutput.Address;
}
/**
 * This function resets local variable localTx.
 * @param none.
 * @return none.
 */
void resetLocalTx()
{
    localTx.Id = -1;
    localTx.TxInput.id = -1;
    localTx.TxOutput.Address = 0;
}


/**
 * This function removes a transaction from the transaction pool.
 * @param none.
 * @return none.
 */
void removeTxPool()
{
    TxPool[tranIndex2].Id = -1;
    TxPool[tranIndex2].TxInput.id = -1;
    TxPool[tranIndex2].TxOutput.Address = 0;       
}
/**
 * This function is executed when a pool broadcasts a block. 
 * It updates the global variable with block information, 
 * increments block number, removes transaction from pool 
 * and resets local varable localTx .
 * @param none.
 * @return none.
 */
void updateBlockChain()
{
    //update on global variable
    Chain.num = Block_num;  
    Chain.tx.Id = localTx.Id;
    Chain.tx.TxInput.id = localTx.TxInput.id;
    Chain.tx.TxOutput.Address = localTx.TxOutput.Address;
    Chain.prevBlocknum = chain1[0];
    chain1[0] = Chain.num;
    chain1[1] = Chain.prevBlocknum;
    chain1[2] = id;
    if (MPeerPool.Id != 0 )
        flag = true;  

    //update global variable block hash
    Block_num = (Block_num + 1)% HASHSIZE;
    //remove transaction from pool
    removeTxPool();
    //reset localTx
    resetLocalTx();
    tranIndex2 = (tranIndex2 + 1)%MAX_POOL_SIZE;

}
/**
 * This function is executed when a pool recieves a block. 
 * It updates the block chain.
 * @param none.
 * @return none.
 */
void addBlock()
{  
    chain1[0] = Chain.num;
    chain1[1] = Chain.prevBlocknum;
}
</declaration>
		<location id="id0" x="-1878" y="-2210">
			<name x="-1870" y="-2244">MineY</name>
			<label kind="exponentialrate" x="-1870" y="-2193">1:rateY</label>
		</location>
		<location id="id1" x="-2261" y="-2210">
			<name x="-2271" y="-2244">Initial</name>
			<committed/>
		</location>
		<location id="id2" x="-2125" y="-2210">
			<name x="-2167" y="-2244">MineX</name>
			<label kind="exponentialrate" x="-2116" y="-2201">1:rateX</label>
		</location>
		<init ref="id1"/>
		<transition>
			<source ref="id0"/>
			<target ref="id2"/>
			<label kind="synchronisation" x="-2065" y="-2108">blockSolution?</label>
			<label kind="assignment" x="-2065" y="-2091">addBlock()</label>
			<nail x="-1878" y="-2108"/>
			<nail x="-2125" y="-2108"/>
		</transition>
		<transition>
			<source ref="id2"/>
			<target ref="id0"/>
			<label kind="guard" x="-2082" y="-2235">checkTxPool()&amp;&amp; flag == false</label>
			<label kind="assignment" x="-2048" y="-2210">getTransaction()</label>
		</transition>
		<transition>
			<source ref="id1"/>
			<target ref="id2"/>
			<label kind="assignment" x="-2218" y="-2201">initial()</label>
		</transition>
		<transition>
			<source ref="id2"/>
			<target ref="id2"/>
			<label kind="synchronisation" x="-2218" y="-2107">blockSolution?</label>
			<label kind="assignment" x="-2218" y="-2091">addBlock()</label>
			<nail x="-2210" y="-2108"/>
			<nail x="-2125" y="-2108"/>
		</transition>
		<transition>
			<source ref="id0"/>
			<target ref="id2"/>
			<label kind="synchronisation" x="-2065" y="-2354">blockSolution!</label>
			<label kind="assignment" x="-2065" y="-2337">updateBlockChain()</label>
			<nail x="-1878" y="-2312"/>
			<nail x="-2125" y="-2312"/>
		</transition>
	</template>
	<template>
		<name>Peer</name>
		<parameter>const PEER id, const int &amp;confirmation_no</parameter>
		<declaration>clock x1;

//wallet stores transactions that has not been spent
Wallet wallet[MAX_WALLET];

//two indexes to keep track of wallet. One for inserting and second for removing transaction.
int [0,MAX_WALLET]walletIndex = 1;
int [0,MAX_WALLET]walletIndex2 = 0;

/**
 * This function intialises the wallet.
 */
void initial()
{
    int i;
    wallet[0].Id = id;
    for(i = 1; i &lt; MAX_WALLET;i++)
        wallet[i].Id = -1; 
    for(i = 0; i &lt; MAX_POOL_SIZE; i++)
    {
        if(TxPool[i].Id == 0) 
            TxPool[i].Id = -1;
    }
}

/**
 * This function creates a transaction and places in the transaction pool.
 * @param Add of type Peer.
 * @return none.
 */
void create_Transaction(PEER Add)
{
    int i, index = -1, j;
    TxPool[tranIndex].Id = Tx_num;
    TxPool[tranIndex].TxInput.id = wallet[walletIndex2].Id;
    TxPool[tranIndex].TxOutput.Address = Add;
    wallet[walletIndex2].Id = -1; 
    walletIndex2 = (walletIndex2 + 1)%MAX_WALLET;
    Tx_num = (Tx_num + 1)% MAX_TRANSACTION;
    tranIndex = (tranIndex + 1) %MAX_POOL_SIZE;
}

/**
 * This function checks for transaction in the wallet. 
 * This transaction will be used to create another transaction 
 * and this transaction will serve as an input.
 * @param none.
 * @return none.
 */
bool checkWallet()
{
    bool flag = false;
    if(wallet[walletIndex2].Id !=-1)
    {
        flag = true;
    }
    return flag;
}

/**
 * This function updates wallet with transaction that is for this peer. 
 * @param none.
 * @return none.
 */
void updateWallet()
{
    if ( Chain.tx.TxOutput.Address == id)
    {
        wallet[walletIndex].Id = Chain.tx.Id;
        walletIndex = (walletIndex + 1) % MAX_WALLET;
    }
}
</declaration>
		<location id="id3" x="-816" y="-102">
			<name x="-826" y="-136">Initial</name>
			<committed/>
		</location>
		<location id="id4" x="-680" y="-102">
			<name x="-714" y="-93">Wait</name>
			<label kind="exponentialrate" x="-690" y="-68">1:1</label>
		</location>
		<init ref="id3"/>
		<transition>
			<source ref="id4"/>
			<target ref="id4"/>
			<label kind="synchronisation" x="-704" y="-391">secretSolution?</label>
			<label kind="assignment" x="-704" y="-374">updateWallet()</label>
			<nail x="-722" y="-374"/>
			<nail x="-612" y="-374"/>
		</transition>
		<transition>
			<source ref="id4"/>
			<target ref="id4"/>
			<label kind="synchronisation" x="-510" y="-382">blockSolution?</label>
			<label kind="assignment" x="-510" y="-365">updateWallet(),
x1=0</label>
			<nail x="-569" y="-357"/>
			<nail x="-467" y="-297"/>
		</transition>
		<transition>
			<source ref="id3"/>
			<target ref="id4"/>
			<label kind="assignment" x="-765" y="-93">initial()</label>
		</transition>
		<transition>
			<source ref="id4"/>
			<target ref="id4"/>
			<label kind="select" x="-399" y="-280">add:int[1,PEERS-1]</label>
			<label kind="guard" x="-399" y="-263">checkWallet() &amp;&amp; flag == false</label>
			<label kind="assignment" x="-399" y="-246">create_Transaction(add),
x1 = 0</label>
			<nail x="-399" y="-170"/>
			<nail x="-450" y="-280"/>
		</transition>
	</template>
	<template>
		<name>MPeer</name>
		<parameter>const PEER id</parameter>
		<declaration>clock x1;
Wallet wallet[1];
int counter = 0;

/**
 * This function intialises the wallet.
 */
void initial()
{
    int i;
    wallet[0].Id = id;
}

/**
 * This function creates a transaction and places in the transaction pool.
 * @param Add of type Peer.
 * @return none.
 */
void create_Transaction(PEER Add)
{
    int i, index = -1, j;
    TxPool[tranIndex].Id = Tx_num;
    TxPool[tranIndex].TxInput.id = wallet[0].Id;
    TxPool[tranIndex].TxOutput.Address = Add;    
    Tx_num = (Tx_num + 1)% MAX_TRANSACTION;
    tranIndex = (tranIndex + 1) %MAX_POOL_SIZE;
}
/**
 * This function creates a malicious transaction and places in the malicious peer variable.
 * @param none.
 * @return none.
 */
void createDuplicateTransaction()
{
    MPeerPool.Id = Tx_num;
    MPeerPool.TxInput.id = wallet[0].Id;
    MPeerPool.TxOutput.Address = id;
    Tx_num = (Tx_num + 1)% MAX_TRANSACTION;
}

</declaration>
		<location id="id5" x="-816" y="-102">
			<name x="-826" y="-136">Initial</name>
			<committed/>
		</location>
		<location id="id6" x="-680" y="-102">
			<name x="-714" y="-93">Wait</name>
		</location>
		<init ref="id5"/>
		<transition>
			<source ref="id5"/>
			<target ref="id6"/>
			<label kind="select" x="-798" y="-153">add:int[1,PEERS]</label>
			<label kind="assignment" x="-765" y="-93">initial(),
create_Transaction(add),
createDuplicateTransaction(),
x1 = 0,
counter++</label>
		</transition>
	</template>
	<template>
		<name>MPool</name>
		<parameter>const id_t ID,   const int &amp;rateX, const int &amp;confirmation_no, const int &amp;rateY</parameter>
		<declaration>// Place local declarations here.
clock x;

//This variable stores the transaction that the pool is trying to include in a block
Tx localTx;

//stores only the last block of the chain.
int chain1[5];
int chain2[5];


bool raceFlag = false, raceSuccess = false, raceflag = false;
//keeps track of the length of two chains
int blockDifference = 0;
int blockDifference1 = 0;

/**
 * This function intialises the two chains and the transaction pool
 * @param none.
 * @return none.
 */
void initial()
{
    int i;
    confirmation = confirmation_no;
    chain1[0] = 1;
    chain1[1] = 0;
    chain1[3] = 1;
    chain2[0] = 1;
    chain2[1] = 0;
    chain2[3] = 1;
    for(i = 0; i &lt; MAX_POOL_SIZE; i++)
    {
        if(TxPool[i].Id == 0) 
            TxPool[i].Id = -1;

    }
}


//
void resetMPeerPool()
{
    MPeerPool.Id = 0;
    MPeerPool.TxOutput.Address = 0;

}

/**
 * This function checks for transaction in the transaction pool.
 * @param none.
 * @return boolean. It will return true if there is transaction in pool.
 */
bool checkTxPool()
{
    bool flag = false;
    int i;
        if((TxPool[tranIndex2].Id != -1 ))
        {
            flag = true;
        }

    return flag;
}

/**
 * This function gets the detail of the transaction from the transaction pool and 
 * places in local variable localTx.
 * @param none.
 * @return none.
 */
void getTransaction()
{
    localTx.Id = TxPool[tranIndex2].Id;
    localTx.TxInput.id = TxPool[tranIndex2].TxInput.id;
    localTx.TxOutput.Address = TxPool[tranIndex2].TxOutput.Address;
}
/**
 * This function resets local variable localTx.
 * @param none.
 * @return none.
 */
void resetLocalTx()
{
    localTx.Id = -1;
    localTx.TxInput.id = -1;
    localTx.TxOutput.Address = 0;
}


/**
 * This function removes a transaction from the transaction pool.
 * @param none.
 * @return none.
 */
void removeTxPool()
{
    TxPool[tranIndex2].Id = -1;
    TxPool[tranIndex2].TxInput.id = -1;
    TxPool[tranIndex2].TxOutput.Address = 0;
}

/**
 * This function is executed when a pool broadcasts a block. 
 * It updates the global variable with block information, 
 * increments block number, removes transaction from pool 
 * and resets local varable localTx .
 * @param none.
 * @return none.
 */
void updateBlockChain()
{
    if(raceFlag == false)
    {

    }
    else
    {
        chain2[1] = chain2[0];
        Chain.num = Block_num;
        Chain.prevBlocknum = chain2[1];
        Chain.tx.Id = localTx.Id;
        Chain.tx.TxInput.id = localTx.TxInput.id;
        Chain.tx.TxOutput.Address = localTx.TxOutput.Address;
        chain2[0] = Chain.num;
        chain2[2] = ID;
        chain2[4] = localTx.TxInput.id;
        blockDifference++;
        if (blockDifference &gt;= blockDifference1 &amp;&amp; blockDifference1 &gt; confirmation_no)
            {
                raceSuccess = true;
            }
        raceflag = true;
    }
 
    //update global variable block hash
    Block_num = (Block_num + 1)%HASHSIZE;
    //remove transaction from pool
    
    if(MPeerPool.Id == 0)
    {   
        removeTxPool();
        tranIndex2 = (tranIndex2 + 1)% MAX_POOL_SIZE;
    }
    else
        resetMPeerPool();
    resetLocalTx();
}
/**
 * This function is executed when a pool recieves a block. 
 * It updates the block chain and the block difference variable.
 * @param none.
 * @return none.
 */
void addBlock()
{           
    chain1[0] = Chain.num;
    chain1[1] = Chain.prevBlocknum;
    blockDifference1++;
    chain1[4] = Chain.tx.TxInput.id;
}
   
   </declaration>
		<location id="id7" x="-1700" y="-2210">
			<name x="-1710" y="-2244">MineY</name>
			<label kind="exponentialrate" x="-1700" y="-2201">1:rateY</label>
		</location>
		<location id="id8" x="-1972" y="-2210">
			<name x="-2014" y="-2261">MineX</name>
			<label kind="exponentialrate" x="-2031" y="-2244">1:rateX</label>
		</location>
		<location id="id9" x="-2108" y="-2210">
			<name x="-2134" y="-2244">Initial</name>
			<committed/>
		</location>
		<init ref="id9"/>
		<transition>
			<source ref="id7"/>
			<target ref="id8"/>
			<label kind="synchronisation" x="-1895" y="-2295">blockSolution?</label>
			<label kind="assignment" x="-1895" y="-2278">addBlock()</label>
			<nail x="-1700" y="-2278"/>
			<nail x="-1972" y="-2278"/>
		</transition>
		<transition>
			<source ref="id8"/>
			<target ref="id7"/>
			<label kind="guard" x="-1955" y="-2167">MPeerPool.Id != 0  &amp;&amp;  flag == true</label>
			<nail x="-1929" y="-2167"/>
			<nail x="-1768" y="-2167"/>
		</transition>
		<transition>
			<source ref="id8"/>
			<target ref="id7"/>
			<label kind="guard" x="-1954" y="-2244">checkTxPool() &amp;&amp; MPeerPool.Id ==0</label>
			<label kind="assignment" x="-1904" y="-2210">getTransaction()</label>
		</transition>
		<transition color="#0000ff">
			<source ref="id7"/>
			<target ref="id8"/>
			<label kind="guard" x="-1878" y="-2116">flag == true</label>
			<label kind="assignment" x="-1878" y="-2091">raceFlag = true,
updateBlockChain(),
flag = false,
confirmation_counter = 0</label>
			<nail x="-1700" y="-2091"/>
			<nail x="-1972" y="-2091"/>
		</transition>
		<transition>
			<source ref="id9"/>
			<target ref="id8"/>
			<label kind="assignment" x="-2082" y="-2235">initial()</label>
		</transition>
		<transition>
			<source ref="id8"/>
			<target ref="id8"/>
			<label kind="synchronisation" x="-2057" y="-2082">blockSolution?</label>
			<label kind="assignment" x="-2057" y="-2065">addBlock()</label>
			<nail x="-1972" y="-2091"/>
			<nail x="-2057" y="-2091"/>
		</transition>
		<transition>
			<source ref="id7"/>
			<target ref="id8"/>
			<label kind="guard" x="-1861" y="-2380">flag == false</label>
			<label kind="synchronisation" x="-1861" y="-2363">secretSolution!</label>
			<label kind="assignment" x="-1870" y="-2337">updateBlockChain()</label>
			<nail x="-1700" y="-2337"/>
			<nail x="-1972" y="-2337"/>
		</transition>
	</template>
	<system>// Place template instantiations here.

// List one or more processes to be composed into a system.
/*


Pool1 = Pool(1, 2716);//20%
Pool2 = Pool(2, 1940);//28%
Pool3 = Pool(3, 2469);//22%
Pool4 = MPool(4, 1811,4);//30%

Pool1 = Pool(1, 1811);//30%
Pool2 = Pool(2, 1940);//28%
Pool3 = Pool(3, 2469);//22%
Pool4 = MPool(4, 2716,3);//20%

Pool1 = Pool(1, 1207);//45%
Pool2 = Pool(2, 3018);//18%
Pool3 = Pool(3, 2469);//22%
Pool4 = MPool(4, 3622,3);//15%

Pool1 = Pool(1, 1086);//50%
Pool2 = Pool(2, 1811);//30%
Pool3 = Pool(3, 3622);//15%
Pool4 = MPool(4, 10867,2);//5%

Pool1 = Pool(1, 5433,1);
Pool2 = Pool(2, 3018,1);
Pool3 = Pool(3, 2469,1);
Pool4 = MPool(4, 1041,1,1);



Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 1811, 2716);//30%  20
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 5433,2,1358 );//10% 40

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 1811, 2716);//30%  20
Pool3 = Pool(3, 10867,1207);//5%  45
Pool4 = MPool(4, 3622,5,1552 );//15% 35

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 3622, 1552); //15 35
Pool3 = Pool(3, 10867,1207);//5%  45
Pool4 = MPool(4, 1811,5,2716 );///30%  20

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 3622, 1552); //15 35
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 2173,6,2173 );///25%  25

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 3622, 1552); //15 35
Pool3 = Pool(3, 3622,1552);//15%  35
Pool4 = MPool(4, 2716,4,1811 );///20%  30






Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 3622, 1552); //15 35
Pool3 = Pool(3, 2716,1811);//20%  30
Pool4 = MPool(4, 3622,2,1552 );///15%  35

Pool1 = Pool(1, 1552, 3622);//35% 15%
Pool2 = Pool(2, 10867, 1207); //5 45
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 1207,2,10867 );///45%  5

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 1811, 2716);//30%  20
Pool3 = Pool(3, 3622,1552);//15%  35
Pool4 = MPool(4, 10867,1,1207 );//5% 45

Pool1 = Pool(1, 1552, 3622);//35% 15%
Pool2 = Pool(2, 10867, 1207); //5 45
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 1086,2,54339 );///50%  1

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 10867, 1207); //5 45
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 1552,1,3622 );///35%  15

Pool1 = Pool(1, 1086, 54339);//50% 1%
Pool2 = Pool(2, 3622, 1552); //15 35
Pool3 = Pool(3, 3622,1552);//15%  35
Pool4 = MPool(4, 2716,1,1811 );///20%  30

Pool1 = Pool(1, 1811, 2716);//30%  20
Pool2 = Pool(2, 3622,1552);//15%  35
Pool3 = Pool(3, 2716,1811);//20%  30
Pool4 = MPool(4, 1552,1,3622 );///35%  15

Pool1 = Pool(1, 1552, 3622);//35%  15
Pool2 = Pool(2, 3622,1552);//15%  35
Pool3 = Pool(3, 2716,1811);//20%  30
Pool4 = MPool(4, 1811,4,2716 );///30%  20

Pool1 = Pool(1, 1552, 3622);//35%  15
Pool2 = Pool(2, 3622,1552);//15%  35
Pool3 = Pool(3, 1811,2716);//30%  20
Pool4 = MPool(4, 2716,4,1811 );///20%  30



Pool1 = Pool(1, 1552, 3622);//35%  15
Pool2 = Pool(2, 1552,3622);//35%  15
Pool3 = Pool(3, 2173,2173);//25%  25
Pool4 = MPool(4, 10867,2,1207 );///5%  45

Pool1 = Pool(1, 1552, 3622);//35% 15%
Pool2 = Pool(2, 10867, 1207); //5 45
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 1207,2,10867 );///45%  5

Pool1 = Pool(1, 1552, 3622);//35% 15%
Pool2 = Pool(2, 5433, 1358); //10 40
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 1358,4,5433 );///40%  10

Pool1 = Pool(1, 1552, 3622);//35% 15%
Pool2 = Pool(2, 10867, 1207); //5 45
Pool3 = Pool(3, 5433,1358);//10%  40
Pool4 = MPool(4, 1207,2,10867 );///45%  5

Pool1 = Pool(1, 1552, 3622);//35%  15
Pool2 = Pool(2, 1552,3622);//35%  15
Pool3 = Pool(3, 2173,2173);//25%  25
Pool4 = MPool(4, 10867,3,1207 );///5%  45

Pool1 = Pool(1, 1811, 2716);//30%  20
Pool2 = Pool(2, 1552,3622);//35%  15
Pool3 = Pool(3, 2716,1811);//20%  30
Pool4 = MPool(4, 3662,6,1552 );///15%  35

Pool1 = Pool(1, 1552, 3622);//35%  15
Pool2 = Pool(2, 5433,1358);//10%  40
Pool3 = Pool(3, 1811,2716);//30%  20
Pool4 = MPool(4, 2173,6,2173 );///25%  25

5&amp; 50 &amp;35 &amp; 20 &amp; 35 &amp;20 &amp; 25 &amp; 10\\
10&amp;45&amp;35&amp;20&amp; 30&amp;25&amp; 25&amp;10\\%0


15&amp;40&amp;30&amp;25 &amp;30&amp;25 &amp;25&amp;10\\%done 15 30 15 40
20 &amp; 35&amp;30&amp; 25&amp; 25&amp;20&amp; 25&amp; 20\\%done 20 30 10 40
25&amp;30&amp;30&amp;25&amp; 25&amp;25&amp; 20&amp;20\\%done 25 25 10 40
30&amp;25&amp;30&amp;25 &amp;20&amp;25 &amp;20&amp;25\\%30 40 15 15
35&amp;20&amp;25&amp;30 &amp;20&amp;25 &amp;20&amp;25\\%35 40 15 10
40&amp;15&amp;20&amp;30 &amp;20&amp;30 &amp;20&amp;25\\%done 40 10 10 40
45&amp;10&amp;20&amp;30 &amp;15&amp;40&amp; 20&amp;20\\%done 45 10 10 35
50&amp;5&amp;15&amp;40 &amp;15&amp;40 &amp;20&amp;15\\%done 50 10 5 35 
*/


Pool1 = Pool(1, 2716, 1811);//40% 15%
Pool2 = Pool(2, 3622, 679); //20 45
Pool3 = Pool(3, 3622,679);//30%  40
Pool4 = MPool(4, 1086,1,5433 );///10%  1



Peer1 = Peer(1, 0);
Peer2 = Peer(2, 0);
Peer3 = Peer(3, 0);
MPeer1 = MPeer(4);
MPeer2 = MPeer(4);
MPeer3 = MPeer(5);
//Peer5 = Peer(4, 0);
//Peer6 = Peer(5, 0);
//Peer7 = Peer(6, 0);
system   Pool4, Pool1, Pool2,Pool3,  Peer1, Peer2,Peer3, MPeer1;//Peer5, Peer6, Peer7, MPool1;
    

</system>
	<queries>
		<query>
			<formula>Pr[#&lt;=10000](&lt;&gt;   Pool4.raceSuccess == true)
			</formula>
			<comment>
			</comment>
		</query>
	</queries>
</nta>
