master > master: codego - iff

This commit is contained in:
RD
2021-05-15 00:05:03 +02:00
parent 9b225b0551
commit 79bfcf57bb
5 changed files with 24 additions and 4 deletions

View File

@@ -145,3 +145,4 @@ func (fml Formula) IsConjunction() bool { return fml.kind == "and" || fm
func (fml Formula) IsDisjunction2() bool { return fml.kind == "or2" }
func (fml Formula) IsDisjunction() bool { return fml.kind == "or" || fml.kind == "or2" }
func (fml Formula) IsImplication() bool { return fml.kind == "implies" }
func (fml Formula) IsDoubleImplication() bool { return fml.kind == "iff" }

View File

@@ -115,3 +115,12 @@ func Implies(fml1 Formula, fml2 Formula) Formula {
subformulae: [](*Formula){&fml1, &fml2},
}
}
func DoubleImplication(fml1 Formula, fml2 Formula) Formula {
return Formula{
kind: "iff",
expr: "(" + fml1.expr + " <-> " + fml2.expr + ")",
valence: 2,
subformulae: [](*Formula){&fml1, &fml2},
}
}