Skip to content

How to get the largest value less than a specified value from a list of integers #776

Answered by crapo
AbhaMoitra asked this question in Q&A
Discussion options

You must be logged in to vote

@AbhaMoitra , I think that you must either separate the comparison operation from the list operation or else create a custom built-in function that combines the two. Following the former approach, consider this model:

 uri "http://sadl.org/TestList2.sadl" alias testlist2.
 
 TestClass is a class
described by snapshot with values of type PropSnapshot
described by ind with a single value of type int.
PropSnapshot is a class
described by prop1 with a single value of type int
described by prop2 with a single value of type int.

valueLessThanThreshold describes TestClass with values of type int.
maxLessThanThreshold describes TestClass with a single value of type int.

Rule R1:
	if matl is a T…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AbhaMoitra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants