From b23521f301ddd20e140bb578e9c0e284429404a8 Mon Sep 17 00:00:00 2001 From: Sophie Coudert <sophie.coudert@telecom-paris.fr> Date: Wed, 8 Mar 2023 13:29:33 +0100 Subject: [PATCH] some more javadoc comments. --- .../java/avatartranslator/AvatarBlock.java | 4 +- .../avatartranslator/AvatarSpecification.java | 5 +- .../AvatarStateMachineElement.java | 4 +- .../intboolsolver/AvatarIBSAbsSolver.java | 6 +- ...ribute.java => AvatarIBSStdAttribute.java} | 4 +- ...s.java => AvatarIBSStdAttributeClass.java} | 32 +++---- .../modelchecker/SpecificationBlock.java | 4 +- .../modelchecker/SpecificationState.java | 5 +- .../myutil/intboolsolver/IBSAttribute.java | 34 ++++--- .../intboolsolver/IBSAttributeClass.java | 65 ++++++++++++- .../intboolsolver/IBSAttributeTypes.java | 45 +++++++++ .../IBSClosedFormulaAttribute.java | 12 +-- .../IBSClosedFormulaAttributeClass.java | 14 +-- .../intboolsolver/IBSClosedFormulaSolver.java | 10 +- .../myutil/intboolsolver/IBSCompParam.java | 4 - .../intboolsolver/IBSCompStateParam.java | 4 - .../myutil/intboolsolver/IBSParamComp.java | 58 ++++++++++++ .../intboolsolver/IBSParamCompState.java | 58 ++++++++++++ .../myutil/intboolsolver/IBSParamSpec.java | 58 ++++++++++++ .../intboolsolver/IBSParamSpecState.java | 57 ++++++++++++ .../myutil/intboolsolver/IBSParamState.java | 58 ++++++++++++ .../java/myutil/intboolsolver/IBSParams.java | 9 -- .../myutil/intboolsolver/IBSSpecParam.java | 4 - .../intboolsolver/IBSSpecStateParam.java | 4 - .../myutil/intboolsolver/IBSStateParam.java | 4 - ...AbsAttribute.java => IBSStdAttribute.java} | 36 +++++--- ...teClass.java => IBSStdAttributeClass.java} | 72 +++++++++++++-- .../intboolsolver/IBSTypedAttribute.java | 42 +++++++++ .../java/myutil/intboolsolver/IBSolver.java | 24 ++--- ...BSolverInterface.java => IBSolverAPI.java} | 17 ++-- .../myutil/intboolsolver/package-info.java | 92 ++++++++++--------- 31 files changed, 666 insertions(+), 179 deletions(-) rename src/main/java/avatartranslator/intboolsolver/{AvatarIBSAbsAttribute.java => AvatarIBSStdAttribute.java} (99%) rename src/main/java/avatartranslator/intboolsolver/{AvatarIBSAbsAttributeClass.java => AvatarIBSStdAttributeClass.java} (91%) delete mode 100644 src/main/java/myutil/intboolsolver/IBSCompParam.java delete mode 100644 src/main/java/myutil/intboolsolver/IBSCompStateParam.java create mode 100644 src/main/java/myutil/intboolsolver/IBSParamComp.java create mode 100644 src/main/java/myutil/intboolsolver/IBSParamCompState.java create mode 100644 src/main/java/myutil/intboolsolver/IBSParamSpec.java create mode 100644 src/main/java/myutil/intboolsolver/IBSParamSpecState.java create mode 100644 src/main/java/myutil/intboolsolver/IBSParamState.java delete mode 100644 src/main/java/myutil/intboolsolver/IBSParams.java delete mode 100644 src/main/java/myutil/intboolsolver/IBSSpecParam.java delete mode 100644 src/main/java/myutil/intboolsolver/IBSSpecStateParam.java delete mode 100644 src/main/java/myutil/intboolsolver/IBSStateParam.java rename src/main/java/myutil/intboolsolver/{IBSAbsAttribute.java => IBSStdAttribute.java} (85%) rename src/main/java/myutil/intboolsolver/{IBSAbsAttributeClass.java => IBSStdAttributeClass.java} (60%) rename src/main/java/myutil/intboolsolver/{IBSolverInterface.java => IBSolverAPI.java} (91%) diff --git a/src/main/java/avatartranslator/AvatarBlock.java b/src/main/java/avatartranslator/AvatarBlock.java index eb55607d19..4a631bbdd5 100644 --- a/src/main/java/avatartranslator/AvatarBlock.java +++ b/src/main/java/avatartranslator/AvatarBlock.java @@ -38,7 +38,7 @@ package avatartranslator; -import myutil.intboolsolver.IBSCompParam; +import myutil.intboolsolver.IBSParamComp; import java.util.ArrayList; import java.util.LinkedList; @@ -51,7 +51,7 @@ import java.util.List; * @author Ludovic APVRILLE, Raja GATGOUT * @version 1.1 01/07/2014 */ -public class AvatarBlock extends AvatarElement implements AvatarStateMachineOwner,IBSCompParam { +public class AvatarBlock extends AvatarElement implements AvatarStateMachineOwner, IBSParamComp { private AvatarBlock father; private List<AvatarAttribute> attributes; diff --git a/src/main/java/avatartranslator/AvatarSpecification.java b/src/main/java/avatartranslator/AvatarSpecification.java index b8b11246f3..55ff4e9944 100644 --- a/src/main/java/avatartranslator/AvatarSpecification.java +++ b/src/main/java/avatartranslator/AvatarSpecification.java @@ -39,8 +39,7 @@ package avatartranslator; import myutil.TraceManager; -import myutil.intboolsolver.IBSParams; -import myutil.intboolsolver.IBSSpecParam; +import myutil.intboolsolver.IBSParamSpec; import java.util.*; @@ -52,7 +51,7 @@ import java.util.*; * @author Ludovic APVRILLE * @version 1.0 20/05/2010 */ -public class AvatarSpecification extends AvatarElement implements IBSSpecParam { +public class AvatarSpecification extends AvatarElement implements IBSParamSpec { public final static int UPPAAL_MAX_INT = 32767; diff --git a/src/main/java/avatartranslator/AvatarStateMachineElement.java b/src/main/java/avatartranslator/AvatarStateMachineElement.java index f5827eab9a..18c27f1061 100644 --- a/src/main/java/avatartranslator/AvatarStateMachineElement.java +++ b/src/main/java/avatartranslator/AvatarStateMachineElement.java @@ -40,7 +40,7 @@ package avatartranslator; import myutil.TraceManager; -import myutil.intboolsolver.IBSStateParam; +import myutil.intboolsolver.IBSParamState; import ui.TGComponent; import java.util.HashMap; @@ -55,7 +55,7 @@ import java.util.List; * @author Ludovic APVRILLE * @version 1.0 20/05/2010 */ -public abstract class AvatarStateMachineElement extends AvatarElement implements IBSStateParam { +public abstract class AvatarStateMachineElement extends AvatarElement implements IBSParamState { protected List<AvatarStateMachineElement> nexts; private AvatarState myState; diff --git a/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsSolver.java b/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsSolver.java index d2160d2929..770d7546af 100644 --- a/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsSolver.java +++ b/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsSolver.java @@ -13,11 +13,11 @@ public class AvatarIBSAbsSolver extends IBSolver< AvatarStateMachineElement, SpecificationState, SpecificationBlock, - AvatarIBSAbsAttribute, - AvatarIBSAbsAttributeClass + AvatarIBSStdAttribute, + AvatarIBSStdAttributeClass > { public AvatarIBSAbsSolver() { - super(new AvatarIBSAbsAttributeClass()); + super(new AvatarIBSStdAttributeClass()); } void main(String[] args) { return;} } diff --git a/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsAttribute.java b/src/main/java/avatartranslator/intboolsolver/AvatarIBSStdAttribute.java similarity index 99% rename from src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsAttribute.java rename to src/main/java/avatartranslator/intboolsolver/AvatarIBSStdAttribute.java index d315ef456f..4d2a721349 100644 --- a/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsAttribute.java +++ b/src/main/java/avatartranslator/intboolsolver/AvatarIBSStdAttribute.java @@ -40,7 +40,7 @@ package avatartranslator.intboolsolver; import avatartranslator.*; import avatartranslator.modelchecker.SpecificationBlock; import avatartranslator.modelchecker.SpecificationState; -import myutil.intboolsolver.IBSAbsAttribute; +import myutil.intboolsolver.IBSStdAttribute; import myutil.intboolsolver.IBSAttributeTypes; /** @@ -59,7 +59,7 @@ import myutil.intboolsolver.IBSAttributeTypes; // - AvatarSpecificationState must extend AvatarIBSAbstractAttribute.SpecificationState // - AvatarSpecificationBlock must extend AvatarIBSAbstractAttribute.SpecificationBlock -public class AvatarIBSAbsAttribute extends IBSAbsAttribute< +public class AvatarIBSStdAttribute extends IBSStdAttribute< AvatarSpecification, AvatarBlock, AvatarStateMachineElement, diff --git a/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsAttributeClass.java b/src/main/java/avatartranslator/intboolsolver/AvatarIBSStdAttributeClass.java similarity index 91% rename from src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsAttributeClass.java rename to src/main/java/avatartranslator/intboolsolver/AvatarIBSStdAttributeClass.java index 0fe2fdac81..d67a3fa213 100644 --- a/src/main/java/avatartranslator/intboolsolver/AvatarIBSAbsAttributeClass.java +++ b/src/main/java/avatartranslator/intboolsolver/AvatarIBSStdAttributeClass.java @@ -6,20 +6,20 @@ import avatartranslator.AvatarSpecification; import avatartranslator.AvatarStateMachineElement; import avatartranslator.modelchecker.SpecificationBlock; import avatartranslator.modelchecker.SpecificationState; -import myutil.intboolsolver.IBSAbsAttributeClass; +import myutil.intboolsolver.IBSStdAttributeClass; import myutil.intboolsolver.IBSAttributeTypes; import myutil.intboolsolver.IBSTypedAttribute; import java.util.HashMap; import java.util.Map; -public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< +public class AvatarIBSStdAttributeClass extends IBSStdAttributeClass< AvatarSpecification, AvatarBlock, AvatarStateMachineElement, SpecificationState, SpecificationBlock, - AvatarIBSAbsAttribute + AvatarIBSStdAttribute > { private static Map<AvatarElement, IBSTypedAttribute> attributesMap; // handling already covered attributes (memorisation) @@ -28,12 +28,12 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< private static String findString = ""; private static AvatarElement keyElement; - AvatarIBSAbsAttributeClass(){} + AvatarIBSStdAttributeClass(){} public IBSTypedAttribute getTypedAttribute(AvatarSpecification _spec, String _s) { IBSTypedAttribute a = findAttribute(_spec, _s); if (a == null) { - AvatarIBSAbsAttribute x = new AvatarIBSAbsAttribute(); // replaced... + AvatarIBSStdAttribute x = new AvatarIBSStdAttribute(); // replaced... x.classInitAttribute(_spec,_s); switch (x.getType()) { case IBSAttributeTypes.NullAttr:{ @@ -57,7 +57,7 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< public IBSTypedAttribute getTypedAttribute(AvatarBlock _comp, String _s) { IBSTypedAttribute a = findAttribute(_comp, _s); if (a == null) { - AvatarIBSAbsAttribute x = new AvatarIBSAbsAttribute(); // replaced + AvatarIBSStdAttribute x = new AvatarIBSStdAttribute(); // replaced x.classInitAttribute(_comp,_s); switch (x.getType()) { case IBSAttributeTypes.NullAttr:{ @@ -80,7 +80,7 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< public IBSTypedAttribute getTypedAttribute(AvatarBlock _comp, AvatarStateMachineElement _state) { IBSTypedAttribute a = findAttribute(_comp, _state); if (a == null) { - AvatarIBSAbsAttribute x = new AvatarIBSAbsAttribute(); // replaced + AvatarIBSStdAttribute x = new AvatarIBSStdAttribute(); // replaced x.classInitAttribute(_comp,_state); switch (x.getType()) { case IBSAttributeTypes.NullAttr:{ @@ -102,14 +102,14 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< public boolean instanceOfMe(int _type, Object _val) { - return (_val instanceof AvatarIBSAbsAttribute && - _type == ((AvatarIBSAbsAttribute)_val).getType()); + return (_val instanceof AvatarIBSStdAttribute && + _type == ((AvatarIBSStdAttribute)_val).getType()); } public boolean instanceOfMe(IBSTypedAttribute _ta) { Object v = _ta.getVal(); - return (v instanceof AvatarIBSAbsAttribute && - _ta.getType() == ((AvatarIBSAbsAttribute)v).getType()); + return (v instanceof AvatarIBSStdAttribute && + _ta.getType() == ((AvatarIBSStdAttribute)v).getType()); } @@ -129,7 +129,7 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< IBSTypedAttribute ta = attributesMap.get(ae); if (ta.isAttribute()){ //might be uninitialized - ((AvatarIBSAbsAttribute)(ta.getVal())).linkComp(_spec); + ((AvatarIBSStdAttribute)(ta.getVal())).linkComp(_spec); } return ta; } @@ -146,7 +146,7 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< else ae = getElement(_s, _spec); if (ae != null){ - if (_att.isAttribute() && !(_att.getVal() instanceof AvatarIBSAbsAttribute)) + if (_att.isAttribute() && !(_att.getVal() instanceof AvatarIBSStdAttribute)) return; // should be an error attributesMap.put(ae, _att); } @@ -172,7 +172,7 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< else ae = getElement(_s, _comp); if (ae != null){ - if (_att.isAttribute() && !(_att.getVal() instanceof AvatarIBSAbsAttribute)) + if (_att.isAttribute() && !(_att.getVal() instanceof AvatarIBSStdAttribute)) return; // should be an error attributesMap.put(ae, _att); } @@ -191,8 +191,8 @@ public class AvatarIBSAbsAttributeClass extends IBSAbsAttributeClass< if (_att == null || (_att.isAttribute() && (!(instanceOfMe(_att)) || - !((AvatarIBSAbsAttribute) _att.getVal()).isState() || - _state != ((AvatarIBSAbsAttribute) _att.getVal()).state + !((AvatarIBSStdAttribute) _att.getVal()).isState() || + _state != ((AvatarIBSStdAttribute) _att.getVal()).state ) ) ) diff --git a/src/main/java/avatartranslator/modelchecker/SpecificationBlock.java b/src/main/java/avatartranslator/modelchecker/SpecificationBlock.java index f8ad6664a5..8b62c67ed7 100644 --- a/src/main/java/avatartranslator/modelchecker/SpecificationBlock.java +++ b/src/main/java/avatartranslator/modelchecker/SpecificationBlock.java @@ -40,7 +40,7 @@ package avatartranslator.modelchecker; import avatartranslator.AvatarAttribute; import avatartranslator.AvatarBlock; -import myutil.intboolsolver.IBSCompStateParam; +import myutil.intboolsolver.IBSParamCompState; import java.util.Arrays; import java.util.List; @@ -54,7 +54,7 @@ import java.util.Vector; * @author Ludovic APVRILLE * @version 1.0 31/05/2016 */ -public class SpecificationBlock implements IBSCompStateParam { +public class SpecificationBlock implements IBSParamCompState { public static final int HEADER_VALUES = 3; diff --git a/src/main/java/avatartranslator/modelchecker/SpecificationState.java b/src/main/java/avatartranslator/modelchecker/SpecificationState.java index 85af9a621e..70cd150317 100644 --- a/src/main/java/avatartranslator/modelchecker/SpecificationState.java +++ b/src/main/java/avatartranslator/modelchecker/SpecificationState.java @@ -45,9 +45,8 @@ package avatartranslator.modelchecker; import avatartranslator.AvatarBlock; import avatartranslator.AvatarSpecification; -import myutil.intboolsolver.IBSSpecStateParam; +import myutil.intboolsolver.IBSParamSpecState; -import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedList; @@ -58,7 +57,7 @@ import java.util.LinkedList; * @version 1.0 31/05/2016 * @author Ludovic APVRILLE */ -public class SpecificationState implements IBSSpecStateParam, Comparable<SpecificationState> { +public class SpecificationState implements IBSParamSpecState, Comparable<SpecificationState> { public SpecificationBlock [] blocks; public int hashValue; public boolean hashComputed; diff --git a/src/main/java/myutil/intboolsolver/IBSAttribute.java b/src/main/java/myutil/intboolsolver/IBSAttribute.java index 9798d73425..8f6f6185b4 100644 --- a/src/main/java/myutil/intboolsolver/IBSAttribute.java +++ b/src/main/java/myutil/intboolsolver/IBSAttribute.java @@ -1,4 +1,4 @@ - /* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille * * ludovic.apvrille AT enst.fr * @@ -35,24 +35,30 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - package myutil.intboolsolver; -// import intboolsolver.IBSolver; // usefull in implementations +package myutil.intboolsolver; /** - * Class IBSAttribute - * Creation: 27/02/2023 - * @version 0.0 27/02/2023 - * - * @author Sophie Coudert + * Interface IBSAttribute, describing the "dynamic" generic part of open + * leaves of {@link myutil.intboolsolver.IBSolver IBSolver}. + * Creation: 07/03/2023 + * + * <p> This interface describes the features required from the + * instances of {@link myutil.intboolsolver.IBSolver IBSolver} + * attributes. Its implementations are intended to instantiate + * the {@code ATT} parameter of the generic + * {@link myutil.intboolsolver.IBSolver IBSolver} </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) */ -interface IBSAttribute< - Spec extends IBSSpecParam, - Comp extends IBSCompParam, - State extends IBSStateParam, - SpecState extends IBSSpecStateParam, - CompState extends IBSCompStateParam +public interface IBSAttribute< + Spec extends IBSParamSpec, + Comp extends IBSParamComp, + State extends IBSParamState, + SpecState extends IBSParamSpecState, + CompState extends IBSParamCompState > { // returns a type from IBSolver // (i.e. among IMMEDIATE_(BOOL,INT,NO)) diff --git a/src/main/java/myutil/intboolsolver/IBSAttributeClass.java b/src/main/java/myutil/intboolsolver/IBSAttributeClass.java index 2fe3d6fe23..665b921d42 100644 --- a/src/main/java/myutil/intboolsolver/IBSAttributeClass.java +++ b/src/main/java/myutil/intboolsolver/IBSAttributeClass.java @@ -1,11 +1,66 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + package myutil.intboolsolver; +/** + * class IBSAttribute (interface), describing the "static" generic part + * shared by all open leaves of {@link myutil.intboolsolver.IBSolver + * IBSolver}. + * Creation: 07/03/2023 + * + * <p> This interface describes the features required from the + * class of {@link myutil.intboolsolver.IBSolver IBSolver} + * attributes (methods that do not depend on attribute instances). + * Its implementations are intended to instantiate + * the {@code AtC} parameter of the generic + * {@link myutil.intboolsolver.IBSolver IBSolver} </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) + */ + public class IBSAttributeClass< - Spec extends IBSSpecParam, - Comp extends IBSCompParam, - State extends IBSStateParam, - SpecState extends IBSSpecStateParam, - CompState extends IBSCompStateParam, + Spec extends IBSParamSpec, + Comp extends IBSParamComp, + State extends IBSParamState, + SpecState extends IBSParamSpecState, + CompState extends IBSParamCompState, Att extends IBSAttribute<Spec,Comp,State,SpecState,CompState> > { public IBSTypedAttribute getTypedAttribute(Spec _spec, String _s) { diff --git a/src/main/java/myutil/intboolsolver/IBSAttributeTypes.java b/src/main/java/myutil/intboolsolver/IBSAttributeTypes.java index 6f6ab4bc6d..62fed41751 100644 --- a/src/main/java/myutil/intboolsolver/IBSAttributeTypes.java +++ b/src/main/java/myutil/intboolsolver/IBSAttributeTypes.java @@ -1,4 +1,49 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ package myutil.intboolsolver; + +/** + * The type of results that can be returned when trying to build + * attributes. + * Creation: 07/03/2023 + * @author Sophie Coudert + */ + public final class IBSAttributeTypes { public static final int NullAttr =0; // val is null public static final int BoolConst =1; // val is an Int integer diff --git a/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttribute.java b/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttribute.java index 9773e0209d..ee83205c46 100644 --- a/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttribute.java +++ b/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttribute.java @@ -1,11 +1,11 @@ package myutil.intboolsolver; -public class IBSClosedFormulaAttribute extends IBSAbsAttribute< - IBSSpecParam, - IBSCompParam, - IBSStateParam, - IBSSpecStateParam, - IBSCompStateParam +public class IBSClosedFormulaAttribute extends IBSStdAttribute< + IBSParamSpec, + IBSParamComp, + IBSParamState, + IBSParamSpecState, + IBSParamCompState > { IBSClosedFormulaAttribute(){} } diff --git a/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttributeClass.java b/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttributeClass.java index 1b5683e6a3..a4e2e3c048 100644 --- a/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttributeClass.java +++ b/src/main/java/myutil/intboolsolver/IBSClosedFormulaAttributeClass.java @@ -1,12 +1,12 @@ package myutil.intboolsolver; -public class IBSClosedFormulaAttributeClass extends IBSAbsAttributeClass< - IBSSpecParam, - IBSCompParam, - IBSStateParam, - IBSSpecStateParam, - IBSCompStateParam, +public class IBSClosedFormulaAttributeClass extends IBSStdAttributeClass< + IBSParamSpec, + IBSParamComp, + IBSParamState, + IBSParamSpecState, + IBSParamCompState, IBSClosedFormulaAttribute - > { + > { IBSClosedFormulaAttributeClass(){} } diff --git a/src/main/java/myutil/intboolsolver/IBSClosedFormulaSolver.java b/src/main/java/myutil/intboolsolver/IBSClosedFormulaSolver.java index 245bfdb1dc..34e73a53bd 100644 --- a/src/main/java/myutil/intboolsolver/IBSClosedFormulaSolver.java +++ b/src/main/java/myutil/intboolsolver/IBSClosedFormulaSolver.java @@ -1,11 +1,11 @@ package myutil.intboolsolver; public class IBSClosedFormulaSolver extends IBSolver < - IBSSpecParam, - IBSCompParam, - IBSStateParam, - IBSSpecStateParam, - IBSCompStateParam, + IBSParamSpec, + IBSParamComp, + IBSParamState, + IBSParamSpecState, + IBSParamCompState, IBSClosedFormulaAttribute, IBSClosedFormulaAttributeClass > { IBSClosedFormulaSolver() { diff --git a/src/main/java/myutil/intboolsolver/IBSCompParam.java b/src/main/java/myutil/intboolsolver/IBSCompParam.java deleted file mode 100644 index 6b7245130b..0000000000 --- a/src/main/java/myutil/intboolsolver/IBSCompParam.java +++ /dev/null @@ -1,4 +0,0 @@ -package myutil.intboolsolver; - -public interface IBSCompParam { -} diff --git a/src/main/java/myutil/intboolsolver/IBSCompStateParam.java b/src/main/java/myutil/intboolsolver/IBSCompStateParam.java deleted file mode 100644 index 99a511a4d9..0000000000 --- a/src/main/java/myutil/intboolsolver/IBSCompStateParam.java +++ /dev/null @@ -1,4 +0,0 @@ -package myutil.intboolsolver; - -public interface IBSCompStateParam { -} diff --git a/src/main/java/myutil/intboolsolver/IBSParamComp.java b/src/main/java/myutil/intboolsolver/IBSParamComp.java new file mode 100644 index 0000000000..87d1d843a0 --- /dev/null +++ b/src/main/java/myutil/intboolsolver/IBSParamComp.java @@ -0,0 +1,58 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package myutil.intboolsolver; + +/** + * Interface IBSParamComp, to be implemented by classes intended to + * instantiate the {@code Comp} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver}. + * Creation: 07/03/2023 + * + * <p> The {@code Comp} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver} may be instantiated + * by any class without modification, except that the class must implement + * this interface and none of the other IBSParamXXX interface. + * </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert + */ + +public interface IBSParamComp { +} diff --git a/src/main/java/myutil/intboolsolver/IBSParamCompState.java b/src/main/java/myutil/intboolsolver/IBSParamCompState.java new file mode 100644 index 0000000000..986c9f755d --- /dev/null +++ b/src/main/java/myutil/intboolsolver/IBSParamCompState.java @@ -0,0 +1,58 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package myutil.intboolsolver; + +/** + * Interface IBSParamCompState, to be implemented by classes intended to + * instantiate the {@code CompState} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver}. + * Creation: 07/03/2023 + * + * <p> The {@code CompState} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver} may be instantiated + * by any class without modification, except that the class must implement + * this interface and none of the other IBSParamXXX interface. + * </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert + */ + +public interface IBSParamCompState { +} diff --git a/src/main/java/myutil/intboolsolver/IBSParamSpec.java b/src/main/java/myutil/intboolsolver/IBSParamSpec.java new file mode 100644 index 0000000000..b0db023b54 --- /dev/null +++ b/src/main/java/myutil/intboolsolver/IBSParamSpec.java @@ -0,0 +1,58 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package myutil.intboolsolver; + +/** + * Interface IBSParamSpec, to be implemented by classes intended to + * instantiate the {@code Spec} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver}. + * Creation: 07/03/2023 + * + * <p> The {@code Spec} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver} may be instantiated + * by any class without modification, except that the class must implement + * this interface and none of the other IBSParamXXX interface. + * </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert + */ + +public interface IBSParamSpec { +} diff --git a/src/main/java/myutil/intboolsolver/IBSParamSpecState.java b/src/main/java/myutil/intboolsolver/IBSParamSpecState.java new file mode 100644 index 0000000000..d24133e41f --- /dev/null +++ b/src/main/java/myutil/intboolsolver/IBSParamSpecState.java @@ -0,0 +1,57 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package myutil.intboolsolver; + +/** + * Interface IBSParamSpecState, to be implemented by classes intended to + * instantiate the {@code SpecState} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver}. + * Creation: 07/03/2023 + * + * <p> The {@code SpecState} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver} may be instantiated + * by any class without modification, except that the class must implement + * this interface and none of the other IBSParamXXX interface. + * </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert + */ +public interface IBSParamSpecState { +} diff --git a/src/main/java/myutil/intboolsolver/IBSParamState.java b/src/main/java/myutil/intboolsolver/IBSParamState.java new file mode 100644 index 0000000000..6d17cfcd52 --- /dev/null +++ b/src/main/java/myutil/intboolsolver/IBSParamState.java @@ -0,0 +1,58 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + +package myutil.intboolsolver; + +/** + * Interface IBSParamState, to be implemented by classes intended to + * instantiate the {@code State} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver}. + * Creation: 07/03/2023 + * + * <p> The {@code State} parameter of + * {@link myutil.intboolsolver.IBSolver IBSolver} may be instantiated + * by any class without modification, except that the class must implement + * this interface and none of the other IBSParamXXX interface. + * </p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert + */ + +public interface IBSParamState { +} diff --git a/src/main/java/myutil/intboolsolver/IBSParams.java b/src/main/java/myutil/intboolsolver/IBSParams.java deleted file mode 100644 index f26f2b57cb..0000000000 --- a/src/main/java/myutil/intboolsolver/IBSParams.java +++ /dev/null @@ -1,9 +0,0 @@ -package myutil.intboolsolver; - -public class IBSParams { - public class Spec{} - public class Comp{} - public class State{} - public class SpecState{} - public class CompState{} -} diff --git a/src/main/java/myutil/intboolsolver/IBSSpecParam.java b/src/main/java/myutil/intboolsolver/IBSSpecParam.java deleted file mode 100644 index c6dcfc7e98..0000000000 --- a/src/main/java/myutil/intboolsolver/IBSSpecParam.java +++ /dev/null @@ -1,4 +0,0 @@ -package myutil.intboolsolver; - -public interface IBSSpecParam { -} diff --git a/src/main/java/myutil/intboolsolver/IBSSpecStateParam.java b/src/main/java/myutil/intboolsolver/IBSSpecStateParam.java deleted file mode 100644 index 60127d6211..0000000000 --- a/src/main/java/myutil/intboolsolver/IBSSpecStateParam.java +++ /dev/null @@ -1,4 +0,0 @@ -package myutil.intboolsolver; - -public interface IBSSpecStateParam { -} diff --git a/src/main/java/myutil/intboolsolver/IBSStateParam.java b/src/main/java/myutil/intboolsolver/IBSStateParam.java deleted file mode 100644 index f961048043..0000000000 --- a/src/main/java/myutil/intboolsolver/IBSStateParam.java +++ /dev/null @@ -1,4 +0,0 @@ -package myutil.intboolsolver; - -public interface IBSStateParam { -} diff --git a/src/main/java/myutil/intboolsolver/IBSAbsAttribute.java b/src/main/java/myutil/intboolsolver/IBSStdAttribute.java similarity index 85% rename from src/main/java/myutil/intboolsolver/IBSAbsAttribute.java rename to src/main/java/myutil/intboolsolver/IBSStdAttribute.java index 75cf5fe9d3..8d67540793 100644 --- a/src/main/java/myutil/intboolsolver/IBSAbsAttribute.java +++ b/src/main/java/myutil/intboolsolver/IBSStdAttribute.java @@ -35,25 +35,37 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. */ - package myutil.intboolsolver; +// import intboolsolver.IBSolver; // usefull in implementations /** - * Class IBSAbstractAttribute - * This Class is a documented interface for implementing IBSAttribute. - * It provides some partial implementation, tools and rules for extention. - * Creation: 27/02/2023 + * Class IBSStdAttribute (should be abstract), partially + * implementing {@link myutil.intboolsolver.IBSAttribute + * IBSAttribute} for systems with states as boolean leaves. + * Creation: 07/03/2023 + * + * <p> This class (together with + * {@link myutil.intboolsolver.IBSStdAttributeClass) + * IBSStdAttributeClass}) is a step toward an instantiation + * of the solver for systems with states as boolean leaves.</p> + * The (very) partial implementation provided here is sometime + * provided as code in comments that must be copied in final + * instantiation (when genericity disappear).</p> + * <p> To instantiate the solver using this approach, a fully + * implemented extension of this class must be provided. + * Comments in the file say what remains to implement + * (in the futur, abstraction, for automatic checking...).</p> * + * @version 0.1 07/03/2023 * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) - * @version 0.0 27/02/2023 */ -public class IBSAbsAttribute< - Spec extends IBSSpecParam, - Comp extends IBSCompParam, - State extends IBSStateParam, - SpecState extends IBSSpecStateParam, - CompState extends IBSCompStateParam +public class IBSStdAttribute< + Spec extends IBSParamSpec, + Comp extends IBSParamComp, + State extends IBSParamState, + SpecState extends IBSParamSpecState, + CompState extends IBSParamCompState > implements IBSAttribute< Spec , Comp , diff --git a/src/main/java/myutil/intboolsolver/IBSAbsAttributeClass.java b/src/main/java/myutil/intboolsolver/IBSStdAttributeClass.java similarity index 60% rename from src/main/java/myutil/intboolsolver/IBSAbsAttributeClass.java rename to src/main/java/myutil/intboolsolver/IBSStdAttributeClass.java index 955965db6f..8ce7bc0f85 100644 --- a/src/main/java/myutil/intboolsolver/IBSAbsAttributeClass.java +++ b/src/main/java/myutil/intboolsolver/IBSStdAttributeClass.java @@ -1,11 +1,71 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + package myutil.intboolsolver; -public class IBSAbsAttributeClass< - Spec extends IBSSpecParam, - Comp extends IBSCompParam, - State extends IBSStateParam, - SpecState extends IBSSpecStateParam, - CompState extends IBSCompStateParam, +/** + * Class IBSStdAttributeClass (should be abstract), partially + * implementing {@link myutil.intboolsolver.IBSAttributeClass + * IBSAttributeClass} for systems with states as boolean leaves. + * Creation: 07/03/2023 + * + * <p> This class (together with + * {@link myutil.intboolsolver.IBSStdAttribute) + * IBSStdAttribute}) is a step toward an instantiation + * of the solver for systems with states as boolean leaves.</p> + * The (very) partial implementation provided here is sometime + * provided as code in comments that must be copied in final + * instantiation (when genericity disappear).</p> + * <p> To instantiate the solver using this approach, a fully + * implemented extension of this class must be provided. + * Comments in the file say what remains to implement + * (in the futur, abstraction, for automatic checking...).</p> + * + * @version 0.1 07/03/2023 + * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) + */ + +public class IBSStdAttributeClass< + Spec extends IBSParamSpec, + Comp extends IBSParamComp, + State extends IBSParamState, + SpecState extends IBSParamSpecState, + CompState extends IBSParamCompState, Att extends IBSAttribute<Spec,Comp,State,SpecState,CompState> > extends IBSAttributeClass < Spec , diff --git a/src/main/java/myutil/intboolsolver/IBSTypedAttribute.java b/src/main/java/myutil/intboolsolver/IBSTypedAttribute.java index f742122a6f..ee3c8319b8 100644 --- a/src/main/java/myutil/intboolsolver/IBSTypedAttribute.java +++ b/src/main/java/myutil/intboolsolver/IBSTypedAttribute.java @@ -1,4 +1,46 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ package myutil.intboolsolver; +/** + * A class to allow parsing to return different types of result. + * @version 0.1 07/03/2023 + * @author Sophie Coudert + */ public class IBSTypedAttribute { private Object val = null; diff --git a/src/main/java/myutil/intboolsolver/IBSolver.java b/src/main/java/myutil/intboolsolver/IBSolver.java index b8ee5e9aa8..afc70289b8 100644 --- a/src/main/java/myutil/intboolsolver/IBSolver.java +++ b/src/main/java/myutil/intboolsolver/IBSolver.java @@ -37,14 +37,16 @@ */ package myutil.intboolsolver; - -import java.util.HashMap; -import java.util.Map; import java.util.HashSet; -import myutil.intboolsolver.IBSAttribute; + /** - * Class IBSolver - * Integer/boolean Expression Solver + * Class IBSolver implements the generic solver. + * + * <p>For general information about the solver, see + * {@link myutil.intboolsolver package page}.</p> + * + * <p>For documentation about exported API, see + * {@link myutil.intboolsolver.IBSolverAPI IBSolverAPI}</p> * Creation: 27/02/2023 * * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) @@ -52,11 +54,11 @@ import myutil.intboolsolver.IBSAttribute; */ public class IBSolver < - Spec extends IBSSpecParam, - Comp extends IBSCompParam, - State extends IBSStateParam, - SpecState extends IBSSpecStateParam, - CompState extends IBSCompStateParam, + Spec extends IBSParamSpec, + Comp extends IBSParamComp, + State extends IBSParamState, + SpecState extends IBSParamSpecState, + CompState extends IBSParamCompState, ATT extends IBSAttribute<Spec,Comp,State,SpecState,CompState>, AtC extends IBSAttributeClass<Spec,Comp,State,SpecState,CompState,ATT> > { diff --git a/src/main/java/myutil/intboolsolver/IBSolverInterface.java b/src/main/java/myutil/intboolsolver/IBSolverAPI.java similarity index 91% rename from src/main/java/myutil/intboolsolver/IBSolverInterface.java rename to src/main/java/myutil/intboolsolver/IBSolverAPI.java index 997ac0b945..1362fe9e33 100644 --- a/src/main/java/myutil/intboolsolver/IBSolverInterface.java +++ b/src/main/java/myutil/intboolsolver/IBSolverAPI.java @@ -37,24 +37,23 @@ */ package myutil.intboolsolver; - import java.util.HashSet; /** - * Class IBSolverInterface - * Integer/boolean Expression Solver features. For documentation, not for use... + * Class IBSolverAPI + * Integer/boolean Expression Solver API (exported features). For documentation, not for use... * Creation: /03_2023 * * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) * @version 0.0 27/02/2023 */ -public abstract class IBSolverInterface< - Spec extends IBSSpecParam, - Comp extends IBSCompParam, - State extends IBSStateParam, - SpecState extends IBSSpecStateParam, - CompState extends IBSCompStateParam, +public abstract class IBSolverAPI< + Spec extends IBSParamSpec, + Comp extends IBSParamComp, + State extends IBSParamState, + SpecState extends IBSParamSpecState, + CompState extends IBSParamCompState, ATT extends IBSAttribute<Spec,Comp,State,SpecState,CompState>, AtC extends IBSAttributeClass<Spec,Comp,State,SpecState,CompState,ATT> > { diff --git a/src/main/java/myutil/intboolsolver/package-info.java b/src/main/java/myutil/intboolsolver/package-info.java index 39c85045cf..2c00d3b4ac 100644 --- a/src/main/java/myutil/intboolsolver/package-info.java +++ b/src/main/java/myutil/intboolsolver/package-info.java @@ -53,8 +53,8 @@ * * </p> * <ul> - * <li> {@link myutil.intboolsolver.IBSolverInterface - * IBSolverInterface} provides documentation about the functions + * <li> {@link myutil.intboolsolver.IBSolverAPI + * IBSolverAPI} provides documentation about the functions * exported by the solver after it has been instantiated. * </li> * <li> <p>{@link myutil.intboolsolver.IBSolver IBSolver} is the solver @@ -68,68 +68,76 @@ * provide:</b></p> * <ul> * <li> <p>{@code Spec} class, which must implement {@link - * myutil.intboolsolver.IBSSpecParam IBSSpecParam}: The class of + * myutil.intboolsolver.IBSParamSpec IBSParamSpec}: The class of * global system specifications, which intuitively associates * leave structures to (spec-dedicated) leave identifiers).</p> * </li> * <li> <p>{@code Comp} class, which <b>must implement</b> {@link - * myutil.intboolsolver.IBSCompParam IBSCompParam}: the class + * myutil.intboolsolver.IBSParamComp IBSParamComp}: the class * of system components, which intuitively associates leave * structures to (comp-dedicated) leave identifiers).</p> * </li> - * <li> <p>{@code SpecState} class, which <b>must implement</b> - * {@link myutil.intboolsolver.IBSSpecStateParam - * IBSSpecStateParam}: the class of specification state, which - * intuitively associates leaves to int/bool values.</p> - * </li> - * <li> <p>{@code CompState} class, which <b>must implement</b> - * {@link myutil.intboolsolver.IBSCompStateParam - * IBSCompStateParam}: the class of component states, which - * intuitively associates leaves to int/bool values.</p> - * </li> * <li> <p>{@code State} class, which <b>must implement</b> - * {@link myutil.intboolsolver.IBSStateParam IBSStateParam}: + * {@link myutil.intboolsolver.IBSParamState IBSParamState}: * a class of states. It is intended to receive state machine * states in provided extensions but can be used another way * (in the provided extensions, there are state leaves that * may be true or false in different contexts...).</p> * </li> + * <li> <p>{@code SpecState} class, which <b>must implement</b> + * {@link myutil.intboolsolver.IBSParamSpecState + * IBSParamSpecState}: the class of specification state, which + * intuitively associates leaves to int/bool values.</p> + * </li> + * <li> <p>{@code CompState} class, which <b>must implement</b> + * {@link myutil.intboolsolver.IBSParamCompState + * IBSParamCompState}: the class of component states, which + * intuitively associates leaves to int/bool values.</p> + * </li> * </ul> * <p><b>WARNING!!</b> A successful instantiation requires that * class <i>xxx</i> (with <i>xxx</i> among {@code Spec}, {@code Comp}, * {@code SpecState}, {@code CompState} and {@code State}) does * not implement any IBS<i>yyy</i>Param with <i>yyy</i> * ≠ <i>xxx</i>.</p> - * <p>The structure of leaf expressions is then instantiation - * dependent and relies on "attribute" parameters which must - * also be provided (themselves parametrized by the five classes - * above) while instantiating. Attribute parameters are decomposed - * into two classes:</p> + * <p>{@link myutil.intboolsolver.IBSParamSpec IBSParamSpec}, + * {@link myutil.intboolsolver.IBSParamComp IBSParamComp}, + * {@link myutil.intboolsolver.IBSParamState IBSParamState}, + * {@link myutil.intboolsolver.IBSParamSpecState IBSParamSpecState} + * and + * {@link myutil.intboolsolver.IBSParamCompState IBSParamCompState} + * can be used as default parameters to instanciate solvers that do + * not implement the corresponding concepts.</p> + * <p>The structure of leaf expressions is instantiation dependent. + * Thus it is parametrized by "attribute" parameters (themselves + * parametrized by the five classes above) for which an + * implementation must also be provided in order to instantiate + * {@link myutil.intboolsolver.IBSolver IBSolver}. Attribute + * parameters are decomposed into two classes:</p> * <ul> - * <li> <p>an "attribute class" class which contains all the - * ("static") methods that do not depend on attribute - * instances</p> - * </li> - * <li> <p>an "attribute class" which allow to create + * <li> <p>an "Attribute" class which allow to create * attribute instances with instance dependent methods.</p> * </li> + * <li> <p>an "Attribute Class" class which contains all the + * methods that do not depend on attribute instances</p> + * </li> * </ul> * </li> * <li><p>{@link myutil.intboolsolver.IBSAttribute * IBSAttribute} is the interface describing the features - * to provide in order to instantiate the "attribute" class + * to provide in order to instantiate the "Attribute" class * of {@link myutil.intboolsolver.IBSolver * IBSolver} (features that depend on attribute instances). * <b> implementation must be provides </b>. It can be - * implemented using provided extensions.</p> + * implemented directly or using the provided extensions.</p> * </li> * <li><p>{@link myutil.intboolsolver.IBSAttributeClass * IBSAttributeClass} is the interface describing the features * to provide in order to instantiate the "attribute class" * class of {@link myutil.intboolsolver.IBSolver IBSolver} * (features that do not depend on attribute instances). - * <b> implementation must be provides </b>. It requires to - * instanciate an "attribute" parameter by a class that extends + * <b> implementation must be provided </b>. It requires to + * instanciate an "Attribute" parameter by a class that extends * {@link myutil.intboolsolver.IBSAttribute IBSAttribute}, * (with the same {@code Spec}, {@code Comp}, {@code SpecState}, * {@code CompState} and {@code State} parameters). @@ -200,31 +208,31 @@ * </ul> * * <hr> - * <span style="font-size: 120%"> Extension Abstract Attribute </span> + * <span style="font-size: 120%"> Extension Standard Attributes </span> * <p> This extension provides a skeleton for a typical * implementation with (boolean) state leaves. It provides a guided * way to implement some methods of * {@link myutil.intboolsolver.IBSAttribute IBSAttribute} and * {@link myutil.intboolsolver.IBSAttributeClass * IBSAttributeClass}</p> - * <p> Following the proposed method some partial implementation is - * provided. It is sometime provided as code in comments that must - * be copied in final instanciation (when genericity disappear).</p> - * <p> This extention refines the two abstract class for + * <p> Following the proposed approach, some partial implementation + * is provided. It is sometime provided as code in comments that must + * be copied in final instantiation (when genericity disappear).</p> + * <p> This extension refines the two abstract class for * attributes</p> * <p> Note: the two following classes should be abstract * (future work) making the remaining work to do more clear</p> * <ul> - * <li><p>{@link myutil.intboolsolver.IBSAbsAttribute - * IBSAbsAttribute} implements + * <li><p>{@link myutil.intboolsolver.IBSStdAttribute + * IBSStdAttribute} implements * {@link myutil.intboolsolver.IBSAttribute IBSAttribute}. * To instantiate the solver using this approach, <b>a fully * implemented extension of this class must be provided</b>. * Comments in the file say what remains to implement * (in the futur, abstraction, for automatic checking...). * </li> - * <li><p>{@link myutil.intboolsolver.IBSAbsAttributeClass - * IBSAbsAttributeClass} implements + * <li><p>{@link myutil.intboolsolver.IBSStdAttributeClass + * IBSStdAttributeClass} implements * {@link myutil.intboolsolver.IBSAttributeClass * IBSAttributeClass}. * To instantiate the solver using this approach, <b>a fully @@ -236,11 +244,11 @@ * * <p><b>Instantiation summary:</b></p> * <p> similar to <a href="#instanciation_sumary"> the previously - * described process</a>, replacing IBSAttribute by IBSAbsAttribute - * and IBSAttributeClass by IBSAbsAttributeClass.</p> + * described process</a>, replacing IBSAttribute by IBSStdAttribute + * and IBSAttributeClass by IBSStdAttributeClass.</p> * - * @version 0.0 27/02/2023 + * @version 0.1 07/03/2023 * - * @author Sophie Coudert + * @author Sophie Coudert (rewrite from Alessandro TEMPIA CALVINO) */ package myutil.intboolsolver; \ No newline at end of file -- GitLab