# Lab4 - /Justin Cogdill/CS278 Fall 2011/Lab 4/The purpose of...

This preview shows pages 1–3. Sign up to view the full content.

//Justin Cogdill //CS278 Fall 2011 //Lab 4 //The purpose of this lab is to find all possible combinations of truth values for the //proposition variables contained in each of the rules, compute truth-values of the rule's //two premises and conclusion for each possible combination of truth values of its //propositional variables, and check if the rule is valid or invalid. / public class Lab4 { static char a, b, c; s //method for negation public static char neg(char a){ if ( a == 'T') return 'F'; else return 'T'; } //method for disjunction public static char disj (char a,char b){ return 'F'; else return 'T'; } //method for conjunction public static char conj (char a, char b){ p return 'T'; else return 'F'; } //method for implication public static char implic(char a, char b){ p return 'F'; else return 'T'; } //main method public static void main (String [] args){ // prints out header for logic rule A System.out.println("Logic Rule A:"); System.out.println(" "); System.out.println("p q | Premise 1 | Premise 2 | Conclusion"); System.out.println("______|___________|___________|___________");

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
int i, j, k, counter=0; char proposition, proposition2, conclusion;
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/26/2011 for the course COMPUTER 1001 taught by Professor Fuckit during the Spring '11 term at University of Texas at Dallas, Richardson.

### Page1 / 6

Lab4 - /Justin Cogdill/CS278 Fall 2011/Lab 4/The purpose of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online