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

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

View Full Document Right Arrow Icon
//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("______|___________|___________|___________");
Background image of page 1

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

View Full DocumentRight Arrow Icon
int i, j, k, counter=0; char proposition, proposition2, conclusion;
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online