Explorar o código

Add Clafer input file for BSML features

Joeri Exelmans %!s(int64=5) %!d(string=hai) anos
pai
achega
dd03ed9d46
Modificáronse 2 ficheiros con 177 adicións e 0 borrados
  1. 3 0
      bsml_features/README.md
  2. 174 0
      bsml_features/bsml.cfr

+ 3 - 0
bsml_features/README.md

@@ -0,0 +1,3 @@
+The file `bsml.cfr` defines the complete family of Big-Step Modeling Languages from [Day & Atlee 2010](https://doi.org/10.1007/s00766-010-0102-z). It is taken from the feature diagrams for syntactic and semantic variations, and the additional constraints listed in the paper.
+
+It serves as input to the **Clafer** ([github](https://github.com/gsdlab/clafer)) tool. Clafer compiles this to several  formats, one of which is the input format of **ChocoSolver** ([github](https://github.com/gsdlab/chocosolver)), which can automatically generate instances.

+ 174 - 0
bsml_features/bsml.cfr

@@ -0,0 +1,174 @@
+abstract xor EventOptions
+	PresentInWhole
+	PresentInRemainder
+	PresentInNextComboStep
+	PresentInNextSmallStep
+	PresentInSame
+		[BSML.Semantics.ConcurrencyAndConsistency.Concurrency.Many]
+
+abstract BSML
+	Syntax
+		Events?
+			[Semantics.EventLifeLine]
+			EventTriggers?
+				EnvironmentalInputEvents?
+					[Semantics.EventLifeLine.ExternalEvents.ExternalInputEvents.ExternalInputEventOptions.SyntacticInputEvents]
+					NegatedEnvironmentalnputEvents?
+						[Semantics.Priority.NegationOfTriggers]
+				InterfaceEvents?
+					[Syntax.Events.GeneratedEvents.GeneratedInterfaceEvents]
+					[Semantics.EventLifeLine.InterfaceEvents]
+					NegatedInterfaceEvents?
+						[Semantics.Priority.NegationOfTriggers]
+				NegatedEvents?
+					[Semantics.Priority.NegationOfTriggers]
+			GeneratedEvents?
+				EnvironmentalOutputEvents?
+					[Semantics.EventLifeLine.ExternalEvents.ExternalOutputEvents.ExternalOutputEventOptions.SyntacticOutputEvents]
+				GeneratedInterfaceEvents?
+					[Syntax.Events.EventTriggers.InterfaceEvents]
+
+		Variables?
+			VariableOperators?
+				new?
+					[Semantics.OrderOfSmallSteps.Dataflow]
+					[Semantics.EnablednessMemoryProtocol.InternalVariablesInGC.GCBigStep ||
+					 Semantics.EnablednessMemoryProtocol.InternalVariablesInGC.GCSmallStep ||
+					 Semantics.AssignmentMemoryProtocol.InternalVariablesInRHS.RHSBigStep ||
+					 Semantics.AssignmentMemoryProtocol.InternalVariablesInRHS.RHSSmallStep]
+				new_small?
+					[Semantics.EnablednessMemoryProtocol.InternalVariablesInGC.GCSmallStep ||
+					 Semantics.AssignmentMemoryProtocol.InternalVariablesInRHS.RHSSmallStep]
+				cur?
+					[Semantics.EnablednessMemoryProtocol.InternalVariablesInGC.GCBigStep ||
+					 Semantics.AssignmentMemoryProtocol.InternalVariablesInRHS.RHSBigStep]
+				pre?
+					[Semantics.EnablednessMemoryProtocol.InternalVariablesInGC.GCSmallStep ||
+					 Semantics.AssignmentMemoryProtocol.InternalVariablesInRHS.RHSSmallStep]
+			VariableAssignments?
+				[Semantics.AssignmentMemoryProtocol]
+				EnvironmentalOutputVariablesInLHS?
+				InterfaceVariablesInRHS?
+					[Semantics.AssignmentMemoryProtocol.InterfaceVariablesInRHS]
+				EnvironmentalInputVariablesInRHS?
+			GuardConditions?
+				[Semantics.EnablednessMemoryProtocol]
+				InterfaceVariablesInGC?
+					[Semantics.EnablednessMemoryProtocol.InterfaceVariablesInGC]
+				EnvironmentalInputVariablesInGC?
+
+		ControlStates?
+			Hierarchical?
+				And?
+					[Semantics.ConcurrencyAndConsistency]
+			Stable?
+				[Semantics.BigStepMaximality.Syntactic]
+			ComboStable?
+				[Semantics.ComboStepMaximality.ComboSyntactic]
+
+	Semantics
+		xor BigStepMaximality
+			Syntactic
+				[Syntax.ControlStates.Stable]
+			TakeOne
+			TakeMany
+
+		xor ComboStepMaximality ?
+			// Need any other combo-step semantic option for this to have meaning:
+			[Semantics.EventLifeLine.InternalEvents.PresentInNextComboStep ||
+			 Semantics.EventLifeLine.ExternalEvents.ExternalInputEvents.EventOptions.PresentInNextComboStep ||
+			 Semantics.EventLifeLine.ExternalEvents.ExternalOutputEvents.EventOptions.PresentInNextComboStep ||
+			 Semantics.EnablednessMemoryProtocol.InternalVariablesInGC.GCComboStep ||
+			 Semantics.AssignmentMemoryProtocol.InternalVariablesInRHS.RHSComboStep]
+			// Options:
+			ComboSyntactic
+				[Syntax.ControlStates.ComboStable]
+			ComboTakeOne
+			ComboTakeMany
+				[not Semantics.BigStepMaximality.TakeOne]
+
+		ConcurrencyAndConsistency ?
+			[Syntax.ControlStates.Hierarchical.And]
+			xor Concurrency
+				Single
+				Many
+					xor SmallStepConsistency
+						SourceDestinationOrthogonal
+						ArenaOrthogonal
+					xor Preemption
+						NonPreemptive
+						Preemptive
+
+		EventLifeLine ?
+			[Syntax.Events]
+			InternalEvents : EventOptions
+			ExternalEvents ?
+				ExternalInputEvents ?
+					EventOptions : EventOptions
+					xor ExternalInputEventOptions
+						SyntacticInputEvents
+							[Syntax.Events.EventTriggers.EnvironmentalInputEvents]
+						ReceivedEventsAsEnvironmental
+						HybridInputEvents
+				ExternalOutputEvents ?
+					EventOptions : EventOptions
+					xor ExternalOutputEventOptions
+						SyntacticOutputEvents
+							[Syntax.Events.GeneratedEvents.EnvironmentalOutputEvents]
+						LastComboStepGeneratedEvents
+						LastSmallStepGeneratedEvents
+						HybridOutputEvents
+			xor InterfaceEvents ?
+				[Syntax.Events.EventTriggers.InterfaceEvents]
+				StrongSynchronousEvent
+				WeakSynchronousEvent
+				AsynchronousEvent
+
+		EnablednessMemoryProtocol ?
+			[Syntax.Variables.GuardConditions]
+			xor InternalVariablesInGC
+				GCBigStep
+				GCSmallStep
+				GCComboStep
+			xor InterfaceVariablesInGC ?
+				[Syntax.Variables.GuardConditions.InterfaceVariablesInGC]
+				GCStrongSynchronousVariable
+				GCWeakSynchronousVariable
+				GCAsynchronousVariable
+
+		AssignmentMemoryProtocol ?
+			[Syntax.Variables.VariableAssignments]
+			xor InternalVariablesInRHS
+				RHSBigStep
+				RHSSmallStep
+				RHSComboStep
+			xor InterfaceVariablesInRHS ?
+				[Syntax.Variables.VariableAssignments.InterfaceVariablesInRHS]
+				RHSStrongSynchronousVariable
+				RHSWeakSynchronousVariable
+				RHSAsynchronousVariable
+
+		xor OrderOfSmallSteps ?
+			None
+			ExplicitOrdering
+			Dataflow
+				[Syntax.Variables.VariableOperators.new]
+
+		Priority ?
+			Hierarchical?
+				[Syntax.ControlStates.Hierarchical]
+			ExplicitPriority?
+			NegationOfTriggers?
+				[Syntax.Events.EventTriggers.NegatedEvents ||
+				 Syntax.Events.EventTriggers.InterfaceEvents.NegatedInterfaceEvents ||
+				 Syntax.Events.EventTriggers.EnvironmentalInputEvents.NegatedEnvironmentalnputEvents]
+
+aBSML : BSML
+
+// validConfiguration : BSML
+// 	[PresentInSame]
+// 	[ComboTakeMany]
+
+// invalidConfiguration : BSML
+// 	[PresentInSame]
+// 	[not Concurrency]