Prove by resolution refutation that D is a logical consequen
Prove by resolution refutation that ¬D is a logical consequence of the following axioms:
• A C
• (E ¬F) (¬D G)
• (A C) (D F)
• ¬(C (D C)) (G ¬F)
Solution
// A Dynamic Programming primarily based resolution that uses table C[][] to
// calculate the Binomial constant
#include<stdio.h>
// paradigm of a utility operate that returns minimum of 2 integers
int min(int a, int b);
// Returns worth of Binomial constant C(n, k)
int binomialCoeff(int n, int k)
{
int C[n+1][k+1];
int i, j;
// Caculate worth of Binomial constant in bottom up manner
for (i = 0; i <= n; i++)
zero || j == i)
C[i][j] = 1;
// Calculate worth victimization previosly keep values
else
C[i][j] = C[i-1][j-1] + C[i-1][j];
}
}
come back C[n][k];
}
// A utility operate to come back minimum of 2 integers
int min(int a, int b)
{
come back (a<b)? a: b;
}
/* Drier program to check on top of function*/
int main()
main:
j mm
mm:
la $a3, array_A # base address for array_A loaded into $a3
la $a1, array_B # base address for array_B loaded into $a1
la $a2, array_C # base address for array_C loaded into $a2
li $t1, four # $t1 = four (row-size and loop end)
li $s0, zero # i = 0; initialize first for loop
loop1:
li $s1, zero # j = 0; restart 2d for loop
loop2:
li $s2, zero # k = 0; restart third for loop
sll $t2, $s0, two # $t2 = i * four (size of row of c)
addu $t2, $t2, $s1 # $t2 = i * size(row) + j
sll $t2, $t2, two # $t2 = computer memory unit offset of [i][j]
addu $t2, $a2, $t2 # $t2 = computer memory unit offset of [i][j]
lw $t4, 0($t2) # $t4 = two bytes of c[i][j]
loop3:
sll $t0, $s2, two # $t0 = k * four (size of row of b)
addu $t0, $t0, $s1 # $t0 = k * size(row) + j
sll $t0, $t0, two # $t0 = computer memory unit offset off [k][j]
addu $t0, $a1, $t0 # $t0 = computer memory unit address of b[k][j]
lw $t5, 0($t0) # $t5 = two bytes of b[k][j]
sll $t0, $s0, two # $t0 = i * four (size of row of a)
addu $t0, $t0, $s2 # $t0 = i * size(row) + k
sll $t0, $t0, two # $t0 = computer memory unit offset of [i][k]
addu $t0, $a3, $t0 # $t0 = computer memory unit address of a[i][k]
lw $t6, 0($t0) # $t6 = two bytes of a[i][k]
mul $t5, $t6, $t5 # $t5 = a[i][k] * b[k][j]
add $t4, $t4, $t5 # $t4 = c[i][j] + a[i][k] * b[k][j]

