Text this: Maximizing Microgrid Efficiency: A Unified Approach with Extended Optimal Propositional Logic Control