24 lines
585 B
Go
24 lines
585 B
Go
package formulae
|
|
|
|
/* ---------------------------------------------------------------- *
|
|
* METHOD Get Atoms
|
|
* ---------------------------------------------------------------- */
|
|
|
|
func schemeGetAtoms(fml Formula, prevValues [](*[]Formula)) *[]Formula {
|
|
if fml.IsAtom() {
|
|
return &[]Formula{fml.Copy()}
|
|
} else {
|
|
var results = []Formula{}
|
|
for _, prevValue := range prevValues {
|
|
results = append(results, *prevValue...)
|
|
}
|
|
return &results
|
|
}
|
|
}
|
|
|
|
var fnGetAtoms = CreateFromSchemeFmlsValued(schemeGetAtoms)
|
|
|
|
func (fml Formula) GetAtoms() []Formula {
|
|
return *fnGetAtoms(fml)
|
|
}
|