master > master: codego methoden statt properties verwenden

This commit is contained in:
RD
2021-05-09 20:41:24 +02:00
parent 5c43006abd
commit cd21b1f035
2 changed files with 34 additions and 37 deletions

View File

@@ -73,64 +73,62 @@ func (tree SyntaxBaum) pretty(preindent string, tab string, prepend string, dept
// METHODS: Recognitong of Formula-Types
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
func (tree SyntaxBaum) isAtom() bool {
func (tree SyntaxBaum) IsIrreducible() bool {
return tree.Valence == 0
}
func (tree SyntaxBaum) IsAtom() bool {
return tree.Kind == "atom"
}
func (tree SyntaxBaum) isLiteral() bool {
if tree.isAtom() {
func (tree SyntaxBaum) IsLiteral() bool {
if tree.IsAtom() {
return true
} else if tree.isNegation() {
} else if tree.IsNegation() {
subtree, err := tree.GetChild()
if err == nil {
return subtree.isAtom()
return subtree.IsAtom()
}
}
return false
}
func (tree SyntaxBaum) isBeliebig() bool {
func (tree SyntaxBaum) IsGeneric() bool {
return tree.Kind == "generic"
}
func (tree SyntaxBaum) isTrueSymbol() bool {
func (tree SyntaxBaum) IsTautologySymbol() bool {
return tree.Kind == "taut"
}
func (tree SyntaxBaum) isFalseSymbol() bool {
func (tree SyntaxBaum) IsContradictionSymbol() bool {
return tree.Kind == "contradiction"
}
func (tree SyntaxBaum) isNegation() bool {
func (tree SyntaxBaum) IsConnective() bool {
return tree.Valence > 0
}
func (tree SyntaxBaum) IsNegation() bool {
return tree.Kind == "not"
}
func (tree SyntaxBaum) isConjunction() bool {
func (tree SyntaxBaum) IsConjunction2() bool {
return tree.Kind == "and2"
}
func (tree SyntaxBaum) isLongConjunction() bool {
switch tree.Kind {
case "and", "and2":
return true
default:
return false
}
func (tree SyntaxBaum) IsConjunction() bool {
return tree.Kind == "and" || tree.Kind == "and2"
}
func (tree SyntaxBaum) isDisjunction() bool {
func (tree SyntaxBaum) IsDisjunction2() bool {
return tree.Kind == "or2"
}
func (tree SyntaxBaum) isLongDisjunction() bool {
switch tree.Kind {
case "or", "or2":
return true
default:
return false
}
func (tree SyntaxBaum) IsDisjunction() bool {
return tree.Kind == "or" || tree.Kind == "or2"
}
func (tree SyntaxBaum) isImplication() bool {
func (tree SyntaxBaum) IsImplication() bool {
return tree.Kind == "implies"
}