summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-09-26 20:04:16 +0000
committerKarl Berry <karl@freefriends.org>2023-09-26 20:04:16 +0000
commitd65f05e524b6dddf4c57dd93adda6b2cb57f1969 (patch)
tree242cd612ed1e6a3a85684da5b57e697d190275df
parentcf0576e556b99490707b718f5087e22a822be5c3 (diff)
profsio (26sep23)
git-svn-id: svn://tug.org/texlive/trunk@68374 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.pdfbin327111 -> 334719 bytes
-rw-r--r--Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.tex101
-rw-r--r--Master/texmf-dist/tex/latex/profsio/ProfSio.sty132
3 files changed, 218 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.pdf b/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.pdf
index ff622996515..3db2ff155ec 100644
--- a/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.pdf
+++ b/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.tex b/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.tex
index 4e65b5c010a..4fb5ec802a1 100644
--- a/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.tex
+++ b/Master/texmf-dist/doc/latex/profsio/ProfSio-doc-fr.tex
@@ -5,8 +5,8 @@
\documentclass[french,a4paper,11pt]{article}
\usepackage[margin=2cm,includefoot]{geometry}
-\def\TPversion{0.1.6}
-\def\TPdate{20 septembre 2023}
+\def\TPversion{0.1.7}
+\def\TPdate{25 septembre 2023}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}
@@ -81,10 +81,10 @@
keywordstyle={\color{violet}},%
classoffset=2,%
alsoletter={-},%
- morekeywords={\MPMPlaceTache,\MPMPlaceNotice,\MPMPlaceDuree,GrapheMPM,TableKarnaugh,\KarnaughCasesResult,\KarnaughBlocRegroup,\MPMPlaceTaches,\MPMPlaceDurees,GrapheTikz,\GrphPlaceSommets,\GrphTraceAretes,\tikzset,\DiagrammeSagittal,\draw,\DiagrammeSagittalCompo,\TableVerite,\SimplificationKarnaugh},%
+ morekeywords={\MPMPlaceTache,\MPMPlaceNotice,\MPMPlaceDuree,GrapheMPM,TableKarnaugh,\KarnaughCasesResult,\KarnaughBlocRegroup,\MPMPlaceTaches,\MPMPlaceDurees,GrapheTikz,\GrphPlaceSommets,\GrphTraceAretes,\tikzset,\DiagrammeSagittal,\draw,\DiagrammeSagittalCompo,\TableVerite,\SimplificationKarnaugh,\SimplificationBooleenne},%
keywordstyle={\color{green!50!black}},%
classoffset=3,%
- morekeywords={CouleurDurees,CouleurFleches,LargeurCases,Epaisseur,Police,CouleurDates,CouleurBords,NoirBlanc,Grille,DecalHorizDeb,DecalVertDeb,DecalHorizFin,DecalVertFin,Coude,SensCoude,Unite,Variables,Swap,Aide,CouleurCases,Decalage,Couleur,Type,Legende,PosVarLaterale,CouleurLegende,CouleurSommets,TypeSommets,Unite,CouleurFT,DimensionSommets,PositionFleches,EchelleFleches,TypeFleche,Droit,Milieu,AngleGauche,AngleDroite,Boucle,GrphStyleArc,GrphStyleSommet,Poids,GrphStylepoids,DistElem,DistEns,LargEns,NomAppli,CouleurE,CouleurAppli,CouleurF,CouleursFleches,TypeFleche,Epaisseur,Labels,Ensembles,PosLabels,PoliceLabels,Offset,NomApplis,CouleursAppli,VF,LargeursColonnes,CouleurEnonce,CodeAvant,CodeApres,StyleAlternatif,PoliceTT,Espace,Couleurs,Contraire},%
+ morekeywords={CouleurDurees,CouleurFleches,LargeurCases,Epaisseur,Police,CouleurDates,CouleurBords,NoirBlanc,Grille,DecalHorizDeb,DecalVertDeb,DecalHorizFin,DecalVertFin,Coude,SensCoude,Unite,Variables,Swap,Aide,CouleurCases,Decalage,Couleur,Type,Legende,PosVarLaterale,CouleurLegende,CouleurSommets,TypeSommets,Unite,CouleurFT,DimensionSommets,PositionFleches,EchelleFleches,TypeFleche,Droit,Milieu,AngleGauche,AngleDroite,Boucle,GrphStyleArc,GrphStyleSommet,Poids,GrphStylepoids,DistElem,DistEns,LargEns,NomAppli,CouleurE,CouleurAppli,CouleurF,CouleursFleches,TypeFleche,Epaisseur,Labels,Ensembles,PosLabels,PoliceLabels,Offset,NomApplis,CouleursAppli,VF,LargeursColonnes,CouleurEnonce,CodeAvant,CodeApres,StyleAlternatif,PoliceTT,Espace,Couleurs,Contraire,Enonce},%
keywordstyle={\color{orange}}
},%
#1
@@ -255,6 +255,8 @@
\section{Historique}
+\verb|v0.1.7|~:~~~~Possibilité de simplifier une expression booléenne \textit{directement} + amélioration des espaces
+
\verb|v0.1.6|~:~~~~Correction dans les simplifications de Karnaugh + Simplification du contraire
\verb|v0.1.5|~:~~~~Commande pour simplifier une table de Karnaugh à trois variables
@@ -281,20 +283,20 @@
Le package \packagetex!ProfSio! propose quelques commandes pour travailler sur des points particuliers de Mathématiques enseignées en BTS SIO :
\begin{itemize}
- \item graphe d'ordonnancement par la méthode MPM ;
- \item tableau de Karnaugh à 3 variables ;
+ \item graphes d'ordonnancement par la méthode MPM ;
+ \item expressions booléennes et tableaux de Karnaugh pour 3 variables ;
\item graphes \textit{simples} orientés ou pondérés, des diagrammes sagittaux ;
- \item des tables de vérité (via \hologo{LuaLaTeX}).
+ \item tables de vérité (via \hologo{LuaLaTeX}).
\end{itemize}
\vspace*{-\baselineskip}\leavevmode
\end{noteblock}
\begin{warningblock}
-Le code ne propose par de \og résolution \fg{} du graphe MPM, de \og simplification \fg{} d'expressions booléennes ou de représentation \og automatique \fg{} d'un graphe, il ne consiste \textit{qu'en} une mise en forme du graphe MPM, du tableau de Karnaugh ou du graphe.
+Le code ne propose par de \og résolution \fg{} du graphe MPM ou de représentation \og automatique \fg{} d'un graphe, il ne consiste \textit{qu'en} une mise en forme du graphe MPM, du tableau de Karnaugh ou du graphe.
\smallskip
-Par contre, pour les tables de vérité, le code se charge de créer le tableau \underline{entièrement}, grâce aux données du package \packagetex!luatruthtable! (légèrement \textit{patchées} pour obtenir une alternance un peu plus homogène).
+Cependant, il est propose de \og simplifier \fg{} des expressions booléennes, et pour les tables de vérité, le code se charge de créer le tableau \underline{entièrement}, grâce aux données du package \packagetex!luatruthtable! (légèrement \textit{patchées}.
\end{warningblock}
\subsection{Chargement du package, packages utilisés}
@@ -843,7 +845,7 @@ La déclaration \textit{binaire} de la table suit les mêmes règles que pour la
\begin{itemize}
\item la liste des cases soit être saisie, de gauche à droite en partant de la ligne du haut ;
- \item elle doit être donnée en bianire, sans séparateur, comme \Cle{\{1010111\}} par exemple.
+ \item elle doit être donnée en binaire, sans séparateur, comme \Cle{\{1010111\}} par exemple.
\end{itemize}
\vspace*{-\baselineskip}\leavevmode
\end{cautionblock}
@@ -857,6 +859,12 @@ Par \textbf{défaut}, le remplissage des cases est relatif à la configuration s
\end{center}
\end{importantblock}
+\begin{tipblock}
+Un espace \textit{spécial} mathématique a été défini, pour notamment gérer l'espacement horizontal entre des variables booléennes, pour éviter que les barres soient \textit{collées}.
+
+Il s'agit de \texttt{\textbackslash §}, qui vaut \texttt{1.5mu}, et qui est utilisé pour écrire des expressions booléennes.
+\end{tipblock}
+
\pagebreak
\subsection{Arguments et clés }
@@ -877,7 +885,7 @@ Les clés disponibles sont :
\item \Cle{Contraire} := booléen pour travailler sur le contraire de l'expression booléenne ;
\hfill~défault : \Cle{false}
- \item \Cle{Espace} := booléen pour rajouter un petit espace (\textit{fine}) dans les produits ;
+ \item \Cle{Espace} := booléen pour rajouter un petit espace (1.5~mu) dans les produits ;
\hfill~défaut : \Cle{true}
\item \Cle{StyleAlternatif} := booléen pour changer de style. \hfill~défaut : \Cle{false}
@@ -924,12 +932,81 @@ La table de Karnaugh :
\KarnaughCasesResult{11011001}
\end{TableKarnaugh}~
correspond à \SimplificationKarnaugh%
- [StyleAlternatif,Espace=false,Couleurs={purple/blue/orange}]%
+ [StyleAlternatif,Couleurs={purple/blue/orange}]%
{11011001}
\end{DemoCode}
\pagebreak
+\section{Écriture et simplification d'une expression booléenne}
+
+\subsection{Commande et fonctionnement global}
+
+\begin{cautionblock}
+L'idée est de proposer une commande pour afficher et simplifier une expression booléenne à trois variables connaissant son expression sous forme de \textit{mintermes} simples, donnés :
+%
+\begin{itemize}
+ \item entre parenthèses ;
+ \item avec \texttt{*} pour la barre.
+\end{itemize}
+
+Par exemple :
+
+\begin{itemize}
+ \item $E=a\§b+\overline{a}\§\overline{b}$ sera saisie par \texttt{(ab)+(a*b*)} ;
+ \item $E=\overline{a}\§\overline{c} + \overline{a}\§\overline{b} + b\§c$ sera saisie par \texttt{(a*c*)+(a*b*)+(bc)}.
+\end{itemize}
+\vspace*{-\baselineskip}\leavevmode
+\end{cautionblock}
+
+%\begin{importantblock}
+%En interne, la commande utilise la simplification par table de Karnaugh, et la commande peut également se charger de formater le résultat brut de l'expression.
+%\end{importantblock}
+
+\subsection{Arguments et clés }
+
+\begin{DemoCode}[listing only]
+\SimplificationBooleenne[clés]{expression formatée}
+\end{DemoCode}
+
+\begin{tipblock}
+Les clés disponibles sont :
+
+\begin{itemize}
+ \item \Cle{Enonce} := booléen pour afficher l'expression booléenne brute ; \hfill~défaut : \Cle{true}
+ \item \Cle{Variables} := variables utilisées ; \hfill~défaut : \Cle{a/b/c}
+ \item \Cle{Contraire} := booléen pour travailler sur le contraire ; \hfill~défaut : \Cle{false}
+ \item \Cle{Espace} := booléen pour rajouter un petit espace (1.5~mu) dans les produits.
+
+ \hfill~défaut : \Cle{true}
+\end{itemize}
+
+L'argument obligatoire est quant à lui la déclaration \textit{brute} de l'expression booléenne, donnée avec les règles précédentes. À noter que le résultat est inséré dans un groupe \texttt{ensuremath}.
+\end{tipblock}
+
+\subsection{Exemples}
+
+\begin{DemoCode}
+$E = \SimplificationBooleenne{(a)+(a*)}$\\
+$E = a + \overline{a} = \SimplificationBooleenne[Enonce=false]{(a)+(a*)}$
+\end{DemoCode}
+
+\begin{DemoCode}
+On considère l'expression booléenne $E= g + g\§b + g\§\overline{b}\§n$ :\\
+$E = \SimplificationBooleenne[Variables=g/b/n]{(g)+(gb)+(gb*n)}$\\
+$E = \SimplificationBooleenne[Variables=g/b/n,Espace=false]{(g)+(gb)+(gb*n)}$
+\end{DemoCode}
+
+\begin{DemoCode}
+$\overline{E} = \SimplificationBooleenne[Contraire,Variables=g/b/n]{(g)+(gb)+(gb*n)}$
+\end{DemoCode}
+
+\begin{DemoCode}
+On a $F = \SimplificationBooleenne{(a)+(abc*)+(a*b*c)+(abc)+(a*bc)}$.
+\end{DemoCode}
+
+\pagebreak
+
\section{Graphes \textit{simples}}
\subsection{Commande et fonctionnement global}
diff --git a/Master/texmf-dist/tex/latex/profsio/ProfSio.sty b/Master/texmf-dist/tex/latex/profsio/ProfSio.sty
index 7fc09269a8a..c492ec141a1 100644
--- a/Master/texmf-dist/tex/latex/profsio/ProfSio.sty
+++ b/Master/texmf-dist/tex/latex/profsio/ProfSio.sty
@@ -3,7 +3,8 @@
% : Luatruthtable from Chetan Shirore and Dr. Ajit Kumar https://ctan.org/pkg/luatruthtable
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfSio}[2023/09/20 0.1.6 Pour les enseignants de Maths en BTS SIO]
+\ProvidesPackage{ProfSio}[2023/09/25 0.1.7 Pour les enseignants de Maths en BTS SIO]
+%0.1.7 Ajout des simplifications booléennes d'expressions classiques
%0.1.6 Correction dans les simplifications de Karnaugh + Possibilité de travailler avec le contraire
%0.1.5 Simplification d'expressions booléennes (par Karnaugh)
%0.1.4 Possibilité de remplir une table de Karnaugh sans virgule
@@ -22,6 +23,8 @@
\RequirePackage{xintexpr}
%------Librairies
\usetikzlibrary{positioning,decorations.pathreplacing,decorations.markings,arrows,arrows.meta,calc,babel,shapes,shapes.geometric}
+%------Divers
+\def\§{\mkern1.5mu\relax}
%------Graphe MPM
\defKV[MPM]{%
@@ -1278,7 +1281,6 @@ end
\fi
%------Simplifications booléennes
-
\defKV[SimplifKngh]{%
Couleurs=\def\SimplifKnghCoul{#1},%
Variables=\def\SimplifKnghVar{#1}
@@ -1331,7 +1333,7 @@ end
}%
\ifboolKV[SimplifKngh]{Espace}%
{%
- \def\tmp@kngh@space{\,}%
+ \def\tmp@kngh@space{\§}%
}%
{%
\def\tmp@kngh@space{}%
@@ -1603,4 +1605,128 @@ end
}%
}
+\ExplSyntaxOn
+\NewExpandableDocumentCommand{\KnghBourrageZeros}{m}
+{
+ \int_compare:nT { #1 > 0 }
+ {
+ 0 \prg_replicate:nn { #1 - 1 } { 0 }
+ }
+}
+\ExplSyntaxOff
+
+\defKV[simplifbool]{%
+ Variables=\def\simplifboolvars{#1}
+}
+
+\setKVdefault[simplifbool]{%
+ Variables={a/b/c},%
+ Enonce=true,%
+ Espace=true,%
+ Contraire=false
+}
+
+\NewDocumentCommand\SimplificationBooleenne{ O{} m D<>{} }{%semble OK
+ \useKVdefault[simplifbool]%
+ \setKV[simplifbool]{#1}%
+ \setsepchar[.]{/}%
+ \readlist*\ListeVariablesKGH{\simplifboolvars}%
+ \itemtomacro\ListeVariablesKGH[1]{\VarTMPA}%
+ \itemtomacro\ListeVariablesKGH[2]{\VarTMPB}%
+ \itemtomacro\ListeVariablesKGH[3]{\VarTMPC}%
+ %gestion des espaces
+ \ifboolKV[simplifbool]{Espace}%
+ {%
+ \def\tmp@kngh@space{\§}%
+ }%
+ {%
+ \def\tmp@kngh@space{}%
+ }%
+ %énoncé
+ \StrSubstitute{#2}{\VarTMPA}{AA}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{\VarTMPB}{BB}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{\VarTMPC}{CC}[\knghenoncetransf]%
+ %\knghenoncetransf%
+ \StrSubstitute{\knghenoncetransf}{(AA)}{\VarTMPA}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(BB)}{\VarTMPB}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(CC)}{\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*)}{\overline{\VarTMPA}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(BB*}{\overline{\VarTMPB}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(CC*)}{\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AABB)}{\VarTMPA\tmp@kngh@space\VarTMPB}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AACC*)}{\VarTMPA\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AABB*)}{\VarTMPA\tmp@kngh@space\overline{\VarTMPB}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*BB)}{\overline{\VarTMPA}\tmp@kngh@space\VarTMPB}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*CC*)}{\overline{\VarTMPA}\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*BB*)}{\overline{\VarTMPA}\tmp@kngh@space\overline{\VarTMPB}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AACC)}{\VarTMPA\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*CC)}{\overline{\VarTMPA}\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(BBCC)}{\VarTMPB\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(BBCC*)}{\VarTMPB\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(BB*CC*)}{\overline{\VarTMPB}\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(BB*CC)}{\overline{\VarTMPB}\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AABBCC)}{\VarTMPA\tmp@kngh@space\VarTMPB\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AABBCC*)}{\VarTMPA\tmp@kngh@space\VarTMPB\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AABB*CC*)}{\VarTMPA\tmp@kngh@space\overline{\VarTMPB}\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AABB*CC)}{\VarTMPA\tmp@kngh@space\overline{\VarTMPB}\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*BBCC)}{\overline{\VarTMPA}\tmp@kngh@space\VarTMPB\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*BBCC*)}{\overline{\VarTMPA}\tmp@kngh@space\VarTMPB\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*BB*CC*)}{\overline{\VarTMPA}\tmp@kngh@space\overline{\VarTMPB}\tmp@kngh@space\overline{\VarTMPC}}[\knghenoncetransf]%
+ \StrSubstitute{\knghenoncetransf}{(AA*BB*CC)}{\overline{\VarTMPA}\tmp@kngh@space\overline{\VarTMPB}\tmp@kngh@space\VarTMPC}[\knghenoncetransf]%
+ %substitutions pour binaire
+ \StrSubstitute{#2}{\VarTMPA}{AA}[\knghbintransf]%
+ \StrSubstitute{\knghbintransf}{\VarTMPB}{BB}[\knghbintransf]%
+ \StrSubstitute{\knghbintransf}{\VarTMPC}{CC}[\knghbintransf]%
+ \xdef\knghbinres{00000000}%
+ %calculs pour 1 lettre
+ \IfSubStr{\knghbintransf}{(AA)}{\xdef\knghbinres{\inteval{\knghbinres+11110000}}}{}%
+ \IfSubStr{\knghbintransf}{(BB)}{\xdef\knghbinres{\inteval{\knghbinres+11001100}}}{}%
+ \IfSubStr{\knghbintransf}{(CC)}{\xdef\knghbinres{\inteval{\knghbinres+01100110}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*)}{\xdef\knghbinres{\inteval{\knghbinres+00001111}}}{}%
+ \IfSubStr{\knghbintransf}{(BB*}{\xdef\knghbinres{\inteval{\knghbinres+00110011}}}{}%
+ \IfSubStr{\knghbintransf}{(CC*)}{\xdef\knghbinres{\inteval{\knghbinres+10011001}}}{}%
+ %calculs pour 2 lettres
+ \IfSubStr{\knghbintransf}{(AABB)}{\xdef\knghbinres{\inteval{\knghbinres+11000000}}}{}%
+ \IfSubStr{\knghbintransf}{(AACC*)}{\xdef\knghbinres{\inteval{\knghbinres+01100000}}}{}%
+ \IfSubStr{\knghbintransf}{(AABB*)}{\xdef\knghbinres{\inteval{\knghbinres+00110000}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*BB)}{\xdef\knghbinres{\inteval{\knghbinres+00001100}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*CC*)}{\xdef\knghbinres{\inteval{\knghbinres+00000110}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*BB*)}{\xdef\knghbinres{\inteval{\knghbinres+00000011}}}{}%
+ \IfSubStr{\knghbintransf}{(AACC)}{\xdef\knghbinres{\inteval{\knghbinres+10010000}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*CC)}{\xdef\knghbinres{\inteval{\knghbinres+00001001}}}{}%
+ \IfSubStr{\knghbintransf}{(BBCC)}{\xdef\knghbinres{\inteval{\knghbinres+10001000}}}{}%
+ \IfSubStr{\knghbintransf}{(BBCC*)}{\xdef\knghbinres{\inteval{\knghbinres+01000100}}}{}%
+ \IfSubStr{\knghbintransf}{(BB*CC*)}{\xdef\knghbinres{\inteval{\knghbinres+00100010}}}{}%
+ \IfSubStr{\knghbintransf}{(BB*CC)}{\xdef\knghbinres{\inteval{\knghbinres+00010001}}}{}%
+ %calculs pour 3 lettres
+ \IfSubStr{\knghbintransf}{(AABBCC)}{\xdef\knghbinres{\inteval{\knghbinres+10000000}}}{}%
+ \IfSubStr{\knghbintransf}{(AABBCC*)}{\xdef\knghbinres{\inteval{\knghbinres+01000000}}}{}%
+ \IfSubStr{\knghbintransf}{(AABB*CC*)}{\xdef\knghbinres{\inteval{\knghbinres+00100000}}}{}%
+ \IfSubStr{\knghbintransf}{(AABB*CC)}{\xdef\knghbinres{\inteval{\knghbinres+00010000}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*BBCC)}{\xdef\knghbinres{\inteval{\knghbinres+00001000}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*BBCC*)}{\xdef\knghbinres{\inteval{\knghbinres+00000100}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*BB*CC*)}{\xdef\knghbinres{\inteval{\knghbinres+00000010}}}{}%
+ \IfSubStr{\knghbintransf}{(AA*BB*CC)}{\xdef\knghbinres{\inteval{\knghbinres+00000001}}}{}%
+ %on complète
+ \StrLen{\knghbinres}[\knghbinresnbchiffres]
+ \ifnum\knghbinresnbchiffres<8%
+ \xdef\nbz{\inteval{8-\knghbinresnbchiffres}}%
+ \xdef\knghbinres{\KnghBourrageZeros{\nbz}\knghbinres}%
+ \fi%
+ \xintFor* ##1 in {\xintSeq{2}{8}}\do{\StrSubstitute{\knghbinres}{##1}{1}[\knghbinres]}%
+ \ifboolKV[simplifbool]{Contraire}%
+ {%
+ \StrSubstitute{\knghbinres}{0}{2}[\knghbinres]%
+ \StrSubstitute{\knghbinres}{1}{0}[\knghbinres]%
+ \StrSubstitute{\knghbinres}{2}{1}[\knghbinres]%
+ }%
+ {}%
+ \ensuremath{%
+ \ifboolKV[simplifbool]{Enonce}{\ifboolKV[simplifbool]{Contraire}{\overline{\knghenoncetransf}}{\knghenoncetransf}=}{}%
+ \ifboolKV[simplifbool]{Espace}%
+ {\SimplificationKarnaugh[Variables={\simplifboolvars},Espace=true,#3]{\knghbinres}}%
+ {\SimplificationKarnaugh[Variables={\simplifboolvars},Espace=false,#3]{\knghbinres}}%
+ }
+}
+
\endinput \ No newline at end of file