Jeśli B jest też prawdziwe, wynik to „prawda”, w przeciwnym razie „fałsz”. Jeśli A jest fałszywe, wynik to „fałsz”, a B nie jest obliczane.
Przykład („short_circuit.adb”): with Text_IO, Ada.Integer_Text_IO; use Text_IO, Ada.Integer_Text_IO;
procedure Short_Circuit is
function Is_Odd (i : Integer) return Boolean is begin Put ("Testing"); Put (i); New_Line; return ((i / 2) * 2) /= i; end;
begin Put_Line ("Testing if ""5 and 6"" are odd"); if (Is_Odd (5) and Is_Odd (6)) then Put_Line ("True"); else Put_Line ("False"); end if;
Put_Line ("Testing if ""5 or 6"" are odd"); if (Is_Odd (5) or Is_Odd (6)) then Put_Line ("True"); else Put_Line ("False"); end if;
Put_Line ("Testing if ""5 and then 6"" are odd"); if (Is_Odd (5) and then Is_Odd (6)) then Put_Line ("True"); else Put_Line ("False"); end if;
Put_Line ("Testing if ""5 or else 6"" are odd"); if (Is_Odd (5) or else Is_Odd (6)) then Put_Line ("True"); else Put_Line ("False"); end if;
Put_Line ("Testing if ""6 and 5"" are odd"); if (Is_Odd (6) and Is_Odd (5)) then Put_Line ("True"); else Put_Line ("False"); end if;
Put_Line ("Testing if ""6 or 5"" are odd"); if (Is_Odd (6) or Is_Odd (5)) then Put_Line ("True"); else Put_Line ("False"); end if;