【发布时间】:2014-01-25 23:19:28
【问题描述】:
我是一名新的合金学习者。我有几件事想知道。
是否可以创建元素?
您将如何建模 AND 逻辑门?
我的想法是无用的,就像
open util/ordering[Time]
sig Time {frame: set gate}
abstract sig gate{}
sig ABinCout extends gate{
getA : A,
getB : B,
outputsC : C,
}
abstract sig Signals {}
sig A extends Signals{}
sig B extends Signals{}
sig C extends Signals{}
fact{first.frame = gate && no gate.getA && no gate.getB && no gate.outputsC }
pred GateAB [t,t' : set Time,Gate : ABinCout]{
one a : A | one b : B | {
Gate.getA = Gate.getA + a
Gate.getB = Gate.getB + b
}}
pred GateABparaC [Gate : set ABinCout]{
one a : Gate.getA | one b : Gate.getB | one c : C{
Gate.getA = Gate.getA - a
Gate.getB = Gate.getB - b
Gate.outputsC = Gate.outputsC + c
}}
pred GateC [Gate : set ABinCout]{
one c : Gate.outputsC | {
Gate.outputsC =Gate.outputsC - c
}}
fact{
all t : Time, t' : t.next | one cel: ABinCout{
GateAB[t,t',cel]
}}
run{ }for exactly 2 Time, 1 ABinCout, 3 A, 3 B, 1 C
我可以从字面上说我对合金一无所知,但我想单独代表门......然后我产生 2 个输入......然后在另一个帧中它产生一个不是任何输入的输出!
提前致谢
如果有什么我应该阅读或现在要执行此任务的内容,请说出来。
【问题讨论】: